Hello,
I am trying to create a model with a custom exponential likelihood. I am getting a MissingInputError but I can’t understand why. The time_booster variable is initialized with shape = 2 and the values passed in by B_final[“Side”].values are zeroes and ones.
def custom_exponential(rate, time):
return tt.switch((time <= 0).all(), tt.sum(ratetime), tt.log(rate) - ratetime)with pm.Model() as model:
Bounded_Student = pm.Bound(pm.StudentT, lower = 0.0, upper = 10.0)
Bounded_Normal = pm.Bound(pm.Normal, lower = 0.0)
rate_pop = Bounded_Student(“Rate_Population”, nu = 1.5, sigma = 2.5)
rate_sig = pm.HalfStudentT(“Rate_Sigma”, nu = 1, sigma = 1.5)
game_rate = Bounded_Student(“Game_Rate”, nu = rate_pop, sigma = rate_sig, shape = game_ids_count)
rho_pop = Bounded_Normal(“Rho_Population”,mu = 1, sigma = .5)
rho_sig = pm.HalfStudentT(“Rho_Sigma”, nu = 1, sigma = 0.5)
rho = Bounded_Normal(“Rho_List”, mu = rho_pop, sigma = rho_sig, shape = rho_count)
booster_pop = Bounded_Normal(“Booster_Population”, mu = .5, sigma = .25)
booster_sigma = pm.HalfStudentT(“Booster_Sigma”, nu = 1, sigma = 1)
time_booster = Bounded_Student(“Time_Booster”, nu = booster_pop, sigma = booster_sigma, shape = 2)each_rate = game_rate[game_ids]*rho[rho_list] + time_booster[B_final["Side"].values]*B_final["Time_List"].values like = pm.DensityDist("like", custom_exponential, observed = dict(rate = each_rate, time = B_final["Team_Exp"].values))
with model:
test = pm.sample(2500, cores = 1)
MissingInputError: Input 0 of the graph (indices start from 0), used to compute sigmoid(Time_Booster_interval__), was not provided and not given a value.