首页 > 解决方案 > 左截断 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))

谢谢!

标签: rtruncatedata-fittinggammafitdistrplus

解决方案


推荐阅读