View source: R/garchx-source-code.R
| garchxSim | R Documentation | 
Simulate from a GARCH(q,p,r)-X model. Optionally, if verbose=TRUE, the conditional variance and innovations are also returned.
garchxSim(n, intercept = 0.2, arch = 0.1, garch = 0.8, asym = NULL, xreg = NULL,
  innovations = NULL, backcast.values = list(), verbose = FALSE, as.zoo = TRUE,
  c.code = TRUE)
| n | integer | 
| intercept | numeric | 
| arch | 
 | 
| garch | 
 | 
| asym | 
 | 
| xreg | 
 | 
| innovations | 
 | 
| backcast.values | 
 | 
| verbose | 
 | 
| as.zoo | 
 | 
| c.code | 
 | 
a numeric vector or matrix with the simulated values.
Genaro Sucarrat, https://www.sucarrat.net/
garchx, zoo
##simulate from a garch(1,1):
y <- garchxSim(1000)
##simulate from a garch(1,1) with asymmetry/leverage:
yy <- garchxSim(1000, asym=0.1)
##simulate from a garch(1,1) w/user-provided backcast values:
yyy <- garchxSim(1000, backcast.values=list(z2=1, sigma2=0.5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.