| predict.glc {grt} | R Documentation |
predict method for General Linear Classifier
Description
Predicted classification based on ‘glc’ model object.
Usage
## S3 method for class 'glc'
predict(object, newdata, seed = NULL, ...)
Arguments
object |
object of class |
newdata |
a vector or a matrix containing new samples with which the classification prediction is to be made. |
seed |
numeric. The ‘seed’ used for the random number generator. |
... |
further arguments (currently unused). |
Details
The function predict (or ‘simulate’) classification response of an observer whose noise and linear decision bounds are specified in object.
The predicted category labels are matched with those used for the fit in object.
If newdata is missing, the predictions are made on the data used for the fit.
Value
a vector of labels of categories to which each sample in newdata is predicted to belong, according to the model in object.
Author(s)
Author of the original Matlab routines: Leola Alfonso-Reese
Author of R adaptation: Kazunaga Matsuki
References
Alfonso-Reese, L. A. (2006) General recognition theory of categorization: A MATLAB toolbox. Behavior Research Methods, 38, 579-583.
Examples
data(subjdemo_2d)
fit.2dl <- glc(response ~ x + y, data=subjdemo_2d,
category=subjdemo_2d$category, zlimit=7)
m <- list(c(187, 142), c(213.4, 97.7))
covs <- diag(c(900, 900))
newd <- grtrnorm(n=20, np=2, means=m, covs=covs, seed=1234)
predict(fit.2dl, newd[,2:3], seed=1234)