Back to this model.
My Outcome can take any continuous value from [0, infinity)
My Intercept can be normally distributed
My slope can have only positive outcome [0, infinity)
What should be my Likelihood? And how should I code it to including ‘mu’ ?
with pm.Model() as model_mlr_log:
# Intercept
alpha = pm.Normal('alpha', mu=1, sd=10)
# Slope
beta = pm.HalfNormal('beta', sd =10, shape = len(data.columns[:-1]))
# Error term
eps = pm.HalfCauchy('eps', 5)
# Expected value of outcome (ML Regression with vectors)
mu = alpha + pm.math.dot(x, beta)
# Likelihood
??????????????
# posterior
trace_log = pm.sample(chains = 4, target_accept = 0.9)
if I make Likelihood as Gamma:
conversion = pm.Gamma(‘conversion’, mu= mu, sigma= eps, observed=y)
It doesn’t work as my target variable has values “0”.
getting this error :
Initial evaluation results:
alpha -3.22
beta_log__ 0.00
eps_log__ -1.14
conversion -inf
Name: Log-probability of test_point, dtype: float64
It works When I delete data that contains target variables as “0”