Skip to content

Question: BART with Binomial liikelihood? #31

Closed
@juanitorduz

Description

@juanitorduz

Hi! 👋 ! I am trying to use a BART to model a Binomial likelihood as

with pm.Model() as model:
    mu = pmb.BART(name="mu", X=x, Y=k)
    p = pm.Deterministic(name="p", var=pm.math.invlogit(mu))
    pm.Binomial(name="likelihood", n=n, p=p, observed=k)

However I have problems sampling as the initial value of mu is very high and makes p=1.0. I tried changing the initval but Ii believe the problem is conceptual: According to https://bayesiancomputationbook.com/markdown/chp_07.html#the-bart-model The BART model works when modeling the expected value. For the normal, poisson, negative-binomial and Bernoulli this is fine as one of the parameters represents the mean. This is however not the case for a Binomial distribution Binomial(n, p) where the expected value is np. Do you have a tip or trick to use BART with a Binomial likelihood? Or am I missing something ini the model parametrization ?

Remark It seems the inv_link from BART is not available in pymc 5.0.1 right?

Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions