stmar_to_gstmar function

Estimate a G-StMAR model based on a StMAR model with large degrees of freedom parameters

Estimate a G-StMAR model based on a StMAR model with large degrees of freedom parameters

stmar_to_gstmar estimates a G-StMAR model based on a StMAR model with large degree of freedom parameters.

stmar_to_gstmar( gsmar, maxdf = 100, estimate, calc_std_errors, maxit = 100, custom_h = NULL )

Arguments

  • gsmar: a class 'gsmar' object, typically generated by fitGSMAR or GSMAR.
  • maxdf: regimes with degrees of freedom parameter value larger than this will be turned into GMAR type.
  • estimate: set TRUE if the new model should be estimated with a variable metric algorithm using the StMAR model parameter value as the initial value. By default TRUE iff the model contains data.
  • calc_std_errors: set TRUE if the approximate standard errors should be calculated. By default TRUE iff the model contains data.
  • maxit: the maximum number of iterations for the variable metric algorithm. Ignored if estimate==FALSE.
  • 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 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

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).

Details

If a StMAR model contains large estimates for the degrees of freedom parameters, one should consider switching to the corresponding G-StMAR model that lets the corresponding regimes to be GMAR type. stmar_to_gstmar does this switch conveniently.

Examples

# These are long running example that take approximately 15 seconds to run. fit42t <- fitGSMAR(data=M10Y1Y, p=4, M=2, model="StMAR", ncalls=1, seeds=6) fit42t # Overly large degrees of freedom estimate! # Switch to the appropriate G-StMAR model: fit42gs <- stmar_to_gstmar(fit42t) fit42gs

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

  • Maintainer: Savi Virolainen
  • License: GPL-3
  • Last published: 2025-04-07

Useful links