# Prior predicitive for linear regression

I am unable to get the prior predictive distribution. Here is the reproducible code:

``````df = pd.read_csv('https://raw.githubusercontent.com/aloctavodia/Statistical-Rethinking-with-Python-and-PyMC3/master/Data/Howell1.csv',sep=';')
with pm.Model() as m4_3:
alpha = pm.Normal('alpha', mu=178, sd=100)
beta = pm.Normal('beta', mu=0, sd=10)
sigma = pm.Uniform('sigma', lower=0, upper=50)
mu = pm.Deterministic('mu', alpha + beta * (df.weight - df.weight.mean() )) # try uncomenting this line and comenting the above line
height = pm.Normal('height', mu=mu, sd=sigma)
trace_4_3 = pm.sample(1000, tune=1000)
``````

I get

``````The error when converting the test value to that variable type:
Wrong number of dimensions: expected 0, got 1 with shape (544,).
``````

beause I have put in a input of weight in beta, but not output of height. How do I generate Prior predicitive for this model?

Can anyone help me with this?

``````with pm.Model() as m4_3:
alpha = pm.Normal('alpha', mu=178, sd=100)
beta = pm.Normal('beta', mu=0, sd=10)
sigma = pm.Uniform('sigma', lower=0, upper=50)
mu = pm.Deterministic('mu', alpha + beta * (df.weight - df.weight.mean() )) # try uncomenting this line and comenting the above line
height = pm.Normal('height', mu=mu, sd=sigma, testval=100.)
trace_4_3 = pm.sample_prior_predictive(1000)

vn = [x for x in trace_4_3.keys() if x[-1] != '_']
for v in vn:
if len(trace_4_3[v].shape) > 1:
sbn.kdeplot(trace_4_3[v][:,0])
else:
sbn.kdeplot(trace_4_3[v])
`````` 