[R-SIG-Finance] Fitting a DCC-GARCH with more than one external regressor per single process using rmgarch
leopoldo.catania
leopoldocatania at gmail.com
Tue Sep 3 19:52:44 CEST 2013
Hi Alexios,
thanks for answering, yes the problem is the one you wrote.
I just tried to estimate the dcc using (in the sample) the two univariate
estimates, I included in the "fit" command (dccfit(...fit=,...)) a list
which contains the univariate estimated, and the error is the same.
Now, as you suggested, I tried to use a multifit object, so my code is:
> spec
$`Electronic Technology`
*---------------------------------*
* GARCH Model Spec *
*---------------------------------*
Conditional Variance Dynamics
------------------------------------
GARCH Model : eGARCH(1,1)
Variance Targeting : FALSE
Exogenous Regressor Dimension: 2
Conditional Mean Dynamics
------------------------------------
Mean Model : ARFIMA(1,0,0)
Include Mean : FALSE
GARCH-in-Mean : FALSE
Conditional Distribution
------------------------------------
Distribution : std
Includes Skew : FALSE
Includes Shape : TRUE
Includes Lambda : FALSE
$`Non-Energy Minerals`
*---------------------------------*
* GARCH Model Spec *
*---------------------------------*
Conditional Variance Dynamics
------------------------------------
GARCH Model : eGARCH(1,1)
Variance Targeting : FALSE
Exogenous Regressor Dimension: 2
Conditional Mean Dynamics
------------------------------------
Mean Model : ARFIMA(1,0,0)
Include Mean : FALSE
GARCH-in-Mean : FALSE
Conditional Distribution
------------------------------------
Distribution : std
Includes Skew : FALSE
Includes Shape : TRUE
Includes Lambda : FALSE
> mspec = multispec( spec )
> mspec
*-----------------------------*
* GARCH Multi-Spec *
*-----------------------------*
Multiple Specifications : 2
Multi-Spec Type : equal
> r=as.xts(sector.tf.list[[tf]][a,1:2])
> multi.fit=multifit(mspec,r)
> multi.fit
*----------------------------*
* GARCH Multi-Fit *
*----------------------------*
No. Assets :2
GARCH Multi-Spec Type : Equal
GARCH Model Spec
--------------------------
Model : eGARCH
Exogenous Regressors in variance equation: 2
Mean Equation :
Include Mean : 0
AR(FI)MA Model : (1,d,0)
GARCH-in-Mean : FALSE
Exogenous Regressors in mean equation: none
Conditional Distribution: std
GARCH Model Fit
--------------------------
Optimal Parameters:
Electronic Technology Non-Energy Minerals
ar1 0.05294 0.05204
omega -0.48544 -0.51636
alpha1 -0.01188 -0.00150
beta1 0.96834 0.96459
gamma1 0.16409 0.16298
vxreg1 -0.00957 0.04071
vxreg2 0.00126 0.01153
shape 3.66710 3.98666
Log-Lik 81768.21938 76305.84698
> multispec=dccspec(mspec,model="DCC")
> dccfit(multispec,fit=multi.fit,r)
Error in `rownames<-`(`*tmp*`, value = c("mu", "ar1", "ma", "arfima", :
length of 'dimnames' [1] not equal to array extent
The error is the same.
You could try to run the code below, which reports the same error:
set.seed(422)
r=cbind(rnorm(1000),rnorm(1000))
colnames(r)=c("1","2")
ext=list()
ext[["1"]]=cbind(rnorm(1000),rnorm(1000))
ext[["2"]]=cbind(rnorm(1000),rnorm(1000))
spec=list()
for(i in 1:length(ext)){
name=names(ext)[i]
spec[[name]]=ugarchspec(variance.model=list(model="eGARCH",garchOrder=c(1,1),external.regressors=ext[[name]]),
mean.model = list(armaOrder =
c(1, 0),include.mean = F,external.regressors=NULL),
distribution.model="norm")
}
mspec = multispec( spec )
multi.fit=multifit(mspec,r)
multispec=dccspec(mspec,model="DCC")
dccfit(multispec,fit=multi.fit,r)
Best regards,
Leopoldo Catania.
--
View this message in context: http://r.789695.n4.nabble.com/Fitting-a-DCC-GARCH-with-more-than-one-external-regressor-per-single-process-using-rmgarch-tp4675275p4675284.html
Sent from the Rmetrics mailing list archive at Nabble.com.
More information about the R-SIG-Finance
mailing list