2017-03-08 174 views
-1

我想通过使用mgarchBEKK pachage来估计BEKK Garch模型,这是可用的here如何在R中使用mgarchbekk包?

library(quantmod) 
library(rugarch) 
library(mgarchBEKK) 

eps<- read.csv("C.csv", header=TRUE) 

    > head(eps) 

     v1  v2 
1 -0.001936598 0.001968415 
2 -0.000441797 -0.002724438 
3 0.003752762 -0.010221719 
4 -0.004511632 -0.014637860 
5 -0.001426905 0.010597786 
6 0.007435739 -0.005880712 
> tail(eps) 
      v1   v2 
1954 -0.043228944 0.0000530712 
1955 0.082546871 -0.0028188110 
1956 0.025058992 0.0058264010 
1957 0.001751445 -0.0298050150 
1958 -0.007973320 -0.0037243560 
1959 -0.005207348 0.0012664230 

## Simulate a BEKK process: 
simulated <- simulateBEKK(2,1959, c(1,1), params = NULL) 


## Prepare the input for the estimation process: 
simulated1 <- do.call(cbind, simulated$eps) 

## Estimate with default arguments: 
estimated <- BEKK(simulated1) 

    H IS SINGULAR!... 
H IS SINGULAR!... 
Warning message: 
In BEKK(simulated1) : negative inverted hessian matrix element 


## Show diagnostics: 
diagnoseBEKK(estimated) 

## Likewise, you can estimate an mGJR process: 
estimated2 <- mGJR(simulated[,1], simulated[,2]) 

我不知道,什么是我的代码的问题,因为它的结果是显示的,而不是2系列3968多个系列。

回答

1

你是估计模型。

这是什么意思?

引述我的统计教授,哲学是“找到这可能创造了观测序列的随机模型。”

这正是mgarchBEKK正在做的事情。该模型符合您提供的数据(您的V1和V2系列)。简而言之,这意味着有很多不同的参数组合会被试用,而那些(在你的情况下是3968次尝试),那么“最合适”的组合就是你在结果中看到的组合。

我做了3时间序列的长度相同8596.我的结果是这个样子:

Number of estimated series : 25788 
Length of estimated series : 8596 
Estimation Time   : 3.258482 

所以估计系列的数量是远远高于我用了3个向量。

的估计是这个样子(因为这是一个双向或者多变量模型估计你有参数矩阵,因为你将有一个一个维GARCH模型不是单一的值):

C estimates: 
     [,1]  [,2]  [,3] 
     [1,] 0.9797469 0.2189191 0.202451941 
     [2,] 0.0000000 1.0649323 0.003050169 
     [3,] 0.0000000 0.0000000 0.896492130 

ARCH estimates: 
     [,1]   [,2]  [,3] 
     [1,] 0.29110077 -0.008445699 0.008570904 
     [2,] -0.02109381 0.419092657 0.325321939 
     [3,] -0.01280835 -0.057648910 0.482502301 

GARCH estimates: 
     [,1]  [,2]  [,3] 
     [1,] -0.27770297 0.03587415 -0.73029389 
     [2,] -0.05172256 -0.25601327 0.01918367 
     [3,] 0.07945086 0.03364686 -0.50664759 

我无法描述这个拟合背后的数学,据我所知,使用了maximum likelihood estimation的某种形式。

我是统计学的新手,所以如果我说的是错的,请随时纠正我。