You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed here with @lucianopaz, the following model samples smoothly when using pm.sample and pm.sample_posterior_predictive. But it raises ValueError: operands could not be broadcast together with shapes (500,10886) (500,) when trying pm.sample_prior_predictive (10886 is the number of data points):
Adding shape=bike_data["temp_std"].to_numpy().shape to the Negative Binomial doesn't help.
The data simply come from Kaggle’s bike-sharing demand contest.
It looks like a shape issue when drawing random values from the Gamma distribution:
It's trying to do the division mu / alpha before it sorts the shapes out. The scipy function needs a wrapper like the _random method in, e.g. ZeroInflatedNegativeBinomial.
I have this, I will try to make a pull request for it.
Description of your problem
As discussed here with @lucianopaz, the following model samples smoothly when using
pm.sample
andpm.sample_posterior_predictive
. But it raisesValueError: operands could not be broadcast together with shapes (500,10886) (500,)
when tryingpm.sample_prior_predictive
(10886 is the number of data points):Adding
shape=bike_data["temp_std"].to_numpy().shape
to the Negative Binomial doesn't help.The data simply come from Kaggle’s bike-sharing demand contest.
It looks like a shape issue when drawing random values from the Gamma distribution:
Versions and main components
The text was updated successfully, but these errors were encountered: