I want to use ccgarch package in R. First of all, What are initial values in this package?
I'm pretty sure there are no default parameters. If you try to run your code without specifying param
you should get something along the lines (note: I did this with the command loglik.dcc
):
Error in loglik.dcc(dvar = my.df, model = "diagonal") :
argument "param" is missing, with no default
How can I specify these values?
I reccomend you check out the examples in the documentation to the ccgarch package. While there is no example given for loglik.eccc
, there is however a nice example for loglik.dcc
.
The documentation can be accessed here. The example on page 24/25 is the following:
## Not run:
# Simulating data from the original DCC-GARCH(1,1) process
nobs <- 1000; cut <- 1000
a <- c(0.003, 0.005, 0.001)
A <- diag(c(0.2,0.3,0.15))
B <- diag(c(0.75, 0.6, 0.8))
uncR <- matrix(c(1.0, 0.4, 0.3, 0.4, 1.0, 0.12, 0.3, 0.12, 1.0),3,3)
dcc.para <- c(0.01,0.98)
dcc.data <- dcc.sim(nobs, a, A, B, uncR, dcc.para, model="diagonal")
# Estimating a DCC-GARCH(1,1) model
dcc.results <- dcc.estimation(inia=a, iniA=A, iniB=B, ini.dcc=dcc.para,
dvar=dcc.data$eps, model="diagonal")
# Parameter estimates and their robust standard errors
dcc.results$out
# Computing the value of the log-likelihood at the estimates
loglik.dcc(dcc.results$out[1,], dcc.data$eps, model="diagonal")
## End(Not run)
dcc.results$out
will show you the estimated parameters:
> dcc.results$out
a1 a2 a3 A11 A22 A33 B11 B22 B33 dcc alpha
estimates 0.002390773 0.00477909 0.001010304 0.199707914 0.2738877 0.13370911 0.7644433750 0.61175081 0.82020157 0.018729549
std.err 0.000703168 0.03576364 0.032840012 0.001213087 0.0439388 0.05675561 0.0003626412 0.02548092 0.03398187 0.008090084
dcc beta
estimates 0.93071563
std.err 0.03659041
Which you can use in the calculation of the loglik.dcc
:
loglik.dcc(dcc.results$out[1,], dcc.data$eps, model="diagonal")
[1] 6316.604
Concluding from this you can:
1. Set a parameter vector yourself
Your example param=c(1,2,3,4,5,6,7,8,9,10,11,12,13,14)
violates some very important model restraints. I strongly recommend you read more about the restrictions of the model you're looking into (I find this is very nicely narrated in this journal article on p. 160 from the grandfather of all GARCH models, Robert Engle.)
In short: you can see in the above estimated parameters that they all are in the Range 0 < a, A and B < 1
. If you go for something, orient yourself on those parameters.
2. Estimate them based on your data and use them as illustrated in the example above.
Note that example is for 3 series. If you use more/less dimensions you will need to adjust the initial parameters. The ccgarch2
package e. g. will let you do estimations without setting initial values. It will generate them randomly.
Besides, How can I use loglik.eccc and define param for it?
This should be covered by the examples / narration above.