Learn R Programming

gmvarkit (version 1.2.0)

iterate_more: Maximum likelihood estimation of a GMVAR model with preliminary estimates

Description

iterate_more uses a variable metric algorithm to finalize maximum likelihood estimation of a GMVAR model (object of class 'gmvar') which already has preliminary estimates.

Usage

iterate_more(gmvar, maxit = 100, calc_std_errors = TRUE)

Arguments

gmvar

an object of class 'gmvar' created with fitGMVAR or GMVAR.

maxit

the maximum number of iterations in the variable metric algorithm.

calc_std_errors

should approximate standard errors be calculated?

Value

Returns an object of class 'gmvar' defining the estimated GMVAR model.

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 model with the main estimation function fitGMVAR. iterate_more is essentially a wrapper around the function optim from the package stats and GMVAR from the package gmvarkit.

References

  • Kalliovirta L., Meitz M. and Saikkonen P. 2016. Gaussian mixture vector autoregression. Journal of Econometrics, 192, 485-498.

  • Kalliovirta L. and Saikkonen P. 2010. Reliable Residuals for Multivariate Nonlinear Time Series Models. Unpublished Revision of HECER Discussion Paper No. 247.

  • Virolainen S. 2020. Structural Gaussian mixture vector autoregressive model. Unpublished working paper, available as arXiv:2007.04713.

See Also

fitGMVAR, GMVAR, optim, profile_logliks

Examples

Run this code
# NOT RUN {
## These are long running examples that use parallel computing!

# These examples use the data 'eurusd' which comes with the
# package, but in a scaled form.
data <- cbind(10*eurusd[,1], 100*eurusd[,2])
colnames(data) <- colnames(eurusd)

# GMVAR(1,2) model, only 5 iterations of the variable metric
# algorithm
fit12 <- fitGMVAR(data, p=1, M=2, maxit=5)
fit12

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

# Structural GMVAR(1,2) model identified with sign
# constraints. Only 10 iterations of the variable metric
# algorithm
W_122 <- matrix(c(1, -1, NA, 1), nrow=2)
fit12s <- fitGMVAR(data, p=1, M=2, structural_pars=list(W=W_122),
  ncalls=10, maxit=10, seeds=1:10)
fit12s

# Iterate more:
fit12s_2 <- iterate_more(fit12s)
fit12s_2

# GMVAR(2,2) model with autoregressive parameters restricted
# to be the same for all regimes, only 10 iterations of the
# variable metric algorithm
C_mat <- rbind(diag(2*2^2), diag(2*2^2))
fit22c <- fitGMVAR(data, p=2, M=2, constraints=C_mat, maxit=10)
fit22c

# Iterate more:
fit22c_2 <- iterate_more(fit22c)
fit22c_2

# GMVAR(3,2) model, only 10 iterations of the variable metric
# algorithm
fit32 <- fitGMVAR(data, p=3, M=2, maxit=10)
fit32

# Iterate more:
fit32_2 <- iterate_more(fit32)
fit32_2
# }

Run the code above in your browser using DataLab