See details for model. Notation: N
is number of samples,
D
is the dimension of the response, Q
is number
of covariates.
conjugateLinearModel(Y, X, Theta, Gamma, Xi, upsilon, n_samples = 2000L)
matrix of dimension D x N
matrix of covariates of dimension Q x N
matrix of prior mean of dimension D x Q
covariance matrix of dimension Q x Q
covariance matrix of dimension D x D
scalar (must be > D-1) degrees of freedom for InvWishart prior
number of samples to draw (default: 2000)
List with components
Lambda Array of dimension (D-1) x Q x n_samples (posterior samples)
Sigma Array of dimension (D-1) x (D-1) x n_samples (posterior samples)
$$Y ~ MN_{D-1 x N}(Lambda*X, Sigma, I_N)$$
$$Lambda ~ MN_{D-1 x Q}(Theta, Sigma, Gamma)$$
$$Sigma ~ InvWish(upsilon, Xi)$$
This function provides a means of sampling from the posterior distribution of
Lambda
and Sigma
.
sim <- pibble_sim()
eta.hat <- t(alr(t(sim$Y+0.65)))
fit <- conjugateLinearModel(eta.hat, sim$X, sim$Theta, sim$Gamma,
sim$Xi, sim$upsilon, n_samples=2000)