predict.ecoX | R Documentation |
Obtains out-of-sample posterior predictions under the fitted parametric
Bayesian model for ecological inference. predict
method for class
eco
and ecoX
.
## S3 method for class 'ecoX' predict( object, newdraw = NULL, subset = NULL, newdata = NULL, cond = FALSE, verbose = FALSE, ... )
object |
An output object from |
newdraw |
An optional list containing two matrices (or three
dimensional arrays for the nonparametric model) of MCMC draws of μ
and Σ. Those elements should be named as |
subset |
A scalar or numerical vector specifying the row number(s) of
|
newdata |
An optional data frame containing a new data set for which posterior predictions will be made. The new data set must have the same variable names as those in the original data. |
cond |
logical. If |
verbose |
logical. If |
... |
further arguments passed to or from other methods. |
The posterior predictive values are computed using the Monte Carlo sample
stored in the eco
output (or other sample if newdraw
is
specified). Given each Monte Carlo sample of the parameters, we sample the
vector-valued latent variable from the appropriate multivariate Normal
distribution. Then, we apply the inverse logit transformation to obtain the
predictive values of proportions, W. The computation may be slow
(especially for the nonparametric model) if a large Monte Carlo sample of
the model parameters is used. In either case, setting verbose = TRUE
may be helpful in monitoring the progress of the code.
predict.eco
yields a matrix of class predict.eco
containing the Monte Carlo sample from the posterior predictive distribution
of inner cells of ecological tables. summary.predict.eco
will
summarize the output, and print.summary.predict.eco
will print the
summary.
eco
, predict.ecoNP
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.