Learn R Programming

uGMAR (version 3.0.1)

add_data: Add data to object of class 'gsmar' defining a GMAR, StMAR or G-StMAR model

Description

add_data adds or updates data to object of class 'gsmar' that defines a GMAR, StMAR or G-StMAR model based on the given object. Also calculates mixing weights and quantile residuals accordingly.

Usage

add_data(data, gsmar, calc_qresiduals = TRUE, calc_std_errors = FALSE)

Arguments

data

a numeric vector class 'ts' object containing the data. NA values are not supported.

gsmar

object of class 'gsmar', generated by function fitGSMAR() or GSMAR().

calc_qresiduals

should quantile residuals be calculated? Default is TRUE if the model contains data.

calc_std_errors

should approximate standard errors be calculated?

Value

Returns an object of class 'gsmar' defining the GMAR, StMAR or G-StMAR model with the data added to the model. If the object already contained data, the data will be updated.

References

  • Kalliovirta L., Meitz M. and Saikkonen P. 2015. Gaussian Mixture Autoregressive model for univariate time series. Journal of Time Series Analysis, 36, 247-266.

  • Meitz M., Preve D., Saikkonen P. 2018. A mixture autoregressive model based on Student's t-distribution. arXiv:1805.04010 [econ.EM].

  • There are currently no published references for G-StMAR model, but it's a straightforward generalization with theoretical properties similar to GMAR and StMAR models.

See Also

fitGSMAR, GSMAR, iterate_more, get_gradient, get_regime_means

Examples

Run this code
# NOT RUN {
# GMAR model without data
params13 <- c(1.4, 0.88, 0.26, 2.46, 0.82, 0.74, 5.0, 0.68, 5.2, 0.72, 0.2)
gmar13 <- GSMAR(p=1, M=3, params=params13, model="GMAR")
gmar13

# Add data to the model
gmar13 <- add_data(data=VIX, gmar13)
gmar13
# }

Run the code above in your browser using DataLab