我觉得是多元GARCH 我这个是用R编写的GARCH(1、1) 看有用没
library(zoo)
library(quadprog)
library(tseries)
library(evir)
library(MASS)
library(stats)
library(Rcpp)
library(RcppArmadillo)
library(lattice)
library(numDeriv)
library(chron)
library(Rsolnp)
library(truncnorm)
library(sandwich)
library(Matrix)
library(rgarch)
#---------------------- Univariate GARCH ----------------------
InSample=read.table("YenISLogReturn.txt",header=T)
YenInSample=InSample[,3]
plot(YenInSample,type="l",main="Evolution Yen In-Sample")
#--------- Tester l'effet GARCH / Draw ------------
X11()
par(mfrow=c(2,1))
acf(YenInSample,lag=75,lwd=2)
acf(YenInSample^2,lag=75,lwd=2)
#---------- Modéliser un GARCH ----------------------
Yenspec = ugarchspec(mean.model = list(armaOrder = c(0,0)))
Yenfit = ugarchfit(data = YenInSample, spec = Yenspec)
Yenfit
YenPred = ugarchforecast(Yenfit, n.ahead = 1)
YenPred
# sigma series
23400 0.07011 -3.863e-05
#----------- Prediction par GARCH --------------------
YenISVolatility=predict(YenGarchIS)
YenISVolatility=predict(Yenfit)
PredictYenIS=ts(data = YenISVolatility, start = 1991, frequency = 6048)
#----define the Garch result in the form of a time series
YenIS=ts(data = YenInSample, start = 1991, frequency = 6048)
par(mfrow=c(1,1))
plot(YenIS,col="grey",main="Evolustion of YenISVolatility")
lines(PredictYenIS[,1],col="red")
lines(PredictYenIS[,2],col="red")


雷达卡




京公网安备 11010802022788号







