mlenert / BIOS8366_Homework

0 stars 0 forks source link

Hw2 Submission #2

Closed mlenert closed 5 years ago

mlenert commented 5 years ago

@nstrayer opening this issue for hw2 feedback

nstrayer commented 5 years ago

1.1 So close, but you forgot to take the square root of your variance here for the norm.cdf.

Doing so will put your answer at the correct 86%. print("The normal approximation estimates a "+str(round(1-norm.cdf(0,mode[0],np.sqrt(var[0][0])),2)*100)+ "% probability that the coin is biased toward heads")

1.2 You're good in the setup but you need to run a few more samples to converge to a stable answer.

1.3 Careful with the rounding here. There's a big difference between the rounded 90% you gave and the 86 of the truth.

(9/10)

2.1 Good! Look into np.which as an alternative to a loop.

2.2 Great. I would potentially allow the y-axis to be a bit tighter on the trace plot to see the patterns a bit more. I like how cleanly coded the algorithm is, too.

2.3 Here what we were looking for is you to not reparameterize the posterior but to simply apply the logit transform to bound your new proposals to the 0-1 range. Your posterior mean/ mode should not shift like it has. Probably just a small order or operations thing in the posterior setup.

2.4 Good stuff.

(8/10)

3.1 You're parameterizations are a bit off. The beta distribution has a limited range of 0-1 so you're forcing the treatment group to have an increase in effect and for that increase to be no larger than one. A better option is an unbounded range distribution. In particular a normal is really the correct value as the sum of two normals is a normal and thus the relationship of the mean having a normal in the parameterization supplied still holds. E.g. delta = pm.Normal("delta", 0, sd = 100).

3.2 Posterior predictive checks in this small of a dataset would be good with a point for each true value and a distribution of the conditional posterior. The marginal posterior and mean can mask a lot of interesting behavior.

3.3 Good thorough comparison of the different types of comparisons.

(7/10)

Overall (24/30)