predict.FuNopaCl: Nonparametric Classification for Functional Data

Description Usage Arguments Value Author(s) References See Also Examples

Description

predict.FuNopaCl is a function for predictions from the result of nonparametric modell fitting.

Usage

1
2
## S3 method for class 'FuNopaCl'
predict(object, newdata,  ...)

Arguments

object

Afitted object of class inheriting from FuNopaCl

newdata

Matrix with the functional data (curves) each row one for prediction

...

further arguments passed to or from other methods

Value

FuNopaCl returns an object of the class FuNopaCl; additional with the predictions of the classes in the vector Prediction.

Author(s)

Simon Mueller simon.mueller@mathematik.uni-stuttgart.de

References

Ferraty, F. and Vieu, P. Nonparametric Functional Data Analysis. Springer 2006.

See Also

Semimetric

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# functional datasets
require (fds)

# fat spectrum dataset
Y <- Fatvalues
X <- t(Fatspectrum$y)
Y[Y < 20] <- 1
Y[Y >= 20] <- 2

# setup semimetric params
semimetric.params <- c()
semimetric.params$q <- 2
semimetric.params$nknot  <- 20
semimetric.params$range.grid  <- c (min (Fatspectrum$x), 
                                    max (Fatspectrum$x))
# learn and testsample
learn <- 1:160
test <- 161:215

# parameter estimation and prediction by cross-validation
Learn.Fat <- FuNopaCl (X[learn, ], 
                       Y[learn], 
                       semimetric = "Deriv", 
                       semimetric.params)
                          
Predict.Fat <- predict (Learn.Fat, 
                        X[test, ])

mean (Predict.Fat$classes.pred != Y[161:215])                          

sipemu/Nonparametric-Functional-Data-Analysis documentation built on May 29, 2019, 10:10 p.m.