gbosquechacon / statrethink_course_in_pymc3

Statistical Rethinking course in pymc3
142 stars 44 forks source link

Index variables in homework for week 5, exercise 3 #5

Open webthusiast opened 3 years ago

webthusiast commented 3 years ago

In In[11], in the definition of mu, you use e.g. wj[W*J]. If I'm not mistaken, the index of this is 0 if either W or J is 0, and 1 if both are 1. Indexes 2 and 3 are never used. This is also reflected in Out[12] where wj[2] and wj[3] etc. are essentially equal to their priors. I guess you meant wj[2*W+J] instead.

Alternatively, I think you can use shape=(2, 2) in the definition of wj, and wj[W,J] in the definition of mu.

If I'm mistaken, please let me know. I'm only just learning this stuff.

gbosquechacon commented 3 years ago

Hey, @webthusiast thanks for the catch. I'll try and look at it in detail in the next days and will get back to you : )