khakieconomics / stanecon_short_course

Notes for short course on econometrics in Stan
Creative Commons Zero v1.0 Universal
10 stars 3 forks source link

Explaining Stan code #3

Open maswiebe opened 3 years ago

maswiebe commented 3 years ago

In independent_iv.stan, we have mu as an Nx2 matrix and Y as an N-vector. So I was confused to see the model written as:

Y[i]~ normal(mu[i], sigma[1]); endog_regressor[i]~ normal(mu[2], sigma[2]);

Isn't mu[i] the i-th 1x2 row of the matrix? And isn't mu[2] the second row of the matrix?

I know I'm missing something here, as my attempted code didn't perform as well.