STA602 at Duke University
6.3 from Hoff. You can simulate from a constrained normal distribution with mean mean
and standard deviation sd
, constrained to lie in the interval using the following function:
Note that you can use this function to simulate a vector of constrained normal random variables, each with a potentially different mean, standard deviation, and constraints.
To load the data for this exercise, run the code below