Dimensionality of deterministic variables

Your variables alpha and beta have high dimensionality because of your input vector x (they should both have the same length). The way you have it set up, you’re computing two vectors \mathbf{\alpha} and \mathbf{\beta} and then using the elements of these vectors to define different Beta likelihood for each of your observations in y, i.e. your likelihood for y_i is \text{Beta}(\alpha_i, \beta_i).

This makes sense because you’re asking whether the \alpha_i and \beta_i for y_i \sim \text{Beta}(\alpha_i, \beta_i) vary as a function of x. You’re getting back distributions over each of the \alpha_i and \beta_i, so there is no “single” \alpha or \beta.

If for some reason you really wanted to collapse them all into one curve, I suppose you could access the samples from the trace, flatten them, and then plot a KDE using that array. Maybe with arivz.plot_posterior. But personally I’m not sure what the intended interpretation of this would be.

Hope this helps!

1 Like