fitted fGarch model
I need to modify my earlier response.
library(FinTS)
data(sp500)
spFit00.11a <- garchFit(sp500~garch(1,1), data=as.numeric(sp500))
at <- spFit00.11a at residuals
quantile(at)
0% 25% 50% 75% 100%
-0.306849724 -0.028099724 0.001250276 0.029775276 0.414750276
From this, it is clear that garchFit()@residuals are NOT standardized.
st <- spFit00.11a at sigma.t
qqnorm(at, datax=TRUE)
qqnorm(at/st, datax=TRUE)
From comparing these two normal probability plots, it is apparent
that 'at/st' is more normal than 'at'.
However, sd(at/st) = 0.9979, so the standardization is not perfect.
all.equal(as.numeric(sp500), spFit00.11a at fitted+at)
# TRUE
Your pseudocode suggests that 'vt' are the standardized residuals,
but that's not the case in this example. If you have a real example,
that contradicts this case, could you please report it? Otherwise, I
will assume that the test you reported was different from what you
actually did. It's always best to test an answer before giving it --
something I failed to do in my initial response to this question.
Best Wishes,
Spencer
babel at centrum.sk wrote:
Hello guys I have this question. How to fit the garch model and print all his fitted values. y=c+at at=vt*sigma vt=N(0,1) library(fGarch) fit = garchFit(~garch(1, 1), data =ret ) c<-fit at fitted vt<-fit at residuals sigma<-fit at sigma.t at<-vt*sigma model_garch<-c+at Are these computations correct? Cause if I do model_garch=c+vt I get the original series. Thank you very much for help.
_______________________________________________ R-SIG-Finance at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. -- If you want to post, subscribe first.