r - 左截断 Gamma 拟合
问题描述
我正在尝试在 R 中拟合左截断伽马分布。我有超过 25,000 美元的大额索赔。低于 25,000 美元的索赔是未知的。我正在尝试通过 R 中的 MLE 程序来拟合伽马参数。有人可以为此建议代码吗?我目前的代码如下:
有人可以解释一下如何为此编写代码吗?我已经尝试使用 fitdist 函数,但我不确定截断的 gamma 函数的名称以及它需要什么开始。
失败的代码:
dtruncated_gamma <- function(x, alpha, theta)
dtrunc(x, "gamma", shape=shape , scale=scale, a = 25000, b = Inf)
ptruncated_gamma <- function(x, alpha, theta)
ptrunc(x, "gamma", shape=shape , scale=scale, a = 25000, b = Inf)
fitdist(LargeClaims, "truncated_gamma", method = "mle", start = c(shape = 2, scale = 1000))
谢谢!
解决方案
推荐阅读
- java - java.lang.NoClassDefFoundError:无法链接 org/pentaho/di/core/attributes/metastore/EmbeddedMetaStore
- python - Keras 的 expand_dims 函数导致张量丢失元数据
- javascript - 在 2 个独立项目 React Js 和 React Native 之间共享代码的最佳解决方案?(比如 redux 商店)
- css - 如何淡入页面特定位置的移动元素?
- excel - 用于空白单元格验证的 Excel 全局公式?
- excel - Excel:根据另一列中的重复值复制列中的数据
- angular - 期望在 Angular / Karma / Jasmine 的测试中可观察到失败
- c++ - 使用 cpp-httplib 传输文件时出现问题
- python - Pandas Python:如果值在 Col[A] 和 Col[B] 中,则为 Col[C]
- javascript - 使用 SVG 对象的 onloadwff 中的 TypeError