data(dji30ret)
spec = gogarchspec(mean.model = list(demean = "constant"),
variance.model = list(model = "sGARCH", garchOrder = c(1,1), submodel = NULL),
distribution.model = list(distribution = "manig"), ica = "fastica")
fit = gogarchfit(spec = spec, data = dji30ret[,1:4, drop = FALSE],
out.sample = 50, gfun = "tanh")
# The likelihood of the model
likelihood(fit)
# the GARCH coefficients of the independent factors
coef(fit)
# a news-impact surface plot
#ni = nisurface(fit, type = "cov", pair = c(1, 2), factor = c(1,2), plot = TRUE)
# the time varying correlation array
mc = rcor(fit)
# plot(mc[1,2,], type = "l")
# The moments of an equally weighted portfolio (subtract the out.sample from dimension)
gm = gportmoments(fit, weights = matrix(1/4, ncol = 4,
nrow = dim(dji30ret)[1]-50), debug = TRUE)
Run the code above in your browser using DataLab