[R-SIG-Finance] ugarchfit and arima seem contradictory?
alexios
alexios at 4dscape.com
Sat Feb 11 15:29:36 CET 2012
1. Read the documentation of Box.test, and in particular on the option
"fitdf" which needs to be adjusted when passing the
residuals of an ARMA filtration.
2. rugarch uses: type = "Ljung-Box"
3. Observe email etiquette by using your name when posting (this is your
third email without one).
Alexios
On 11/02/12 14:18, ecsniffer林娟 wrote:
>
> I use ARMAX(4,1) model to estimate the volatility and include interest rate r_t as the exogenous variable. I use the arima function and ugarchfit function from RUGARCH package, respectively. The results seem to contradict with each other.
>
> If I use arima function,
> my code is as follows,
> data<-read.csv("...")
> volatility<-ts(data$volatility);
> rate<-ts(data$diff_rate);
> result=arima(volatility,order=c(4,0,1),xreg=rate)
> Box.test(result$residuals, lag =10, type = c("Box-Pierce", "Ljung-Box"))
>
> The output is as follows,
> Box-Pierce test
> data: result$residuals
> X-squared = 13.1749, df = 10, p-value = 0.2141
> which means no correlation among the residuals.
>
> However, if I use RUPACKAGE,
> my code is as follows,
> spec=ugarchspec(variance.model=list(model="sGARCH",garchOrder=c(1,1),submodel=NULL,
> + external.regressors=as.matrix(rate), variance.targeting = FALSE),
> + mean.model = list(armaOrder = c(4,1), include.mean = TRUE, garchInMean = FALSE,
> + inMeanType = 1, arfima = FALSE, external.regressors =as.matrix(rate)), distribution.model = "std",
> + start.pars = list(), fixed.pars = list())
> fit=ugarchfit(spec,data=as.matrix(volatility))
> fit
>
> The output is as follows,
> Q-Statistics on Standardized Residuals
> ------------------------------------
> statistic p-value
> Lag10 15.76 0.0075508
> Lag15 21.98 0.0152135
> Lag20 42.29 0.0002031
> H0 : No serial correlation
> which means there exisits correlation among the residuals.
>
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at r-project.org 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.
More information about the R-SIG-Finance
mailing list