r - 使用 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 这样的函数调用,但无济于事。
有人可以帮我吗?
解决方案
推荐阅读
- r - 如何在 R 中使用“group_by”和“mutate”而不创建一长串属性?
- c - 基于函数原型的调用参数编译时决策
- firebase - 没有密码创建的 Firebase 用户仍然可以登录吗?
- android - AndroidResultContracts.TakePicture() 返回布尔值而不是位图
- perl - 在 MacOS catalina 中安装 Tk 模块 perl 时出现问题
- reactjs - react-multiselect-checkboxes - 如何隐藏搜索框
- qt - Qt Quick QML 窗口中的多种模式?
- r - 如何提取用户在闪亮的应用程序中选择的滑块的值,以便在函数中使用它?
- powershell - PSCustomObject out-gridview 格式不正确
- ios - 在允许 FCM 推送通知时修复错误 403