Learn R Programming

fda.usc (version 0.9.4)

depth.RPD: Provides the depth measure by random projections using derivatives

Description

The depth.RPD function implements a depth measure based on random projections and using several derivatives.

Usage

depth.RPD(fdataobj,nproj=50,deriv=c(0,1),trim=0.25,
dfunc2=depth.mode,method="fmm",draw=FALSE,...)

Arguments

fdataobj
fdata class object.
nproj
Number of random projection.
deriv
Number of derivatives described in integer vector deriv. =0 means no derivative.
trim
The alpha of the trimming.
dfunc2
by default, depth.mode.
method
Type of derivative method. See fdata.deriv for more details.
draw
=TRUE, draw the curves, the sample median and the 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.
  • depDepth of each curve.
  • projThe projection value of each point on the curves.

Details

Calculate the depth in two steps. It builds random projections for the funcion and their derivatives (indicated in the parameter deriv) without looking at the functional data . Then it applyes a depth function (by default depth.mode) to the set of random projections created for calculate the functional depth by the Tukey method.

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.RP, depth.FM and depth.mode.

Examples

Run this code
#Ex: CanadianWeather data
fdataobj<-fdata(t(CanadianWeather$dailyAv[,,1]))
t=1:365
# Double Random Projections
out.RPD=depth.RPD(fdataobj,deriv=c(0,1),dfunc2=depth.RP,draw=TRUE)
out.RPD2=depth.RPD(fdataobj,deriv=c(0,1),dfunc2=depth.RP,trim=0.1)
out.RPD3=depth.RPD(fdataobj,deriv=c(0,1),dfunc2=depth.mode,draw=TRUE,
method="fmm")
out.RPD4=depth.RPD(fdataobj,deriv=c(0,1),dfunc2=depth.FM,draw=TRUE,
method="fmm")

plot(out.RPD$mtrim,type="l",lwd=2)
lines(out.RPD2$mtrim,col=2,lwd=2,lty=2)
lines(out.RPD3$mtrim,col=3,lwd=2,lty=3)
lines(out.RPD4$mtrim,col=4,lwd=2,lty=4)

Run the code above in your browser using DataLab