I'm fitting a hierarchical model to some data, the fit appears to converge acceptably.
with pm.Model() as model:
mu_a = pm.Normal('mu_a', 0, sd=.2)
sigma_b = pm.HalfNormal('sig_a', 0.1)
mean = pm.Normal('mean', mu_a, sigma_b, shape=n)
std = pm.HalfNormal('std', 0.01 , shape=n)
means = mean[h]
stds = std[h]
y = pm.Laplace('y', mu=means, b=stds, observed=data)
hierarchical_trace = pm.sample(2000, n_init=30000)
When checking the posterior predictive the tails seem reasonable, min and max of the data (black line) both seem to be inside the min/max of generated samples (this is not the case with StudentT).
ppc_trace = pm.sample_ppc(model=model, trace=hierarchical_trace)
ppc with min/max/mean of original data
However the mean (right most chart) is way off, i think this is because my data is negatively skewed, so the mass of the data moves the mean too far to the right.
sp.stats.skew(data)
-0.1699020117521286
What is the recommended approach in Pymc3 to model this sort of data. Although it is a symmetric distribution Laplace seems like a good fit for my data. a Gaussian doesn't provide enough weight in the tails (which rules out skew normal?). How can I model this moderately skewed data?
My objective is to obtain an accurate MAP estimate with credible intervals for the different portions of my data (based on the hierarchical specification)