【问题标题】:Predictive distribution with Monte Carlo蒙特卡洛预测分布
【发布时间】:2018-04-26 11:52:56
【问题描述】:

我想获得每个预测点的分布,即对于因变量 y 的每个值。在因变量 y 中,我有 199 个观察值,对于每个观察值,我想要一个分布。所以我的输出应该是 199*100 的矩阵。我怎样才能得到它?我尝试了 T=100 的 Monte Carlo 模拟。但每次都是 199 的向量而不是矩阵 199*100。R-Code is here

【问题讨论】:

    标签: r prediction montecarlo uncertainty


    【解决方案1】:

    你可以这样做

    mc_pred <- matrix(nrow = 199, ncol = 100)
    
    for (i in 1:100) {
        mc_pred[, i] <- predict(model, x_test)
    }
    

    【讨论】:

      猜你喜欢
      • 2018-10-20
      • 2014-03-26
      • 1970-01-01
      • 2018-02-10
      • 1970-01-01
      • 2021-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多