Best illustrated with an example: library(rugarch) data(sp500ret) spec=arfimaspec(mean.model=list(armaOrder=c(2,2))) fit = arfimafit(spec, sp500ret) head(fitted(fit))
1987-03-10 1.913217e-04 1987-03-11 1.913217e-04 1987-03-12 -4.294109e-04 t(t(coef(fit))) mu 0.0001913217 ar1 -0.0643659160 ar2 0.2625192564 ma1 0.0241934750 ma2 -0.3439672864 sigma 0.0118930801 Therefore, until we have enough data (T>Lag), we use the estimated mean (mu) to initialize the recursion. There are certainly other ways to do this such as building up incrementally from Lag1 to LagN, but not currently implemented. I don't know how matlab estimates ARMA models, but the documentation provides the formulation used (https://cran.r-project.org/web/packages/rugarch/vignettes/Introduction_to_the_rugarch_package.pdf) in Section 2.1 Regards, Alexios On Thu, 19 Jul 2018 18:32:20 +0200, Mickey Petersen <[email protected]> wrote: > Hi all, > > I'm using the rugarch package in R to fit (among others) an AR1 process, in > turn leading to some risk numbers. Doing the same fit in Matlab, I get > slightly different numbers. > > The reason is that the estimated AR1-parameters differ and I've narrowed it > down to differences in the starting conditions for each process. > In other words, in the Matlab script, I specify that the first observation > should be interpreted as a presample response (Y0) and that the AR1 process > should then be fitted to the rest of the time series (1018 observations). > Apparently, leaving out this specification would lead to Matlab > 'back-forecasting' Y0 and I presume rugarch does something similar. But the > risk numbers still disagree slightly. > > My question is thus two-fold: > - How can I specify the single presample response (Y0) to use in fitting an > AR1 process using arfimafit from rugarch? > - Supplying the whole time series (all 1019 observations), what procedure > does arfimafit then apply as default to estimate the presample response? > Mean? First observation? > > Kind regards, > Mickey Petersen _______________________________________________ [email protected] 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.
