Description Usage Arguments Value Examples
Given a sample of data from a normal distribution with known variance / standard deviation, and a normal prior for the expectation of the data, draw samples from the posterior by rejection sampling.
1 2 | reject.samp.norm(z, known.sd = 1, prior.mean = 0, prior.sd = 1,
nsamps = 10000)
|
z |
A numeric vector (assumed to be drawn from a normal distribution with known variance / standard deviation) |
known.sd |
The known standard deviation of the data distribution. |
prior.mean |
The expectation of the normal prior. |
prior.sd |
The standard devation of the normal prior. |
nsamps |
The number of observations to draw from the posterior by rejection sampling. |
A numeric vector of length nsamps containing simulated data from the posterior distribution.
1 | reject.samp.norm(rnorm(100), 1, 2, 4, nsamps = 50)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.