0

I was deriving an expression for truncated gamma distribution. I derived an expression for the same which include incomplete gamma function. When I was implementing the same in matlab using the 'gammainc(x,alpha)' function, I was getting complex values because my x values are negative. Is there is any other way to compute incomplete gamma function for negative values?

  • 1
    Why do you want some other way to compute the function for negative `x`? Are the values produced by `gammainc` not correct? – Luis Mendo May 06 '19 at 08:51
  • If you need to work with a truncated Gamma distribution, have you considered the [probability distribution objects](https://www.mathworks.com/help/stats/working-with-probability-distributions.html) available such as `pd = truncate(makedist('Gamma',alpha,beta),a,b)`? Then pdf, cdf, inverse cdf (for quantiles) and other things are immediately available. – SecretAgentMan May 06 '19 at 13:12
  • @LuisMendo the values produced by gammainc is correct only, but when I am finding gammaincinv, then the values must be in [0 1]. – Anil Ramachnadran May 08 '19 at 00:40
  • @SecretAgentMan Thank you! I also derived a closed form expression for the same now. I will check both. Thank you once again! – Anil Ramachnadran May 08 '19 at 01:28
  • @AnilRamachnadran, excellent. I'd encourage you to post your own answer to help future visitors to this post. – SecretAgentMan May 08 '19 at 01:36

0 Answers0