MultiGASSim: Simulate multivariate GAS processes

Description Usage Arguments Details Value Author(s) References Examples

View source: R/Simulate.R

Description

Simulate multivariate GAS processes.

Usage

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

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.

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|θ_{t})

where θ_{t} is the vector of parameters for the density p(y|.). Note that, θ_{t} includes also those parameters that are not time-varying. The GAS recursion for θ_{t} is:

θ_{t} = Λ(\tilde{θ}_{t})

\tilde{θ}_{t}=κ + A*s_{t-1} + B*\tilde{θ}_{t-1}

where h(.) is the mapping function (see MultiMapParameters) and \tilde{θ}_{t} is the vector of reparametrised parameters. The process is initialized at θ_{1}=(I - B)^{-1}κ, where κ is the Kappa vector. The vector s_{t} is the scaled score of p(y|.) with respect to \tilde{θ}_{t}. See Ardia et. al. (2016a) for further details.

Value

An object of the class mGASSim

Author(s)

Leopoldo Catania

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# 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

Example output

Attaching package: 'GAS'

The following object is masked from 'package:stats':

    residuals


------------------------------------------
-          Univariate GAS Sim            -
------------------------------------------

Model Specification:	
T =  1000
N =  3
Conditional distribution:  mvt
Score scaling type:  Identity
------------------------------------------
Parameters:
vKappa:
            [,1]
 [1,]  0.1000000
 [2,]  0.2000000
 [3,]  0.3000000
 [4,]  0.0000000
 [5,]  0.1823216
 [6,] -1.2039728
 [7,]  1.4706289
 [8,]  1.3694384
 [9,]  1.2794799
[10,] -2.6625878
attr(,"names")
 [1] "mu1"   "mu2"   "mu3"   "phi1"  "phi2"  "phi3"  "rho12" "rho13" "rho23"
[10] "nu"   
mA:
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    0    0    0 0.00 0.00 0.00 0.00 0.00 0.00     0
 [2,]    0    0    0 0.00 0.00 0.00 0.00 0.00 0.00     0
 [3,]    0    0    0 0.00 0.00 0.00 0.00 0.00 0.00     0
 [4,]    0    0    0 0.05 0.00 0.00 0.00 0.00 0.00     0
 [5,]    0    0    0 0.00 0.01 0.00 0.00 0.00 0.00     0
 [6,]    0    0    0 0.00 0.00 0.09 0.00 0.00 0.00     0
 [7,]    0    0    0 0.00 0.00 0.00 0.01 0.00 0.00     0
 [8,]    0    0    0 0.00 0.00 0.00 0.00 0.04 0.00     0
 [9,]    0    0    0 0.00 0.00 0.00 0.00 0.00 0.07     0
[10,]    0    0    0 0.00 0.00 0.00 0.00 0.00 0.00     0
mB:
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    0    0    0  0.0  0.0  0.0 0.00 0.00 0.00     0
 [2,]    0    0    0  0.0  0.0  0.0 0.00 0.00 0.00     0
 [3,]    0    0    0  0.0  0.0  0.0 0.00 0.00 0.00     0
 [4,]    0    0    0  0.7  0.0  0.0 0.00 0.00 0.00     0
 [5,]    0    0    0  0.0  0.7  0.0 0.00 0.00 0.00     0
 [6,]    0    0    0  0.0  0.0  0.5 0.00 0.00 0.00     0
 [7,]    0    0    0  0.0  0.0  0.0 0.94 0.00 0.00     0
 [8,]    0    0    0  0.0  0.0  0.0 0.00 0.97 0.00     0
 [9,]    0    0    0  0.0  0.0  0.0 0.00 0.00 0.92     0
[10,]    0    0    0  0.0  0.0  0.0 0.00 0.00 0.00     0

------------------------------------------
Unconditional Parameters:
        mu1         mu2         mu3        phi1        phi2        phi3 
 0.10000000  0.20000000  0.30000000  1.00000000  1.83627401  0.09000000 
      rho12       rho13       rho23          nu 
 0.81256355 -0.09471122  0.47979982  7.00000000 

GAS documentation built on Feb. 4, 2022, 5:12 p.m.