Learn R Programming

CNPBayes (version 1.2.2)

qInverseTau2: Quantiles, shape, and rate of the prior for the inverse of tau2 (the precision)

Description

The precision prior for tau2 in the hiearchical model is given by gamma(shape, rate). The shape and rate are a function of the hyperparameters eta.0 and m2.0. Specifically, shape=1/2*eta.0 and the rate=1/2*eta.0*m2.0. Quantiles for this distribution and the shape and rate can be obtained by specifying the hyperparameters eta.0 and m2.0, or alternatively by specifying the desired mean and standard deviation of the precisions.

Usage

qInverseTau2(eta.0 = 1800, m2.0 = 100, mn, sd)

Arguments

eta.0
hyperparameter for precision
m2.0
hyperparameter for precision
mn
mean of precision
sd
standard deviation of precision

Value

a list with elements 'quantiles', 'eta.0', 'm2.0', 'mean', and 'sd'

Examples

Run this code
results <- qInverseTau2(mn=100, sd=1)
precision.quantiles <- results$quantiles
sd.quantiles <- sqrt(1/precision.quantiles)
results$mean
results$sd
results$eta.0
results$m2.0

results2 <- qInverseTau2(eta.0=1800, m2.0=100)

## Find quantiles from the default set of hyperparameters
hypp <- Hyperparameters(type="batch")
results3 <- qInverseTau2(eta.0(hypp), m2.0(hypp))
default.precision.quantiles <- results3$quantiles

Run the code above in your browser using DataLab