0

With many thanks for help in why my exercise is using a Gamma distribution, I am still confused by another part.

The plot:

The plot

The commentary:

We may suspect from the above that there is some sort of exponential-like distribution at play here. ...The insurance claim charges may possibly be multimodal. The gamma distribution may be applicable and we could test this for the distribution of charges that weren't insurance claims first.

Then they calculate alpha and beta using what is apparently the standard method:

alpha = Mean(X)^2/Variance(X)
beta  = Variance(X)/Mean(X)

and then they say:

we don't know if we have a best estimate for the population parameters, and we also only have a single estimate each for alpha and beta; we aren't capturing our uncertainty in their values. Can we take a Bayesian inference approach to estimate the parameters?

I kind of understand that. We want to simulate more values to work from. But why Exponential?

The code:

basic_model = pm.Model()

with basic_model: 

    # Priors for unknown model parameters

    # alpha
    alpha_ = pm.Exponential('alpha', alpha_est)

    # beta
    rate_ = pm.Exponential('rate', beta_est)

    g = pm.Gamma('g', alpha=alpha_, beta=rate_, 
                  observed=no_insurance)

    trace = pm.sample(10000, nuts_kwargs=dict(target_accept=0.9))
Vicki B
  • 297
  • 1
  • 8
  • Exponential family as in Gamma distribution? Probably because it's easier. – user2974951 Oct 02 '19 at 08:22
  • No, literally Exponential. pm.Exponential. – Vicki B Oct 04 '19 at 23:35
  • My comment still holds, probably because it's a simple option. It doesn't really look like an exponential distribution, so either they simplified it or they have some other knowledge about the process. – user2974951 Oct 07 '19 at 08:06
  • But why do Exponential on alpha and beta? Why not just pass alpha and Beta to pm.Gamma? That's my question. Alpha and beta are calculated values (aren't they?). Why convert them to distributions at all, let alone exponential? – Vicki B Oct 08 '19 at 16:28

0 Answers0