Learn R Programming

fda.usc (version 0.9.4)

depth.RP: Provides the depth measure using random projections for functional data

Description

The depth.RP function implements a depth measure based on random projections.

Usage

depth.RP(fdataobj,trim=0.25,nproj=50,xeps=0.0000001,draw=FALSE,...)

Arguments

fdataobj
fdata class object.
trim
The alpha of the trimming.
nproj
The number projection.
xeps
Accuracy. The left limit of the empirical distribution function.
draw
=TRUE, draw the curves, the sample median and trimmed mean.
...
Further arguments passed to or from other methods.

Value

  • medianDeepest curve.
  • lmedIndex deepest element median.
  • mtrimcode{fdata} class object with the average from the (1-trim)% deepest curves.
  • ltrimIndex of curves with trimmed mean mtrim.
  • depDepth of each curve.
  • projThe projection value of each point on the curves.

Details

It builds random projections and calculates the functional depth by the Tukey method combining the information of all projections..

References

Cuevas, A., Febrero-Bande, M. and Fraiman, R. (2007). Robust estimation and classification for functional data via projection-based depth notions. Computational Statistics 22, 3, 481{-}496. Febrero-Bande, M., Galeano, P., and Gonzalez-Manteiga, W. (2008). Outlier detection in functional data by depth measures with application to identify abnormal NOx levels. Environmetrics 19, 4, 331{-}345. J. A. Cuesta-Albertos, R. Fraiman and T. Ransford. Random projections and goodness-of-fit tests in infinite-dimensional spaces. Boletim da Sociedade Brasileira de Matematica (2006), 37(4), 1{-}25.

See Also

See Also as depth.RPD, depth.FM or depth.mode.

Examples

Run this code
#Ex: CanadianWeather data
fdataobj<-fdata(t(CanadianWeather$dailyAv[,,1]))

# Random Projections
t=1:365
out.RP=depth.RP(fdataobj,draw=TRUE)
out.RP2=depth.RP(fdataobj,trim=0.1,draw=TRUE)
out.RP3=depth.RP(fdataobj,nproj=5,draw=TRUE)
out.RP4=depth.RP(fdataobj,nproj=30,draw=TRUE)
plot(out.RP$mtrim,type="l",lwd=2)
lines(out.RP2$mtrim,col=2,lwd=2,lty=2)
lines(out.RP3$mtrim,col=3,lwd=2,lty=3)
lines(out.RP4$mtrim,col=4,lwd=2,lty=4)

Run the code above in your browser using DataLab