I have 2 different models and would like to understand why one model produces poor results and the other does not.
The first model(aka simple model) produces reasonable results.
with Model() as model_alpha_beta_simple:
rho = Normal(name="rho", mu=0, sigma=0.1)
beta = beta_vals
alpha = alpha_vals
nu = Normal(name="nu", mu=4.6, sigma=0.3)
residual_ratio = StudentT(
name = 'residual_ratio',
mu = np.power(
np.power(alpha,2)
+ np.power(beta * independent_vals, 2)
+ 2 * beta * rho * alpha * independent_vals,
0.5
) / dependent_vals - 1,
sigma = 0.06,
nu = nu,
observed=residual_ratio_vals
)
# Inference!
# draw 3000 posterior samples using NUTS sampling
idata_simple = sample(draws=1000,tune=1000)
The second model produces a really poor posterior plot. In this model, I add a random variable to describe sigma in my residuals.
with Model() as model_alpha_beta:
rho = Normal(name="rho", mu=0, sigma=0.1)
beta = beta_vals
alpha = alpha_vals
sigma = Gamma(name="sigma", alpha=1., beta=10.)
nu = Normal(name="nu", mu=4.6, sigma=0.3)
residual_ratio = StudentT(
name = 'residual_ratio',
mu = np.power(
np.power(alpha,2)
+ np.power(beta * independent_vals, 2)
+ 2 * beta * rho * alpha * independent_vals,
0.5
) / dependent_vals - 1,
sigma = sigma,
nu = nu,
observed=residual_ratio_vals
)
# Inference!
# draw 3000 posterior samples using NUTS sampling
idata = sample(draws=1000,tune=1000)
Please help me understand why this causes an issue or how I could answer this question on my own.