Just joined and posting for the first time. I am trying to fit a model to figure out the concentration of drugs needed to kill some bacteria. The drug will only contribute to death of bacteria if its concentration is above a certain amount. I could not figure out how to pass this condition in the model.
In the model df[‘Conc’] is a distribution [array] of drug so each single value of kill_pred depends on the calculation of this array.
with pm.Model() as model_kill:
active = pm.Normal('m', mu = 2, sd=2) ϵ = pm.HalfCauchy('ϵ', 5) μ = pm.Deterministic('μ', np.sum(df['Conc'][:active])) #get error here # TypeError: cannot do slice indexing on <class # 'pandas.core.indexes.range.RangeIndex'> with these indexers [n] # of <class 'pymc3.model.FreeRV'> # Likelihood kill_pred = pm.Normal('kill_pred', mu=μ, sd=ϵ, observed=y )
Thanks in advance!