I’m just trying to carry out a bayesian regression and I keep getting a sampling error. This is my model:

product_array = data_aggr_period_prod_BR[‘product’].unique()

for product in product_array:

# Get the prior Normal parameters

regression_results_loop = regression_results_BR[regression_results_BR[‘Product’]==product]

data_aggr_period_prod_loop = data_aggr_period_prod_BR[data_aggr_period_prod_BR[‘product’]==product]

slope_mean = regression_results_loop[[‘Slope’]].mean().values[0]

slope_std = regression_results_loop[[‘Slope’]].std().values[0]

intercept_mean = regression_results_loop[[‘Intercept’]].mean().values[0]

intercept_std = regression_results_loop[[‘Intercept’]].std().values[0]

```
# Create bayesian model
with pm.Model() as bayesian_model_prod6:
slope = pm.Normal('slope', mu = slope_mean, sd = slope_std)
intercept = pm.Normal('intercept', mu = intercept_mean, sd = intercept_mean)
# Linear regression line
mean = intercept + slope*data_aggr_period_prod_loop['x']
# Describe the distribution of our conditional output
y = pm.Normal('y', mu = mean, observed = data_aggr_period_prod_loop['y']) # Run the sampling using pymc3 for 100 samples
trace_600 = pm.sample(100, return_inferencedata=True)
```

The sampling error is being produced from the line where I define trace_600. How could I fix this?