Learn R Programming

gmvarkit (version 1.4.2)

alt_gmvar: Construct a GMVAR model based on results from an arbitrary estimation round of fitGMVAR

Description

alt_gmvar constructs a GMVAR model based on results from an arbitrary estimation round of fitGMVAR.

Usage

alt_gmvar(
  gmvar,
  which_round = 1,
  which_largest,
  calc_cond_moments = TRUE,
  calc_std_errors = TRUE
)

Arguments

gmvar

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

which_round

based on which estimation round should the model be constructed? An integer value in 1,...,ncalls.

which_largest

based on estimation round with which largest log-likelihood should the model be constructed? An integer value in 1,...,ncalls. For example, which_largest=2 would take the second largest log-likelihood and construct the model based on the corresponding estimates. If used, then which_round is ignored.

calc_cond_moments

should conditional means and covariance matrices should be calculated? Default is TRUE if the model contains data and FALSE otherwise.

calc_std_errors

should approximate standard errors be calculated?

Value

Returns an object of class 'gmvar' defining the specified reduced form or structural GMVAR model. Can be used to work with other functions provided in gmvarkit.

Remark that the first autocovariance/correlation matrix in $uncond_moments is for the lag zero, the second one for the lag one, etc.

Details

It's sometimes useful to examine other estimates than the one with the highest log-likelihood. This function is wrapper around GMVAR that picks the correct estimates from an object returned by fitGMVAR.

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, iterate_more, update_numtols

Examples

Run this code
# NOT RUN {
# These are long running examples and use parallel computing
# Running the below examples takes approximately 20 seconds.

data(eurusd, package="gmvarkit")
data <- cbind(10*eurusd[,1], 100*eurusd[,2])
colnames(data) <- colnames(eurusd)

# GMVAR(1,2) model
fit12 <- fitGMVAR(data, p=1, M=2, ncalls=2, seeds=7:8)
fit12
fit12_2 <- alt_gmvar(fit12, which_largest=2)
fit12_2
# }

Run the code above in your browser using DataLab