Learn R Programming

grt (version 0.1-2)

extractAIC: extractAIC method for class 'glc', 'gqc', and 'grg'

Description

Extract Akaike's An Information Criteria from a General Linear or Quadratic Classifier, or a General Random Guessing model

Usage

## S3 method for class 'glc':
extractAIC(fit, scale, k = 2, \dots)

## S3 method for class 'gqc': extractAIC(fit, scale, k = 2, \dots)

Arguments

fit
object of class glc, gqc, or grg
scale
unused argument
k
numeric specifying the penalty per parameter to be used in calculating AIC. Default to 2.
...
further arguments (currently not used).

Value

  • A numeric vector of length 2 including:
  • dfthe degrees of freedom for the fitted model fit.
  • AICthe Akaike's Information Criterion for fit.

Details

As with the default method, the criterion used is $$AIC = - 2\log L + k \times \mbox{df},$$ where $L$ is the likelihood and $df$ is the degrees of freedom (i.e., the number of free parameters) of fit.

Examples

Run this code
data(subjdemo_2d)
#fit a 2d suboptimal model
fit.2dl <- glc(response ~ x + y, data=subjdemo_2d, 
    category=subjdemo_2d$category, zlimit=7)
extractAIC(fit.2dl)

Run the code above in your browser using DataLab