Learn R Programming

fda.usc (version 1.2.3)

classif.gkam: Classification Fitting Functional Generalized Kernel Additive Models

Description

Computes functional classification using functional explanatory variables using backfitting algorithm.

Usage

classif.gkam(formula,family = binomial(),data,weights = rep(1, nobs),
 par.metric = NULL,par.np=NULL, offset=NULL,
 control = list(maxit = 100,epsilon = 0.001, trace = FALSE ,
 inverse="solve"),...)

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
data
List that containing the variables in the model.
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
weights
weights
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.
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:
  • formulaformula.
  • dataList that containing the variables in the model.
  • groupFactor of length n
  • group.estEstimated vector groups
  • prob.classificationProbability of correct classification by group.
  • prob.groupMatrix of predicted class probabilities. For each functional point shows the probability of each possible group membership.

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
## Time-consuming: selection of 2 levels 
 data(phoneme)
 mlearn<-phoneme[["learn"]][1:100]
 glearn<-as.numeric(phoneme[["classlearn"]][1:100])
 dataf<-data.frame(glearn)
 dat=list("df"=dataf,"x"=mlearn)
# a1<-classif.gkam(glearn~x,data=dat)
# summary(a1)
 mtest<-phoneme[["test"]][1:100]
 gtest<-as.numeric(phoneme[["classtest"]][1:100])
 newdat<-list("x"=mtest)
# p1<-predict.classif(a1,newdat)
# table(gtest,p1)

Run the code above in your browser using DataLab