This function is largely a more user friendly wrapper around
optimMaltipooCollapsed
and
uncollapsePibble
.
See details for model specification.
Notation: N
is number of samples,
D
is number of multinomial categories, Q
is number
of covariates, P
is the number of variance components
iter
is the number of samples of eta
(e.g.,
the parameter n_samples
in the function
optimPibbleCollapsed
)
maltipoo(
Y = NULL,
X = NULL,
upsilon = NULL,
Theta = NULL,
U = NULL,
Xi = NULL,
init = NULL,
ellinit = NULL,
pars = c("Eta", "Lambda", "Sigma"),
...
)
an object of class maltipoofit
D x N matrix of counts (if NULL uses priors only)
Q x N matrix of covariates (design matrix) (if NULL uses priors only, must be present to sample Eta)
dof for inverse wishart prior (numeric must be > D) (default: D+3)
(D-1) x Q matrix of prior mean for regression parameters (default: matrix(0, D-1, Q))
a PQ x Q matrix of stacked variance components (each of dimension Q x Q)
(D-1)x(D-1) prior covariance matrix (default: ALR transform of diag(1)*(upsilon-D)/2 - this is essentially iid on "base scale" using Aitchison terminology)
(D-1) x Q initialization for Eta for optimization
P vector initialization values for ell for optimization
character vector of posterior parameters to return
arguments passed to optimPibbleCollapsed
and
uncollapsePibble
the full model is given by: $$Y_j \sim Multinomial(Pi_j)$$ $$Pi_j = Phi^{-1}(Eta_j)$$ $$Eta \sim MN_{D-1 x N}(Lambda*X, Sigma, I_N)$$ $$Lambda \sim MN_{D-1 x Q}(Theta, Sigma, Gamma)$$ $$Gamma = e^{ell_1} U_1 + ... + e^{ell_P} U_P$$ $$Sigma \sim InvWish(upsilon, Xi)$$
Where A = (I_N + X * Gamma * X')^-1, K^-1 = Xi is a (D-1)x(D-1) covariance matrix, U_1 is a Q x Q covariance matrix (a variance component), e^ell_i is a scale for that variance component and Phi^-1 is ALRInv_D transform.
Default behavior is to use MAP estimate for uncollaping collapsed maltipoo model if laplace approximation is not preformed.
Parameters ell are treated as fixed and estimated by MAP estimation.