profile_logliks: Plot profile log-likehoods around the estimates

View source: R/diagnosticPlot.R

profile_logliksR Documentation

Plot profile log-likehoods around the estimates

Description

profile_logliks plots profile log-likelihoods around the estimates.

Usage

profile_logliks(
  gsmvar,
  which_pars,
  scale = 0.02,
  nrows,
  ncols,
  precision = 200,
  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.

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.

precision

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

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

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.

Value

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

References

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

  • Lütkepohl H. 2005. New Introduction to Multiple Time Series Analysis, Springer.

  • McElroy T. 2017. Computation of vector ARMA autocovariances. Statistics and Probability Letters, 124, 92-96.

  • Virolainen S. 2022. Structural Gaussian mixture vector autoregressive model with application to the asymmetric effects of monetary policy shocks. Unpublished working paper, available as arXiv:2007.04713.

  • Virolainen S. 2022. Gaussian and Student's t mixture vector autoregressive model with application to the asymmetric effects of monetary policy shocks in the Euro area. Unpublished working paper, available as arXiv:2109.13648.

See Also

get_soc, diagnostic_plot, fitGSMVAR, GSMVAR, GIRF, LR_test, Wald_test, cond_moment_plot

Examples


# Running all the below examples takes approximately 2 minutes.

# GMVAR(1,2) model
fit12 <- fitGSMVAR(gdpdef, p=1, M=2, ncalls=1, seeds=1)
fit12
profile_logliks(fit12)

# Structural GMVAR(1,2) model identified with sign
# constraints: model build based on inaccurate hand-given estimates.
W_122 <- matrix(c(1, 1, -1, 1), nrow=2)
params12s <- c(0.55, 0.11, 0.62, 0.17, 0.34, 0.05, -0.01, 0.72, 0.25,
 0.02, -0.14, 0.86, 0.54, 0.06, -0.16, 0.16, 3.62, 4.73, 0.67)
mod12s <- GSMVAR(gdpdef, p=1, M=2, params=params12s,
                structural_pars=list(W=W_122))
profile_logliks(mod12s)

#' # G-StMVAR(2, 1, 1), d=2 model:
params22gs <- c(0.697, 0.154, 0.049, 0.374, 0.476, 0.318, -0.645, -0.302,
 -0.222, 0.193, 0.042, -0.013, 0.048, 0.554, 0.033, 0.184, 0.005, -0.186,
  0.683, 0.256, 0.031, 0.026, 0.204, 0.583, -0.002, 0.048, 0.182, 4.334)
mod22gs <- GSMVAR(gdpdef, p=2, M=c(1, 1), params=params22gs, model="G-StMVAR")
profile_logliks(mod22gs, which_pars=c(1, 3, 28))


gmvarkit documentation built on Nov. 15, 2023, 1:07 a.m.