I’m trying to run the code in chapter 1 of the book that Thomas Wiecki recommended: Probabilistic Programming and Bayesian Methods for Hackers.
However, I get the error: “The number of effective samples is smaller than 25% for some parameters.”
The data being analyzed is the number of text messages sent per day for a period of 70 days.
with pm.Model() as model: alpha = 1.0/count_data.mean() lambda_1 = pm.Exponential("lambda_1", alpha) lambda_2 = pm.Exponential("lambda_2", alpha) tau = pm.DiscreteUniform("tau", lower=0, upper=n_count_data - 1) idx = np.arange(n_count_data) lambda_ = pm.math.switch(tau > idx, lambda_1, lambda_2) observation = pm.Poisson("obs", lambda_, observed=count_data) step = pm.Metropolis() trace = pm.sample(10000, tune=5000,step=step)
What does this error mean exactly, and why am I getting it? I tried changing sample numbers but that didn’t help.