fda.usc (version 2.0.1)

classif.gkam: Classification Fitting Functional Generalized Kernel Additive Models

Description

Computes functional classification using functional explanatory variables using backfitting algorithm.

Usage

classif.gkam(
  formula,
  data,
  weights = "equal",
  family = binomial(),
  par.metric = NULL,
  par.np = NULL,
  offset = NULL,
  prob = 0.5,
  type = "1vsall",
  control = NULL,
  ...
)

Arguments

formula

an object of class formula (or one that can be coerced to that class): a symbolic description of the model to be fitted. The procedure only considers functional covariates (not implemented for non-functional covariates). The details of model specification are given under Details.

data

List that containing the variables in the model.

weights

Weights:

  • if character string ='equal' same weights for each observation (by default) and ='inverse' for inverse-probability of weighting.

  • if numeric vector of length n, Weight values of each observation.

family

a description of the error distribution and link function to be used in the model. This can be a character string naming a family function, a family function or the result of a call to a family function. (See family for details of family functions.)

par.metric

List of arguments by covariable to pass to the metric function by covariable.

par.np

List of arguments to pass to the fregre.np.cv function

offset

this can be used to specify an a priori known component to be included in the linear predictor during fitting.

prob

probability value used for binary discriminant.

type

If type is"1vsall" (by default) a maximum probability scheme is applied: requires G binary classifiers. If type is "majority" (only for multicalss classification G > 2) a voting scheme is applied: requires G (G - 1) / 2 binary classifiers.

control

a list of parameters for controlling the fitting process, by default: maxit, epsilon, trace and inverse.

Further arguments passed to or from other methods.

Value

Return gam object plus:

  • formula formula.

  • data List that containing the variables in the model.

  • group Factor of length n

  • group.est Estimated vector groups

  • prob.classification Probability of correct classification by group.

  • prob.group Matrix of predicted class probabilities. For each functional point shows the probability of each possible group membership.

  • max.prob Highest probability of correct classification.

Details

The first item in the data list is called "df" and is a data frame with the response, as glm. Functional covariates of class fdata are introduced in the following items in the data list.

References

Febrero-Bande M. and Gonzalez-Manteiga W. (2012). Generalized Additive Models for Functional Data. TEST. Springer-Velag. http://dx.doi.org/10.1007/s11749-012-0308-0

McCullagh and Nelder (1989), Generalized Linear Models 2nd ed. Chapman and Hall.

Opsomer J.D. and Ruppert D.(1997). Fitting a bivariate additive model by local polynomial regression.Annals of Statistics, 25, 186-211.

See Also

See Also as: fregre.gkam. Alternative method: classif.glm.

Examples

Run this code
# NOT RUN {
## Time-consuming: selection of 2 levels 
data(phoneme)
mlearn<-phoneme[["learn"]][1:150]
glearn<-factor(phoneme[["classlearn"]][1:150])
dataf<-data.frame(glearn)
dat=list("df"=dataf,"x"=mlearn)
a1<-classif.gkam(glearn~x,data=dat)
summary(a1)
mtest<-phoneme[["test"]][1:150]
gtest<-factor(phoneme[["classtest"]][1:150])
newdat<-list("x"=mtest)
p1<-predict(a1,newdat)
table(gtest,p1)
# }

Run the code above in your browser using DataCamp Workspace