conjugacy.RdSample 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)realizations from the distribution whose parameter is being drawn. For multivariate conjugacy, this is an n-by-p matrix
the prior mean of mu or beta. The default (NULL) is the same as an appropriately-dimensioned
vector/matrix of all zeros, but a little faster.
Other arguments. Examples include verbose=, take.chol=, and
Rstruct=.
An optional multiplier for the prior precision; useful in some cases
Should just a list of the updated parameters be returned?
the precision of the (multivariate) normal distribution from which y comes
the prior precision of mu.
the precision matrices for the matrix-normal distribution
If TRUE, both V and Q0 are assumed (but not confirmed!) to be diagonal,
which can speed up the Cholesky decomposition up to 100x. Default FALSE.
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 sum(zero).
the data matrix on beta
pre-computed "shortcut" arguments for efficiency reasons
the mean of the normal distribution from which y comes
the parameters (shape and rate) of the gamma distribution prior on tau,
or the parameters (shape1 and shape2) of the beta distribution prior on p.
the parameters (matrix and degrees of freedom) of the Wishart prior on Q or V
the coefficients on X
The number of successes
The number of trials
The shape parameter for the gamma distribution