I coded a model with pymc and it has non-int error

21 Views Asked by At
my_model = pm.Model()
with my_model:
    alpha = pm.Normal("alpha", mu=0, sigma=5)
    beta = pm.Normal("beta", mu=0,sigma=5)
    hbeta= pm.Normal("hbeta", mu=0,sigma=5)
    sig = pm.Exponential("sigma", lam=1)
    
    E = np.array(["elevation"])
    H = np.array(df["habitat_type"])
    ob_slope=np.array(df["slope"])
    s = pm.Normal("slope",mu= alpha + beta * E + hbeta * H,sigma=sig, observed=ob_slope)
    
    idata=pm.sample(chains=4, progressbar=False)
    summary = az.summary(idata)
    
    fig, ax=plt.subplots(figsize=(10,6))
    az.plot_posterior(idata, ax=ax)
    plt.show()
    
print(summary) 


TypeError: can't multiply sequence by non-int of type 'TensorVariable'

I change dthe dtype of all columns to int but still get the error

type here
0

There are 0 best solutions below