iterate_more {gmvarkit}R Documentation

Maximum likelihood estimation of a GMVAR, StMVAR, or G-StMVAR model with preliminary estimates

Description

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

Usage

iterate_more(
  gsmvar,
  maxit = 100,
  calc_std_errors = TRUE,
  custom_h = NULL,
  stat_tol = 0.001,
  posdef_tol = 1e-08,
  df_tol = 1e-08
)

Arguments

gsmvar

an object of class 'gsmvar', typically created with fitGSMVAR or GSMVAR.

maxit

the maximum number of iterations in the variable metric algorithm.

calc_std_errors

calculate approximate standard errors for the estimates?

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.

stat_tol

numerical tolerance for stationarity of the AR parameters: if the "bold A" matrix of any regime has eigenvalues larger that 1 - stat_tol the model is classified as non-stationary. Note that if the tolerance is too small, numerical evaluation of the log-likelihood might fail and cause error.

posdef_tol

numerical tolerance for positive definiteness of the error term covariance matrices: if the error term covariance matrix of any regime has eigenvalues smaller than this, the model is classified as not satisfying positive definiteness assumption. Note that if the tolerance is too small, numerical evaluation of the log-likelihood might fail and cause error.

df_tol

the parameter vector is considered to be outside the parameter space if all degrees of freedom parameters are not larger than 2 + df_tol.

Details

The 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 GMVAR, StMVAR, or G-StMVAR model with the main estimation function fitGSMVAR. iterate_more is essentially a wrapper around the function optim from the package stats and GSMVAR from the package gmvarkit.

Value

Returns an object of class 'gsmvar' defining the estimated GMVAR, StMVAR, or G-StMVAR model.

References

See Also

fitGSMVAR, GSMVAR, optim, profile_logliks, update_numtols

Examples


## These are long running examples that use parallel computing!
## Running the below examples takes approximately 2 minutes

# GMVAR(1,2) model, only 5 iterations of the variable metric
# algorithm
fit12 <- fitGSMVAR(gdpdef, p=1, M=2, ncalls=1, maxit=5, seeds=1)
fit12

# Iterate more:
fit12_2 <- iterate_more(fit12)
fit12_2


[Package gmvarkit version 2.1.2 Index]