Learn R Programming

grt (version 0.1.0)

gqc: General Quadratic Classifier

Description

Fit a general quadratic classifier (a.k.a. quadratic decison-bound model).

Usage

gqc(formula,
    data,
    category,
    par = list(),
    zlimit = Inf,
    fixed = list(),
    opt = c("nlminb", "optim"),
    lower=-Inf,
    upper=Inf,
    control=list())

Arguments

formula
A formula of the form response ~ x1 + x2 + ... where the response specifies the grouping factor (generally a participant's response) and the right hand side specifies the feature values of the classified stimuli.
data
A data frame from which variables specified in formula are taken.
category
(Optional.) A factor specifying the true category menbership of the stimuli.
par
object of class gqcStruct or named list containing a set of initial parameters used to fit the data.
zlimit
numeric. The z-scores (or discriminant scores) beyound the speficied value will be truncated. Default to Inf
fixed
A named list of logical vectors specifying whether each of pnoise, cnoise, coeffs, and bias parameters should be fixed to the initial value. Default to all FALSE. A fatal error will result i
opt
A character string specifying the optimizer to be used: either nlminb (the default) or optim. If "optim", "L-BFGS-B" method is used (s
lower, upper
Bounds on the parameters. Default values of lower and upper are c(.1, .1, rep(-Inf, length(unlist(par))-2)), and c(5000, 5000, rep( Inf, length(unlist(par))-2)), respectively.
control
A list of control parameters passed to the optimizer. See Details of nlminb or optim

Value

  • object of class gqc, i.e., a list containing the following components:
  • termsthe terms object used.
  • callthe matched call.
  • modelthe design matrix used to fit the model.
  • categorythe category vector as specified in the input.
  • initparthe initial parameter used to fit the model.
  • parthe fitted parameter.
  • logLikthe log-likelihood at convergence.

Details

If par is not fully specified in the argument, the function attemps to calculate the initial parameter values by internally calling the functions mcovs and qdb. The response specified in the formula is used as the grouping factor in mcovs.

References

Alfonso-Reese, L. A. (2006) General recognition theory of categorization: A MATLAB toolbox. Behavior Research Methods, 38, 579-583. Ashby, F. G., & Gott, R. E. (1988). Decision rules in the perception and categorization of multidimensional stimuli. Journal of Experimental Psychology: Learning, Memory, & Cognition, 14, 33-53.

Ashby, F. G. (1992) Multidimensional models of perception and cognition. Lawrence Erlbaum Associates.

See Also

glc, qdb, logLik.gqc, logLik.gqcStruct, plot.gqc, plot3d.gqc

Examples

Run this code
data(subjdemo_2d)
fit.2dq <- gqc(response ~ x + y, data=subjdemo_2d,
    category=subjdemo_2d$category, zlimit=7)

Run the code above in your browser using DataLab