[R-SIG-Finance] ruragrch package using external regressors
khemakhem emna
emna_khemakhem at hotmail.com
Wed Oct 4 11:37:02 CEST 2017
I get this message but I am a member (
R-SIG-Finance mailing list membership configuration for emna_khemakhem at hotmail.com, emna
emna_khemakhem at hotmail.com, emna's subscription status, password, and options for the R-SIG-Finance mailing list.
)
so i don't know why i cannot post my question?
best regards,
Emna Khemakhem
________________________________
De : R-SIG-Finance <r-sig-finance-bounces at r-project.org> de la part de khemakhem emna <emna_khemakhem at hotmail.com>
Envoyé : mercredi 4 octobre 2017 11:05:17
À : r-sig-finance at r-project.org
Objet : [R-SIG-Finance] ruragrch package using external regressors
I�m using the rugarch package to estimate an ARMA(1,0)-GJR-GARCH(1,1) model with dummy variable but i don't know how to do to add the dummy as an external regressor in the variance equation.
I want to estimate the following model:
y(t)=mu+c1y(t-1)+epsilon(t)
sigma(t)�=omega+aplpha1*epsilon(t-1)�+gamma1*epsilon(t-1)�*I(t-1)+gamma2*epsilon(t-1)�*I(t-1)*dummy+theta*dummy+beta1*sigma(t-1)�
I will be very grateful if you tells me how to add this part of equation epsilon(t-1)�*I(t-1)*dummy in the variance specification of the GJR-GARCH in rugarch package in R (my problem is how to compute residuals epsilon(t-1)).
i think that in the case of y(t)=epsilon(t) i can use this program:
library(xlsx)
kospi_call<-read.xlsx("/Users/emnakhemakhem/Desktop/Untitleddddd.xlsx �,2) #variables: time, rendement, dummy
result=xts(kospi_call[,-1],order.by=kospi_call[,1], as.Date(rownames(kospi_call)))
t=length(result[,-1])
s = rep(0,t)
test<-result[,1]
for(i in 1:t){
if(test[i]<0){s[i]=1}
}
# eps.neg represents the leverage effect regressor
eps.neg <- xts(test*s)
colnames(eps.neg)<-"eps.neg"
# lag eps.neg
eps.neg.lag = lag(eps.neg,1)
eps.neg.lag.carree=eps.neg.lag^2
#interaction variable=dummy*epsilon(t-1)*I(t-1)
dummy<-result[,2]
interaction<-dummy*eps.neg.lag.carree
inputs2<-na.omit(cbind(test, interaction, join="left"))
aug.s.spec <- ugarchspec(variance.model = list(model='sGARCH', garchOrder=c(1,1),
external.regressors = inputs2[,2], variance.targeting = T),
mean.model = list(armaOrder=c(0,0)),fixed.pars=list(mu = 0))
setbounds(aug.s.spec)<-list("vxreg1"=c(-1, 1))
aug.s.fit <- ugarchfit(spec=aug.s.spec, data=inputs2[,1])
So my question is, if my program is correct, how to get eps.neg.lag in the case of AR(1)-GJR-GARCH(1,1)?
I will be very grateful if you help me to get the solution
Best regards,
Emna
[[alternative HTML version deleted]]
[[alternative HTML version deleted]]
More information about the R-SIG-Finance
mailing list