Description Usage Arguments Details Value Author(s) See Also Examples
Bayesians often use precision rather than variance. These are elementary
utility functions to facilitate conversions between precision,
standard deviation, and variance regarding scalars, vectors, and
matrices, and these functions are designed for those who are new to
Bayesian inference. The names of these functions consist of two
different scale parameters, separated by a ‘2’, and capital letters
refer to matrices while lower case letters refer to scalars and
vectors. For example, the Prec2Cov
function converts a
precision matrix to a covariance matrix, while the prec2sd
function converts a scalar or vector of precision parameters to
standard deviation parameters.
The modern Bayesian use of precision developed because it was more straightforward in a normal distribution to estimate precision tau with a gamma distribution as a conjugate prior, than to estimate sigma^2 with an inverse-gamma distribution as a conjugate prior. Today, conjugacy is usually considered to be merely a convenience, and in this example, a non-conjugate half-Cauchy prior distribution is recommended as a weakly informative prior distribution for scale parameters.
1 2 3 4 5 6 7 8 |
Cov |
This is a covariance matrix, usually represented as Sigma. |
Prec |
This is a precision matrix, usually represented as Omega. |
prec |
This is a precision scalar or vector, usually represented as tau. |
sd |
This is a standard deviation scalar or vector, usually represented as sigma. |
var |
This is a variance scalar or vector, usually represented as sigma^2. |
Bayesians often use precision rather than variance, where precision is the inverse of the variance. For example, a linear regression may be represented equivalently as y ~ N(mu, sigma^2), or y ~ N(mu, tau^(-1)), where sigma^2 is the variance, and tau is the precision, which is the inverse of the variance.
Cov2Prec |
This returns a precision matrix, Omega, from a covariance matrix, Sigma, where Omega = Sigma^(-1). |
Prec2Cov |
This returns a covariance matrix, Sigma, from a precision matrix, Omega, where Sigma = Omega^(-1). |
prec2sd |
This returns a standard deviation, sigma, from a precision, tau, where sigma = sqrt(tau^(-1)). |
prec2var |
This returns a variance, sigma^2, from a precision, tau, where sigma^2 = tau^(-1). |
sd2prec |
This returns a precision, tau, from a standard deviation, sigma, where tau = sigma^(-2). |
sd2var |
This returns a variance, sigma^2, from a standard deviation, sigma, where sigma^2 = sigma x sigma. |
var2prec |
This returns a precision, tau, from a variance, sigma^2, where tau = 1 / sigma^2. |
var2sd |
This returns a standard deviation, sigma, from a variance, sigma^2, where sigma = sqrt(sigma^2). |
Statisticat, LLC. software@bayesian-inference.com
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.