Learn R Programming

gmvarkit (version 1.2.0)

profile_logliks: Plot profile log-likehoods around the estimates

Description

profile_logliks plots profile log-likelihoods around the estimates.

Usage

profile_logliks(
  gmvar,
  which_pars,
  scale = 0.02,
  nrows,
  ncols,
  precission = 200
)

Arguments

gmvar

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

which_pars

the profile log-likelihood function of which parameters should be plotted? An integer vector specifying the positions of the parameters in the parameter vector. The parameter vector has the form...

For unconstrained models:

Should be size \(((M(pd^2+d+d(d+1)/2+1)-1)x1)\) and have form \(\theta\)\( = \)(\(\upsilon\)\(_{1}\), ...,\(\upsilon\)\(_{M}\), \(\alpha_{1},...,\alpha_{M-1}\)), where:

  • \(\upsilon\)\(_{m}\) \( = (\phi_{m,0},\)\(\phi\)\(_{m}\)\(,\sigma_{m})\)

  • \(\phi\)\(_{m}\)\( = (vec(A_{m,1}),...,vec(A_{m,p})\)

  • and \(\sigma_{m} = vech(\Omega_{m})\), m=1,...,M.

For constrained models:

Should be size \(((M(d+d(d+1)/2+1)+q-1)x1)\) and have form \(\theta\)\( = (\phi_{1,0},...,\phi_{M,0},\)\(\psi\) \(,\sigma_{1},...,\sigma_{M},\alpha_{1},...,\alpha_{M-1})\), where:

  • \(\psi\) \((qx1)\) satisfies (\(\phi\)\(_{1}\)\(,...,\) \(\phi\)\(_{M}) =\) \(C \psi\). Here \(C\) is \((Mpd^2xq)\) constraint matrix.

Above, \(\phi_{m,0}\) is the intercept parameter, \(A_{m,i}\) denotes the \(i\):th coefficient matrix of the \(m\):th mixture component, \(\Omega_{m}\) denotes the error term covariance matrix of the \(m\):th mixture component, and \(\alpha_{m}\) is the mixing weight parameter.

The default is that profile log-likelihood functions for all parameters are plotted.

scale

a numeric scalar specifying the interval plotted for each estimate: the estimate plus-minus abs(scale*estimate).

nrows

how many rows should be in the plot-matrix? The default is max(ceiling(log2(length(which_pars)) - 1), 1).

ncols

how many columns should be in the plot-matrix? The default is ceiling(length(which_pars)/nrows). Note that nrows*ncols should not be smaller than the length of which_pars.

precission

at how many points should each profile log-likelihood be evaluated at?

Value

Only plots to a graphical device and doesn't return anything.

Details

When the number of parameters is large, it might be better to plot a smaller number of profile log-likelihood functions at a time using the argument which_pars.

The red vertical line points the estimate.

References

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

  • L<U+00FC>tkepohl H. 2005. New Introduction to Multiple Time Series Analysis, Springer.

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

See Also

get_soc, diagnostic_plot, fitGMVAR, GMVAR, GIRF, LR_test, Wald_test

Examples

Run this code
# NOT RUN {
# These examples use the data 'eurusd' which comes with the
# package, but in a scaled form (similar to Kalliovirta et al. 2016).
data(eurusd, package="gmvarkit")
data <- cbind(10*eurusd[,1], 100*eurusd[,2])
colnames(data) <- colnames(eurusd)

# GMVAR(1,2) model: 10 estimation rounds with seeds set
# for reproducibility
fit12 <- fitGMVAR(data, p=1, M=2, ncalls=10, seeds=1:10)
fit12
profile_logliks(fit12)

# Structural GMVAR(1,2) model identified with sign
# constraints.
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, seeds=1:10)
profile_logliks(fit12s)

# GMVAR(2,2) model with mean parametrization
fit22 <- fitGMVAR(data, p=2, M=2, parametrization="mean",
                  ncalls=16, seeds=11:26)
profile_logliks(fit22)

# GMVAR(2,2) model with autoregressive parameters restricted
# to be the same for both regimes
C_mat <- rbind(diag(2*2^2), diag(2*2^2))
fit22c <- fitGMVAR(data, p=2, M=2, constraints=C_mat)
profile_logliks(fit22c)

# GMVAR(2,2) model with autoregressive parameters restricted
# to be the same for both regimes and non-diagonl elements
# the coefficient matrices constrained to zero.
tmp <- matrix(c(1, rep(0, 10), 1, rep(0, 8), 1, rep(0, 10), 1),
 nrow=2*2^2, byrow=FALSE)
C_mat2 <- rbind(tmp, tmp)
fit22c2 <- fitGMVAR(data, p=2, M=2, constraints=C_mat2)
profile_logliks(fit22c2)
# }

Run the code above in your browser using DataLab