BEKK Multivariate Garch Error in R

Asked

Viewed 47 times

0

I’m trying to run the package mgarchBEKK the following data:

    > head(Log_retorno)

         DLog_B3a    DLog_JCa   DLog_Basea  DLog_CBOTa
[1,]  0.090393077  0.08588355  0.129032018  0.09774478
[2,]  0.017924523  0.02176237  0.014430686  0.02192171
[3,] -0.021960031 -0.04316860 -0.034300853 -0.04978512
[4,]  0.037062020  0.05003171  0.015529532  0.04156171
[5,]  0.052798186  0.02240354  0.041780025  0.04465233
[6,] -0.002929457  0.02495560  0.007350643  0.01031265

   > simulated <- simulateBEKK(Log_retorno)

Which gives me the following mistake:

   Error in rep(0.01, params.length - length(params)) : 
invalid 'times' argument
In addition: Warning messages:
1: In if (dimension <= 0) { :
the condition has length > 1 and only the first element will be used
2: In if (dimension <= 0) { :
the condition has length > 1 and only the first element will be used
3: In if (series.count == 2) { :
the condition has length > 1 and only the first element will be used

I couldn’t find any examples in real data to better understand.

EDIT: Data can be generated with the following code:

Log_retorno=data.frame(matrix(rnorm(1000*4),ncol=4))
names(Log_retorno)=c("DLog_B3a"  ,  "DLog_JCa",   "DLog_Basea" , "DLog_CBOTa")

1 answer

1


The function simulateBEKK is to simulate series

simulateBEKK(series.count, T, order = c(1, 1), params = NULL)

To estimate uses the function BEKK

BEKK(eps, order = c(1, 1), params = NULL, fixed = NULL, method = "BFGS",
  verbose = F)

For example:

estimated <- BEKK(Log_retorno)

Estimate the template for the 4 series simultaneously. Some estimated statistics

estimated$est.params # parâmetros C, A , G
estimated$asy.se.coef # erro padrão dos parâmetros
estimated$uncond.cov.matrix  # sigma
plot(estimated$sd[[1]],type="l",col=4) #desvio padrão serie 1 

To understand the model query for example http://support.sas.com/documentation/cdl/en/etsug/HTML/default/viewer.htm#etsug_varmax_gettingstarted09.htm

Browser other questions tagged

You are not signed in. Login or sign up in order to post.