[R-SIG-Finance] External Regressors in GARCH Equation when using Twinkle
Neil Patrick Lawton
ne||@|@wton2 @end|ng |rom m@||@dcu@|e
Thu Sep 12 01:54:53 CEST 2019
I am having trouble with the inclusion of external regressors in the GARCH
equation, when using the twinkle package kindly provided by Alexios
I believe I am including the data correctly to starspec. An xts object,
which is pre-lagged and has the same index as the data included within
Below, I have included an example of my code, with some generated data.
xts1 <- xts(x=rnorm(100), order.by=Sys.Date()-1:100)
xts2 <- xts(x=rnorm(100), order.by=index(xts1))
spec = starspec(mean.model = list(states = 2,
include.intercept = c(1,1),
arOrder = c(1,1),
maOrder = c(2, 2),
statevar = 'y',
ylags = 3,
statear = TRUE),
model="sGARCH",submodel = NULL,
variance.targeting = FALSE),
distribution.model = "norm")
ctrl=list(maxit=1000, alpha=0.2, beta=0.1, gamma=0.7, reltol=1e-12,
mod = starfit(spec, data = xts2,
solver.control = ctrl,
solver = "msoptim")
I get the following error when trying to run, which only occurs when the
'vreg' argument is included in the variance model:
Error in matrix(vexdata, ncol = modelinc) :
object 'vexdata' not found
I get errors with other solvers also, whether I am including the
solver.control list or not.
In the rugarch package, the external regressors should be included as a
matrix, not an xts object. However, when I include data as a matrix here, I
get: starspec-->error: vreg must be an xts object.
Is there a solution or work around to this problem?
Tá an ríomhphost seo agus
aon chomhad a sheoltar leis faoi rún agus is lena úsáid ag an seolaí agus
sin amháin é. Is féidir tuilleadh a léamh anseo.
This e-mail and any
files transmitted with it are confidential and are intended solely for use
by the addressee. Read more here.
[[alternative HTML version deleted]]
More information about the R-SIG-Finance