alt_gsmar {uGMAR} | R Documentation |
Construct a GSMAR model based on results from an arbitrary estimation round of fitGSMAR
Description
alt_gsmar
constructs a GSMAR model based on results from an arbitrary estimation round of fitGSMAR
.
Usage
alt_gsmar(
gsmar,
which_round = 1,
which_largest,
calc_qresiduals = TRUE,
calc_cond_moments = TRUE,
calc_std_errors = TRUE,
custom_h = NULL
)
Arguments
gsmar |
a class 'gsmar' object, typically generated by |
which_round |
based on which estimation round should the model be constructed? An integer value in 1,..., |
which_largest |
based on estimation round with which largest log-likelihood should the model be constructed?
An integer value in 1,..., |
calc_qresiduals |
should quantile residuals be calculated? Default is |
calc_cond_moments |
should conditional means and variances be calculated? Default is |
calc_std_errors |
should approximate standard errors be calculated? |
custom_h |
A numeric vector with same the length as the parameter vector: i:th element of custom_h is the difference
used in central difference approximation for partial differentials of the log-likelihood function for the i:th parameter.
If |
Details
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 object returned by fitGSMAR
.
In addition to the S3 methods listed under the topic "Methods (by generic)", the predict
and simulate
methods
are also available for the class 'gsmar' objects (see ?predict.gsmar
and ?simulate.gsmar
).
Value
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, some conditional and unconditional moments, and quantile
residuals. Note that the first p observations are taken as the initial values so the mixing weights, conditional moments, and
quantile residuals start from the p+1:th observation (interpreted as t=1).
References
Kalliovirta L., Meitz M. and Saikkonen P. 2015. Gaussian Mixture Autoregressive model for univariate time series. Journal of Time Series Analysis, 36(2), 247-266.
Meitz M., Preve D., Saikkonen P. 2023. A mixture autoregressive model based on Student's t-distribution. Communications in Statistics - Theory and Methods, 52(2), 499-515.
Virolainen S. 2022. A mixture autoregressive model based on Gaussian and Student's t-distributions. Studies in Nonlinear Dynamics & Econometrics, 26(4) 559-580.
See Also
fitGSMAR
, GSMAR
, iterate_more
, get_gradient
,
get_regime_means
, swap_parametrization
, stmar_to_gstmar
Examples
# These are long running examples that take approximately ...
fit42t <- fitGSMAR(data=M10Y1Y, p=4, M=2, model="StMAR", ncalls=2,
seeds=c(1, 6))
fit42t # Bad estimate in the boundary of the stationarity region!
# So we build a model based on the next-best local maximum point:
fit42t_alt <- alt_gsmar(fit42t, which_largest=2)
fit42t_alt # Overly large degrees of freedom paramter estimate
# Switch to the appropriate G-StMAR model:
fit42gs <- stmar_to_gstmar(fit42t_alt)
fit42gs