Gamma distribution for modeling multi-valued response?

Hello devs

I have a bivariate independent response variable. I want to use Gamma distribution for the likelihood, but there does not seem to be a multi-variate Gamma distribution.

I have checked, and the shape, scale and obs variables have the shape (1070, 2)

        with numpyro.plate("data", 1070):
            return numpyro.sample(
                obs,
                dist.Gamma(shape, scale),
                obs=obs
            )

returns the error: Incompatible shapes for broadcasting: shapes=[(1070,), (1070, 2)]

How can I fix this issue?

please read the tensor shapes tutorial

you probably need dist.Gamma(shape, scale).to_event(1)

1 Like

Hello @martinjankowiak . It’s working now. Thank you so much for pointing me to this resource!

i also recommend reading this tutorial which goes over a number of examples using plates

2 Likes