Learn R Programming

GAS (version 0.3.4.1)

UniGASSim: Simulate Univariate GAS processes

Description

Simulate Univariate GAS processes.

Usage

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

Value

An object of the class uGASSim.

Arguments

fit

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

T.sim

numeric Length of the simulated time series.

kappa

numeric Vector of unconditional level for the reparametrised vector of parameters. Only used if fit = NULL

A

matrix Of coefficients of dimension K x K that premultiply the conditional score in the GAS updating recursion, see Details. Only used if fit = NULL

B

matrix Of autoregressive coefficients of dimension K x K, see Details. Only used if fit = NULL

Dist

character Label of the conditional distribution, see DistInfo. Only used if fit = NULL

ScalingType

character Indicating the scaling mechanism for the conditional score. Possible choices are "Identity", "Inv", "InvSqrt". Note that, for some distribution only ScalingType = "Identity" is supported, see the function DistInfo. When ScalingType = "InvSqrt" the inverse of the Cholesky decomposition of the information matrix is used. Default value ScalingType = "Identity". Only used if fit = NULL

Author

Leopoldo Catania

Details

The function permits to simulate from an estimated uGASFit 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 univariate 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 \(\Lambda(.)\) is the mapping function (see UniMapParameters) 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 vKappa 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 Student-t conditional
# distribution, time-varying location, scale and fixed shape parameter.

library(GAS)

set.seed(786)

T.sim  = 1000 # number of observations to simulate
Dist   = "std" # conditional Studen-t distribution


# vector of unconditional reparametrised parameters such that, the unconditional level of
# \eqn{\theta}_{t} is (0, 1.5 ,7), i.e. location = 0, scale = 1.5,
# degrees of freedom = 7.

kappa = c(0.0, log(1.5), log(7-2.01))

# in this way we specify that the shape parameter is constant while the score
# coefficients for the location and the scale
# parameters are 0.001 and 0.01, respectively.

A = matrix(c(0.001 , 0.0  , 0.0 ,
             0.0   , 0.01 , 0.0 ,
             0.0   , 0.0  , 0.0 ), 3, byrow = TRUE)

B = matrix(c(0.7 , 0.0 , 0.0 ,
              0.0 , 0.98, 0.0 ,
              0.0 , 0.0 , 0.0),3,byrow = TRUE) # Matrix of autoregressive parameters.

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

Sim

Run the code above in your browser using DataLab