[R-SIG-Finance] ruragrch package using external regressors

khemakhem emna emna_khemakhem at hotmail.com
Wed Oct 4 11:05:17 CEST 2017


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]]



More information about the R-SIG-Finance mailing list