PostSummaries {rvalues} | R Documentation |
R-values from posterior summary quantities
Description
Computes r-values assuming that, for each parameter of interest, the user supplies a value for the posterior mean and the posterior standard deviation. The assumption here is that the posterior distributions are Normal.
Usage
PostSummaries(post.means, post.sds, hypers = NULL, qtheta = NULL, alpha.grid = NULL,
ngrid = NULL, smooth = 0)
Arguments
post.means |
a vector of posterior means |
post.sds |
a vector of posterior standard deviations |
hypers |
a list with two elements: mean and sd. These represent the parameters in the (Normal) prior which was used to generate the posterior means and sds. If hypers is not supplied then one must supply the quantile function qtheta. |
qtheta |
a function which returns the quantiles (for upper tail probs.) of theta. If this is not supplied, the hyperparameter must be supplied. |
alpha.grid |
grid of values in (0,1); used for the discrete approximation approach for computing r-values. |
ngrid |
number of grid points for alpha.grid; only relevant when |
smooth |
either |
Value
An object of class "rvals"
Author(s)
Nicholas Henderson and Michael Newton
See Also
Examples
n <- 500
theta <- rnorm(n)
sig_sq <- rgamma(n,shape=1,scale=1)
X <- theta + sqrt(sig_sq)*rnorm(n)
pm <- X/(sig_sq + 1)
psd <- sqrt(sig_sq/(sig_sq + 1))
rvs <- PostSummaries(post.means=pm,post.sds=psd,hypers=list(mean=0,sd=1))
hist(rvs$rvalues)