0
$\begingroup$

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))
$\endgroup$
5
  • $\begingroup$ Exponential family as in Gamma distribution? Probably because it's easier. $\endgroup$ Commented Oct 2, 2019 at 8:22
  • $\begingroup$ No, literally Exponential. pm.Exponential. $\endgroup$
    – Vicki B
    Commented Oct 4, 2019 at 23:35
  • $\begingroup$ 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. $\endgroup$ Commented Oct 7, 2019 at 8:06
  • $\begingroup$ 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? $\endgroup$
    – Vicki B
    Commented Oct 8, 2019 at 16:28
  • $\begingroup$ One answer could be that it is less parameters to estimate. $\endgroup$
    – Kots
    Commented Oct 31, 2023 at 10:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.