| basset_fit | R Documentation |
Basset (A Lazy Learner) - non-linear regression models in fido
basset(
Y = NULL,
X,
upsilon = NULL,
Theta = NULL,
Gamma = NULL,
Xi = NULL,
linear = NULL,
init = NULL,
pars = c("Eta", "Lambda", "Sigma"),
newdata = NULL,
...
)
## S3 method for class 'bassetfit'
refit(m, pars = c("Eta", "Lambda", "Sigma"), ...)
Y |
D x N matrix of counts (if NULL uses priors only) |
X |
Q x N matrix of covariates (cannot be NULL) |
upsilon |
degrees of freedom for the inverse-Wishart prior on Sigma (numeric, must be > D-2; the prior mean of Sigma exists only if > D) Values <= D require an explicit positive-definite Xi. (default: D+3) |
Theta |
A function from dimensions dim(X) -> (D-1)xN (prior mean of gaussian process). For an additive GP model, can be a list of functions from dimensions dim(X) -> (D-1)xN + a (optional) matrix of size (D-1)xQ for the prior of a linear component if desired. |
Gamma |
A function from dimension dim(X) -> NxN (kernel matrix of gaussian process). For an additive GP model, can be a list of functions from dimension dim(X) -> NxN + a QxQ prior covariance matrix if a linear component is specified. It is assumed that the order matches the order of Theta. |
Xi |
(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) |
linear |
A vector denoting which rows of X should be used if a linear component is specified. Default is all rows. |
init |
(D-1) x N initialization for Eta for optimization |
pars |
character vector of posterior parameters to return |
newdata |
Default is |
... |
other arguments passed to pibble (which is used internally to fit the basset model) |
m |
object of class bassetfit |
upsilon is the usual inverse-Wishart degrees of freedom, so
the prior mean of Sigma is Xi/(upsilon-D) (for upsilon > D).
Larger values give a more concentrated prior on Sigma. Internally this is
converted to the matrix-t degrees of freedom (upsilon-D+2) used by
the collapsed model; you do not need to do this yourself. (If you call
optimPibbleCollapsed directly, you do.)
Versions of fido before 1.1.5 skipped this conversion when D > 2, so
the prior used to estimate Eta did not match the prior requested. Fits made
with earlier versions should be refit from the original data and priors.
Log marginal likelihoods from earlier versions were also mis-normalized (for
any D) and should not be compared with new values.
The full model is given by:
Y_j \sim Multinomial(\pi_j)
\pi_j = \Phi^{-1}(\eta_j)
\eta \sim MN_{D-1 \times N}(\Lambda, \Sigma, I_N)
\Lambda \sim GP_{D-1 \times Q}(\Theta(X), \Sigma, \Gamma(X))
\Sigma \sim InvWish(\upsilon, \Xi)
Where \Gamma(X) is short hand for the Gram matrix of the Kernel function.
Alternatively can be used to fit an additive GP of the form:
Y_j \sim Multinomial(\pi_j)
\pi_j = \Phi^{-1}(\eta_j)
\eta \sim MN_{D-1 \times N}(\Lambda, \Sigma, I_N)
\Lambda = \Lambda_1 + ... + \Lambda_p + B X
\Lambda_1 \sim GP_{D-1 \times Q}(\Theta_1(X), \Sigma, \Gamma_1(X))
...
\Lambda_p \sim GP_{D-1 \times Q}(\Theta_p(X), \Sigma, \Gamma_p(X))
B \sim MN(\Theta_B, \Sigma, \Gamma_B)
\Sigma \sim InvWish(\upsilon, \Xi)
Where \Gamma(X) is short hand for the Gram matrix of the Kernel function.
Default behavior is to use MAP estimate for uncollaping the LTP model if laplace approximation is not preformed.
an object of class bassetfit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.