首页 > 解决方案 > 使用 STAN 在 R 中的包 bmgarch 中出现错误消息:异常:验证转换后的参数:H[i_0__] 不是对称的

问题描述

我正在运行贝叶斯 DCC-mgarch 模型。现在它只有 2 个变量。这是模型在 R 中的函数调用。

library(bmgarch)
cols = c('Free.Cash.Flow', 'Revenue')
model <- bmgarch(dataset[,cols],
                parameterization = "DCC",
                iterations = 1000,
                P = 1, Q = 1,
                chains = 1,
                init_r = 1,
                enable_random_init = FALSE,
                distribution = "Student_t",
                meanstructure = "arma")

数据的样本行……如果这很重要的话,这些数字是相当大的。

  Free.Cash.Flow    Revenue
1      331510000  972360000
2      331510000  700356000
3      331510000  667625000
4      331510000  639281000
5      331510000 1115171000
6      331510000  847422000

我不断收到这些运行基本模型的错误消息。

Chain 1: Rejecting initial value:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: validate transformed params: H[i_0__] is not symmetric. H[i_0__][1,2] = 1.15446e+17, but H[i_0__][2,1] = 1.15446e+17 (in ‘model_DCCMGARCH’ at line 62)

Chain 1: Rejecting initial value:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: validate transformed params: H[i_0__] is not symmetric. H[i_0__][1,2] = -3.59349e+15, but H[i_0__][2,1] = -3.59349e+15 (in ‘model_DCCMGARCH’ at line 62)

Chain 1:
Chain 1: Initialization between (-0.05, 0.05) failed after 100 attempts.
Chain 1: Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
[1] “Error in sampler$call_sampler(args_list[[i]]) : Initialization failed.”
[1] “error occurred during calling the sampler; sampling not done”
Stan model ‘DCCMGARCH’ does not contain samples.

我试过摆弄像设置 init_r = 0 这样的函数调用,但无济于事。

有人可以帮我吗?

标签: rstanrstan

解决方案


推荐阅读