Learn R Programming

grt (version 0.2.1)

predict.glc: predict method for General Linear Classifier

Description

Predicted classification based on ‘glc’ model object.

Usage

# S3 method for glc
predict(object, newdata, seed = NULL, ...)

Arguments

object

object of class glc.

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).

Value

a vector of labels of categories to which each sample in newdata is predicted to belong, according to the model in object.

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.

References

Alfonso-Reese, L. A. (2006) General recognition theory of categorization: A MATLAB toolbox. Behavior Research Methods, 38, 579-583.

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab