Learn R Programming

uGMAR (version 3.2.6)

iterate_more: Maximum likelihood estimation of GMAR, StMAR, or G-StMAR model with preliminary estimates

Description

iterate_more uses a variable metric algorithm to finalize maximum likelihood estimation of a GMAR, StMAR or G-StMAR model (object of class 'gsmar') which already has preliminary estimates.

Usage

iterate_more(gsmar, maxit = 100, custom_h = NULL, calc_std_errors = TRUE)

Arguments

gsmar

object of class 'gsmar' created with the function fitGSMAR or GSMAR.

maxit

the maximum number of iterations for the variable metric algorithm.

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.

calc_std_errors

should approximate standard errors be calculated?

Value

Returns an object of class 'gsmar' defining the estimated model.

Details

The main purpose of iterate_more is to provide a simple and convenient tool to finalize the estimation when the maximum number of iterations is reached when estimating a model with the main estimation function fitGSMAR. iterate_more is essentially a wrapper for the functions optim from the package stats and GSMAR from the package uGMAR.

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

  • Virolainen S. 2020. A mixture autoregressive model based on Gaussian and Student's t-distribution. arXiv:2003.05221 [econ.EM].

See Also

fitGSMAR, GSMAR, stmar_to_gstmar, profile_logliks, optim

Examples

Run this code
# NOT RUN {
# Estimate GMAR model with only 50 generations of genetic algorithm and
# only 1 iteration in variable metric algorithm
fit13 <- fitGSMAR(T10Y1Y, 1, 3, maxit=1, ngen=50, ncalls=1, seeds=1)
fit13

# Iterate more since iteration limit was reached
fit13 <- iterate_more(fit13)
fit13
# }

Run the code above in your browser using DataLab