【问题标题】:R fGarch: presample matrix for garchSpec()R fGarch:garchSpec() 的预采样矩阵
【发布时间】:2016-08-04 14:03:26
【问题描述】:

我正在尝试通过函数 fGarch::garchSpec() 指定 GARCH 模型,并且我需要指定的预采样。如手册中所定义:

presample:一个数字三列矩阵,其起始值为 系列,对于创新,对于有条件的 差异。

但我很确定,这不是正确的顺序。在阅读了函数的手册和代码后:'garchFit', 'garchSpec', 'garchSim' 我还是很困惑。

问题是:如何准确构建presample矩阵?

【问题讨论】:

    标签: r time-series


    【解决方案1】:

    您无需为presample 设置参数。它将提供一个“好的”猜测,并且在估计参数时它并不重要。如果你想模拟数据,那么我会确保老化 n.start 足够大。

    我们来看一个例子:

    library(fGarch)
    ## First we simulate some data without setting presample:
    # we set up the model by spec:
    set.seed(911)
    spec <- garchSpec(model = list(mu = 0.02, omega = 0.05, alpha = 0.2, beta = 0.75))
    # then simulate our GARCH(1,1) model:
    garchSim <- garchSim(spec, n = 200, n.start = 1)
    plot(garchSim)
    

    和估计:

        > garchFit(~ garch(1, 1), data = garchSim)
    Error Analysis:
            Estimate  Std. Error  t value Pr(>|t|)    
    mu      -0.02196     0.05800   -0.379   0.7049    
    omega    0.03567     0.02681    1.331   0.1833    
    alpha1   0.12074     0.04952    2.438   0.0148 *  
    beta1    0.84527     0.05597   15.103   <2e-16 ***
    ---
    Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    
    Log Likelihood:
     -265.8417    normalized:  -1.329209 
    

    现在让我们尝试添加一个非常极端的预采样。在上述模型(和这个种子)中,presample 是:

    > spec@presample
    Presample: 
      time          z h    y
    1    0 -0.4324072 1 0.02
    

    现在我们将其替换为c(100, 0.1, 0.1)。由于我的模型是没有任何 ARMA 部分的 GARCH(1,1),我只需要设置文档 ?garchSpec 中描述的 3 个参数。更新spec后我们估计是同一个模型:

    set.seed(911)
    spec@presample <- matrix(c(0.1, 0.1, 0.1), ncol = 3)
    garchFit(~ garch(1, 1), data = garchSim)
    

    输出相同:

    Error Analysis:
            Estimate  Std. Error  t value Pr(>|t|)    
    mu      -0.02196     0.05800   -0.379   0.7049    
    omega    0.03567     0.02681    1.331   0.1833    
    alpha1   0.12074     0.04952    2.438   0.0148 *  
    beta1    0.84527     0.05597   15.103   <2e-16 ***
    ---
    Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
    
    Log Likelihood:
     -265.8417    normalized:  -1.329209 
    

    可能性和估计值是相同的,但请注意当我们使用新的spec 进行模拟时:

    set.seed(911)
    garchSim <- garchSim(spec, n = 200, n.start = 1)
    plot(garchSim)
    

    ,提供的极端初始样本搞砸了我们很好的模拟。但是通过增加burn.in 我们得到:

    set.seed(911)
    garchSim <- garchSim(spec, n = 200, n.start = 100)
    plot(garchSim)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-06
      • 1970-01-01
      • 2020-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多