<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"> Hi there,<br><br>I have two questions (which might be related).<br>I am trying to predict mean and variance of monthly stock excess return using dividend price ratio with a eGarch model.<br><br>Data format is the following<br>column 1 column 2 column 3<br>gross S&P return gross t-bill return lagged dividend price ratio<br>#data dimension is nrow=750 and ncolumns =3 and the "redp.dat" file is attached.<br><br>code is following<br>library(rugarch);<br>dat=read.csv('C:\\redp.dat',header=F);<br><br>logexr=log(dat$V1)-log(dat$V2); # log of gross excess return<br>as.matrix(logexr);<br>dp=log(dat$V3); #log of dividend price ratio<br>as.matrix(dp);<br><br>spec = ugarchspec(variance.model = list(model = "eGARCH", garchOrder = c(1,1), external.regressors = as.matrix(dp)),<br>mean.model = list(armaOrder=c(0,0), include.mean = T, external.regressors = as.matrix(dp)), distribution.model = "norm");<br># dividend price ratio are used as external regressor in both mean and variance equation<br><br>test=ugarchroll(spec, n.ahead=1, data=logexr, forecast.length=400, refit.every=1, refit.window="moving");<br>as.data.frame(test, which='LLH')<br># where I did a rolling window forecast and display all the likelyhood<br><br>#then I did a double check on the rolling estimation by doing <br>for (j in 1:10) # I am justing printing the first ten loop step<br>myfit = ugarchfit(spec, logexr[j:349+j]);<br>likelihood(myfit)<br>end<br><br># Question 1: the first likelihood from ugarchfit exactly equals that in ugarchroll, while the values are different from then on.<br># When I modify the spec to exclude any external regressor, the two sets of likelihood are then exactly the same.<br>#
reducing the forecast length (and therefore increase the length of the
estimation window) seems to mitigate the estimation difference.<br><br># Question 2: I then compare the density forecast<br>as.data.frame(test, which='density')<br># this seem to produce<br>for (j in 1:10) # I am justing printing the first ten loop step<br>
ugarchforecast(myfit, n.ahead=1); # and again when the likelihood are different, the forecast is different.<br>
end<br># however, I am a bit confused since I thought it should produce<br>for (j in 1:10) <br>
ugarchforecast(myfit, n.ahead=1,external.forecasts = list(mregfor = dp[350+j], vregfor = dp[350+j] )); <br>
end<br><br>looking forward to your help.<br><br><br>Guoshi<br><br></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>