2

I am trying to fit a left-truncated gamma distribution in R. I have large claims above $25,000. Claims below $25,000 are unknown. I am trying to fit the gamma parameters through the MLE procedure in R. Could anyone suggest code for this? My current code is as follows:

Could someone please explain how to write code for this? I've made attempts with the fitdist function, but I am unsure what the truncated gamma function is named and what start it requires.

Failed Code:

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))

Thanks!

ryangold96
  • 41
  • 1

0 Answers0