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.
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
)A list of S3 class gas_simulate with components:
The exogenous variables used in simulation.
The conditional distribution.
The parametrization of the conditional distribution.
The scaling function.
The specification of the regression and dynamic equation.
The length of the simulated time series.
The dimension of the model.
The number of exogenous variables.
The score order.
The autoregressive order.
The static parameters.
The parameters with the logarithmic/logistic links.
The initial values of the time-varying parameters.
The estimated coefficients.
The simulated time series.
The simulated time-varying parameters.
The simulated scores.
An optional GAS estimate, i.e. a list of S3 class gas returned by function gas().
A number of observations to simulate.
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.
When gas_object is not supplied, the estimated model can be specified using these individual arguments. See the arguments and value of the gas() function for more details.
Creal, D., Koopman, S. J., and 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, A. C. (2013). Dynamic Models for Volatility and Heavy Tails: With Applications to Financial and Economic Time Series. Cambridge University Press. tools:::Rd_expr_doi("10.1017/cbo9781139540933").
gas()
# 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)
Run the code above in your browser using DataLab