STA 410, Fall 2014, Assignment #2 Discussion For the first problem, the MLE for the mean accounting for rounding was almost identical to the sample mean. This is perhaps as expected, since the effect of rounding for observations less than the true mean may be opposite to the effect of rounding for observations greater than the true mean, so the effects largely cancel. However, the MLE for the standard deviation was appreciably different from the sample standard deviation, with the sample standard deviation being larger for all three datasets. This was seen even when the true mean was varied over a range of values, so it was not due to peculiarities of rounding with one particular mean. The larger value for the sample standard deviation may be because rounding of an observation that is in the tail of the distribution is more likely to make the observation be further from the mean than to make it be nearer to the mean, since observations further out in the tail are less likely. (For example, consider the range that rounds to some value in the upper tail - observations in this range that round up, away from the mean, are more likely than those that round down, towards the mean.) Using R's integrate function was more than ten times slower than using pnorm. This is an indication of how much effort has been put into making pnorm fast. For the second problem, the plots of the posterior density for rho for both datasets show a singular peak at zero, corresponding to the singularity in the prior, but this peak has less probability mass for the second dataset where the true correlation was non-zero. For both datasets there is another posterior mode near the sample correlation, but with a peak not exactly equal to the sample correlation. This mode is also not exactly at the true correlation, as expected, but it is at a greater value for the second dataset, where the true correlation is positive, than for the first dataset, where it is zero. As another indication of the result of the inference, I computed the posterior probability of the true correlation being less than zero for both datasets. The result was 0.16 for the first dataset versus 0.03 for the second, showing that the data does favour a positive correlation much more strongly for the second dataset than for the first. Using the same distribution as for the first dataset, I tried increasing n above 40 to see when the procedure failed due to floating point underflow. Failure occurred when n was 53, due to the first factor in bvn_likelihood being Inf and the second factor being zero, with the result being NaN. It might be possible to get it to work for somewhat larger values of n by changing bvn_likelihood to avoid overflow for a bit larger n. But for much larger n, the true likelihood will underflow to zero. To get the procedure to work then, one could try computing the likelihood divided by the likelihood at the maximum likelihood estimates for rho and sigma. This will certainly not underflow to zero for all values of rho and sigma, and hence should give sensible integrals. [ Note: The second problem can be solved corectly in various ways. For instance, in the nested integrals used to compute the normalizing constant, the outer integral could either be over rho or over sigma. Also, in my solution, the normalizing constant is computed more than once when plotting the posterior density for rho, which could be avoided with a slightly more complicated program. ]