profile_logliks {sstvars}R Documentation

Plot profile log-likelihood functions about the estimates

Description

profile_logliks plots profile log-likelihood functions about the estimates.

Usage

profile_logliks(
  stvar,
  which_pars,
  scale = 0.02,
  nrows,
  ncols,
  precision = 50,
  stab_tol = 0.001,
  posdef_tol = 1e-08,
  distpar_tol = 1e-08,
  weightpar_tol = 1e-08
)

Arguments

stvar

an object of class 'stvar', created by, e.g., fitSTVAR or fitSSTVAR.

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...

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 function be evaluated at?

stab_tol

numerical tolerance for stability of condition of the regimes: if the "bold A" matrix of any regime has eigenvalues larger that 1 - stat_tol the parameter is considered to be outside the parameter space. Note that if 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 parameter is considered to be outside the parameter space. Note that if the tolerance is too small, numerical evaluation of the log-likelihood might fail and cause error.

distpar_tol

the parameter vector is considered to be outside the parameter space if the degrees of freedom parameters is not larger than 2 + distpar_tol (applies only if cond_dist="Student").

weightpar_tol

numerical tolerance for weight parameters being in the parameter space. Values closer to to the border of the parameter space than this are considered to be "outside" the parameter space.

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

See Also

get_foc, get_soc, diagnostic_plot

Examples

# Threshold STVAR with p=1, M=2, the first lag of the second variable as switching variable:
pars <- c(0.5231, 0.1015, 1.9471, 0.3253, 0.3476, 0.0649, -0.035, 0.7513, 0.1651,
 -0.029, -0.7947, 0.7925, 0.4233, 5e-04, 0.0439, 1.2332, -0.0402, 0.1481, 1.2036)
mod12thres <- STVAR(data=gdpdef, p=1, M=2, params=pars, weight_function="threshold",
  weightfun_pars=c(2, 1))

# Plot the profile log-likelihood functions of all parameters:
profile_logliks(mod12thres, precision=50) # Plots fast with precision=50

# Plot only the profile log-likelihood function of the threshold parameter
# (which is the last parameter in the parameter vector):
profile_logliks(mod12thres, which_pars=length(pars), precision=100)

# Plot only the profile log-likelihood functions of the intercept parameters
# (which are the first four parameters in the parameter vector, as d=2 and M=2):
profile_logliks(mod12thres, which_pars=1:4, precision=100)

[Package sstvars version 1.0.1 Index]