predict.mvgls.dfa {mvMORPH} | R Documentation |
Predictions from Discriminant analysis conducted with a mvgls model fit
Description
Returns the prediction(s) of DFA of class 'mvgls.dfa'.
Usage
## S3 method for class 'mvgls.dfa'
predict(object, newdata, prior, ...)
Arguments
object |
an object of class 'mvgls' obtained from a |
newdata |
a matrix with new observation(s) for the response variables. Note: the predictions are performed on fitted values if "newdata" is not provided. |
prior |
the group priors. If not provided, assumes equal prior. |
... |
further arguments for this generic function. If |
Value
class |
The class assigned to each new observations |
posterior |
The posterior probabilities used to classify each new observations |
prior |
The prior used to classify each new observations to each categories |
Author(s)
J. Clavel
References
Duhamel A. et al. in prep.
See Also
mvgls.dfa
predict.mvgls
fitted.mvgls
vcov.mvgls
residuals.mvgls
coef.mvgls
mvgls
mvols
Examples
library(mvMORPH)
n=64
p=4
tree <- pbtree(n=n)
sigma <- crossprod(matrix(runif(p*p),p,p))
resid <- mvSIM(tree, model="BM1", param=list(sigma=sigma))
Y <- rep(c(0,1.5), each=n/2) + resid
grp <- as.factor(rep(c("gp1","gp2"),each=n/2))
names(grp) = rownames(Y)
data <- list(Y=Y, grp=grp)
mod <- mvgls(Y~grp, data=data, tree=tree, model="BM")
# fda
da1 <- mvgls.dfa(mod)