gas_simulate {gasmodel}R Documentation

Simulate GAS Model

Description

A function for simulation of generalized autoregressive score (GAS) models of Creal et al. (2013) and Harvey (2013). Instead of supplying arguments about the model, the function can be applied to the gas object obtained by the gas() function.

Usage

gas_simulate(gas_object = NULL, t_sim = 1L, x_sim = NULL, distr = NULL,
  param = NULL, scaling = "unit", regress = "joint", n = NULL,
  p = 1L, q = 1L, par_static = NULL, par_link = NULL,
  par_init = NULL, coef_est = NULL)

Arguments

gas_object

An optional GAS estimate, i.e. a list of S3 class gas returned by function gas().

t_sim

A number of observations to simulate.

x_sim

Exogenous variables used for simulations. For a single variable common for all time-varying parameters, a numeric vector. For multiple variables common for all time-varying parameters, a numeric matrix with observations in rows. For individual variables for each time-varying parameter, a list of numeric vectors or matrices in the above form. The number of observation must be equal to t_sim.

distr

A conditional distribution. See distr() for available distributions.

param

A parametrization of the conditional distribution. If NULL, default parametrization is used. See distr() for available parametrizations.

scaling

A scaling function for the score. The supported scaling functions are the unit scaling (scaling = "unit"), the inverse of the Fisher information matrix scaling (scaling = "fisher_inv"), and the inverse square root of the Fisher information matrix scaling (scaling = "fisher_inv_sqrt"). The latter two scalings use the Fisher information for the time-varying parameters only. For the full Fisher information matrix for both time-varying and static parameters, there are the "full_fisher_inv" and "full_fisher_inv_sqrt" scalings. For the individual Fisher information for each parameter, there are the "diag_fisher_inv" and "diag_fisher_inv_sqrt" scalings. Note that when the parametrization is orthogonal (see distr()), there are no differences between these scaling variants.

regress

A specification of the regression and dynamic equation with regard to exogenous variables. The supported specifications are exogenous variables and dynamics within the same equation (regress = "joint") and separate equations for exogenous variables and dynamics in the fashion of regression models with dynamic errors (regress = "sep"). In a stationary model without exogenous variables, the two specifications are equivalent, although with differently parametrized intercept.

n

A dimension of the model. Required only for multivariate models.

p

A score order. For order common for all parameters, a numeric vector of length 1. For individual order for each parameter, a numeric vector of length equal to the number of parameters. Defaults to 1L.

q

An autoregressive order. For order common for all parameters, a numeric vector of length 1. For individual order for each parameter, a numeric vector of length equal to the number of parameters. Defaults to 1L.

par_static

An optional logical vector indicating static parameters. Overrides x, p, and q.

par_link

An optional logical vector indicating whether the logarithmic/logistic link should be applied to restricted parameters in order to obtain unrestricted values. Defaults to applying the logarithmic/logistic link for time-varying parameters and keeping the original link for constant parameters.

par_init

An optional numeric vector of initial values of time-varying parameters. For NA values or when NULL, set initial values to unconditional values of time-varying parameters. For example, in the case of GAS(1,1) model with regress = "joint", to omega / (1 - phi1). Not to be confused with starting values for the optimization coef_start.

coef_est

A numeric vector of estimated coefficients.

Value

A list of S3 class gas_simulate with components:

data$x_sim

The exogenous variables used in simulation.

model$distr

The conditional distribution.

model$param

The parametrization of the conditional distribution.

model$scaling

The scaling function.

model$regress

The specification of the regression and dynamic equation.

model$t_sim

The length of the simulated time series.

model$n

The dimension of the model.

model$m

The number of exogenous variables.

model$p

The score order.

model$q

The autoregressive order.

model$par_static

The static parameters.

model$par_link

The parameters with the logarithmic/logistic links.

model$par_init

The initial values of the time-varying parameters.

model$coef_est

The estimated coefficients.

simulation$y_sim

The simulated time series.

simulation$par_tv_sim

The simulated time-varying parameters.

simulation$score_tv_sim

The simulated scores.

Note

Supported generic functions for S3 class gas_simulate include summary() ans plot().

References

Creal, D., Koopman, S. J., and Lucas, A. (2013). Generalized Autoregressive Score Models with Applications. Journal of Applied Econometrics, 28(5), 777–795. doi: 10.1002/jae.1279.

Harvey, A. C. (2013). Dynamic Models for Volatility and Heavy Tails: With Applications to Financial and Economic Time Series. Cambridge University Press. doi: 10.1017/cbo9781139540933.

See Also

gas()

Examples

# Simulate GAS model based on the negative binomial distribution
sim_negbin <- gas_simulate(t_sim = 50, distr = "negbin", reg = "sep",
  coef_est = c(2.60, 0.02, 0.95, 0.03))
sim_negbin

# Plot the simulated time series
plot(sim_negbin)


[Package gasmodel version 0.6.0 Index]