Learn R Programming

GAS (version 0.3.4.1)

MultiGASSim: Simulate multivariate GAS processes

Description

Simulate multivariate GAS processes.

Usage

MultiGASSim(fit = NULL, T.sim = 1000, N = NULL,
              kappa = NULL, A = NULL, B = NULL, Dist = NULL, ScalingType = NULL)

Value

An object of the class mGASSim

Arguments

fit

An estimated object of the class mGASFit. By default fit = NULL.

T.sim

numeric Length of the simulated time series.

N

numeric Cross sectional dimension (Only N<5 supported for now).

kappa

numeric vector of unconditional level for the reparametrized vector of parameters.

A

matrix of coefficients of dimension K x K that premultiply the conditional score in the GAS updating recursion, see Details.

B

matrix of autoregressive coefficients of dimension K x K, see Details.

Dist

character Label of the conditional distribution, see DistInfo.

ScalingType

character indicating the scaling mechanism for the conditional score. Only ScalingType = "Identity" is supported for multivariate distributions, see the function DistInfo.

Author

Leopoldo Catania

Details

The function permits to simulate from an estimated mGASFit object. If fit is not provided, the user can specify a GAS model via the additional arguments kappa, A, B, Dist and ScalingType.

All the information regarding the supported multivariate conditional distributions can be investigated using the DistInfo function. The model is specified as: $$y_{t}\sim p(y|\theta_{t})$$ where \(\theta_{t}\) is the vector of parameters for the density \(p(y|.)\). Note that, \(\theta_{t}\) includes also those parameters that are not time-varying. The GAS recursion for \(\theta_{t}\) is: $$\theta_{t} = \Lambda(\tilde{\theta}_{t})$$$$\tilde{\theta}_{t}=\kappa + A*s_{t-1} + B*\tilde{\theta}_{t-1}$$ where \(h(.)\) is the mapping function (see MultiMapParameters) and \(\tilde{\theta}_{t}\) is the vector of reparametrised parameters. The process is initialized at \(\theta_{1}=(I - B)^{-1}\kappa\), where \(\kappa\) is the Kappa vector. The vector \(s_{t}\) is the scaled score of \(p(y|.)\) with respect to \(\tilde{\theta}_{t}\). See Ardia et. al. (2016a) for further details.

References

Ardia D, Boudt K and Catania L (2016a). "Generalized Autoregressive Score Models in R: The GAS Package." https://www.ssrn.com/abstract=2825380.

Creal D, Koopman SJ, Lucas A (2013). "Generalized Autoregressive Score Models with Applications." Journal of Applied Econometrics, 28(5), 777-795. tools:::Rd_expr_doi("10.1002/jae.1279").

Harvey AC (2013). Dynamic Models for Volatility and Heavy Tails: With Applications to Financial and Economic Time Series. Cambridge University Press.

Examples

Run this code
# Simulate from a GAS process with Multivariate Student-t conditional
# distribution, time-varying locations, scales, correlations
# and fixed shape parameter.
library("GAS")

set.seed(786)

T.sim = 1000  # Number of observations to simulate.
N     = 3     # Trivariate series.
Dist  = "mvt" # Conditional Multivariate Studen-t distribution.

# Build unconditional vector of reparametrised parameters.

Mu  = c(0.1, 0.2, 0.3) # Vector of location parameters (this is not transformed).
Phi = c(1.0, 1.2, 0.3) # Vector of scale parameters for the firs, second and third variables.

Rho = c(0.1, 0.2, 0.3) # This represents vec(R), where R is the correlation matrix.
                       # Note that is up to the user to ensure that vec(R) implies a
                       # proper correlation matrix.

Theta = c(Mu, Phi, Rho, 7) # Vector of parameters such that the degrees of freedom are 7.

kappa = MultiUnmapParameters(Theta, Dist, N)

A = matrix(0, length(kappa), length(kappa))

# Update scales and correlations, do not update locations and shape parameters.
diag(A) = c(0, 0, 0, 0.05, 0.01, 0.09, 0.01, 0.04, 0.07, 0)

B = matrix(0, length(kappa), length(kappa))

# Update scales and correlations, do not update locations and shape parameters.
diag(B) = c(0, 0, 0, 0.7, 0.7, 0.5, 0.94, 0.97, 0.92, 0)

Sim = MultiGASSim(fit = NULL, T.sim, N, kappa, A, B, Dist, ScalingType = "Identity")

Sim

Run the code above in your browser using DataLab