ruragrch package using external regressors

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ruragrch package using external regressors

emna

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


_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.