Description Usage Arguments Details Value Author(s) See Also Examples
Simulates draws from f(theta|y) using a given empirical Bayes estimate for g(theta).
1 | GaussianEBSimulate(Y, sigma2=rep(1,length(Y)),mu,alpha,size=100,verbose=FALSE)
|
Y |
vector of data points |
sigma2 |
vector of known variances |
mu |
vector of mass locations for g(theta) |
alpha |
vector of probability mass for each mu |
size |
number of Monte Carlo draws |
verbose |
indicator of whether to print progress information |
Draws samples from f(theta|y) via Monte Carlo. Assumes that Y is normal with mean theta and variance sigma2.
theta |
empirical Bayes posterior mean estimates of theta |
sigma2 |
estimates of sigma2 (currently not estimated, assumed known) |
mu |
mass points from the NPML |
alpha |
probability mass for each mu |
Greg Ridgeway gregr@rand.org
1 2 3 4 5 6 7 | k <- 100
theta <- rnorm(k,0,1)
sigma <- rep(1,k)
Y <- rnorm(k,theta,sigma)
out.npml <- GaussianNPML(Y,sigma^2)
GaussianEBSimulate(Y,sigma^2,mu=out.npml$mu,alpha=out.npml$alpha,size=100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.