fitGSMAR
alt_gsmar
constructs a GSMAR model based on results from an arbitrary estimation round of fitGSMAR
.
alt_gsmar(gsmar, which_round = 1, calc_qresiduals = TRUE,
calc_cond_moments = TRUE, calc_std_errors = TRUE, custom_h = NULL)
object of class 'gsmar'
created with the function fitGSMAR
or GSMAR
.
based on which estimation round should the model be constructed? An integer value in 1,...,ncalls
.
should quantile residuals be calculated? Default is TRUE
iff the model contains data.
should conditional means and variances be calculated? Default is TRUE
iff the model contains data.
should approximate standard errors be calculated?
A numeric vector of with same length as the parameter vector of the estimated model: i:th element
of custom_h is the difference used in central difference approximation for differentials of the log-likelihood function
for the i:th parameter. If NULL
(default), then the difference used for differentiating overly large degrees of
freedom parameters is adjusted to avoid numerical problems, and the difference is 6e-6
for the other parameters.
Returns an object of class 'gsmar'
defining the specified GMAR, StMAR or G-StMAR model. If data is supplied, the returned object
contains (by default) empirical mixing weights, conditional means and variances and quantile residuals. Note that the first p observations are
taken as the initial values so mixing weights, conditional moments and qresiduals start from the p+1:th observation (interpreted as t=1).
It's sometimes useful to examine other estimates than the one with the highest log-likelihood value. This function
is just a simple wrapper to GSMAR
that picks the correct estimates from an returned by fitGSMAR
.
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 the G-StMAR model, but it's a straightforward generalization with theoretical properties similar to the GMAR and StMAR models.
fitGSMAR
, GSMAR
, iterate_more
, get_gradient
,
get_regime_means
, swap_parametrization
, stmar_to_gstmar
# NOT RUN {
# These are long running examples and use parallel computing
fit12t <- fitGSMAR(IE, 1, 2, model="StMAR", ncalls=2, seeds=1:2)
fit12t
fit12t2 <- alt_gsmar(fit12t, which_round=2)
fit12t2
# }
Run the code above in your browser using DataLab