conjugacy | R Documentation |
Sample from the posterior (conditional on all other parameters) in the conjugate setting.
conj_norm_mu(y, tau, mu0 = 0, tau0 = 0.001, ..., mult = 1, params.only = FALSE)
conj_mvnorm_mu(
y,
Q,
mu0 = NULL,
Q0 = diag(0.001, p),
...,
newQ = mult * Q0 + n * Q,
newQ.chol = gu_chol(newQ),
mult = 1,
params.only = FALSE
)
conj_matnorm_mu(
y,
V,
U = NULL,
mu0 = NULL,
Q0,
...,
newQ = V %x% U + Q0,
newQ.chol = gu_chol(newQ),
diag = FALSE,
zero = NULL,
params.only = FALSE
)
conj_lm_beta(
y,
X,
XtX = t(X) %*% X,
tau,
mu0 = NULL,
Q0,
...,
newQ = tau * XtX + Q0,
newQ.chol = gu_chol(newQ),
params.only = FALSE
)
conj_matlm_beta(
y,
X,
V,
U = NULL,
mu0 = NULL,
Q0,
...,
XtU = if (is.null(U)) t(X) else t(X) %*% U,
XtUX = XtU %*% X,
newQ = V %x% XtUX + Q0,
newQ.chol = gu_chol(newQ),
diag = FALSE,
zero = NULL,
params.only = FALSE
)
conj_norm_tau(y, mu, a0 = 0.001, b0 = 0.001, params.only = FALSE)
conj_mvnorm_Q(y, mu = NULL, V0, v0, V0_inv = chol_inv(V0), params.only = FALSE)
conj_matnorm_V(
y,
mu = NULL,
U = NULL,
V0,
v0,
...,
ytUy = t(ymu) %*% U %*% ymu,
V0_inv = chol_inv(V0),
params.only = FALSE
)
conj_lm_tau(
y,
X,
beta,
Xbeta = X %*% beta,
a0 = 0.001,
b0 = 0.001,
params.only = FALSE
)
conj_binom_p(k, n, a0 = 1, b0 = 1, params.only = FALSE)
conj_gamma_b(x, a, a0, b0, params.only = FALSE)
y , x |
realizations from the distribution whose parameter is being drawn. For multivariate conjugacy, this is an n-by-p matrix |
mu0 |
the prior mean of |
... |
Other arguments. Examples include |
mult |
An optional multiplier for the prior precision; useful in some cases |
params.only |
Should just a list of the updated parameters be returned? |
Q , tau |
the precision of the (multivariate) normal distribution from which |
Q0 , tau0 |
the prior precision of |
V , U |
the precision matrices for the matrix-normal distribution |
diag |
If |
zero |
A matrix of ones and zeros, the same size as the beta to sample. Zero indicates a structural zero in the beta.
In the event that this is specified, everything returned is of size |
X |
the data matrix on |
XtX , XtU , XtUX , ytUy , V0_inv , Xbeta , newQ , newQ.chol |
pre-computed "shortcut" arguments for efficiency reasons |
mu |
the mean of the normal distribution from which |
a0 , b0 |
the parameters (shape and rate) of the gamma distribution prior on |
V0 , v0 |
the parameters (matrix and degrees of freedom) of the Wishart prior on |
beta |
the coefficients on |
k |
The number of successes |
n |
The number of trials |
a |
The shape parameter for the gamma distribution |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.