I’m new to pymc and probabilistic programming and I’m stuck with this error message:
Version: v4.0.0b6
SamplingError: Initial evaluation of model at starting point failed!
Starting values:
{'alpha_interval__': array(-0.16849976), 'beta_interval__': array(-0.38707828)}
Initial evaluation results:
{'alpha': -1.39, 'beta': -1.42, 'y': -inf}
I have observations that fit Beta model well:
When I manually guess the alpha and beta parameters for the Beta distribution, I get a good approximation:
I have a lot of 0s in the observation data and replaced all of them with 0.0001. Min and Max values of my observations are: (1e-05, 1.0)
Now, I need to estimate the parameters with pymc, but I’m getting an error:
with pm.Model() as model:
alpha = pm.Uniform("alpha", lower=0.13, upper=0.15)
beta = pm.Uniform("beta", lower=3, upper=3.5)
y = pm.Beta("y", alpha=alpha, beta=beta, observed=observations)
prior = pm.sample_prior_predictive(random_seed=RANDOM_SEED)
trace = pm.sample(tune=1000, draws=4000, chains=4, cores=-1, return_inferencedata=True)
posterior_predictive = pm.sample_posterior_predictive(trace=trace)
I cannot figure out what the problem is, please help!