Learn R Programming

fda.usc (version 1.0.0)

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,fdataori=fdataobj,nproj=50,proj=1,deriv=c(0,1),trim=0.25,
dfunc2=depth.mode,method="fmm",draw=FALSE,...)

Arguments

fdataobj
A set of new curves to evaluate the depth. fdata class object.
fdataori
A set of original curves where the depth is computed. fdata class object.
nproj
Number of random projection.
deriv
Number of derivatives described in integer vector deriv. =0 means no derivative.
proj
if is a character: create the random projection using a covariance matrix by process indicated in the argument (by default, proj=1, sigma=diag(ncol(fdataobj))), else if is a matrix of random projection provided by the user.
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.
  • mtrimfdata 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. Febrero-Bande, M., Oviedo de la Fuente, M. (2012). Statistical Computing in Functional Data Analysis: The R Package fda.usc. Journal of Statistical Software, 51(4), 1-28. http://www.jstatsoft.org/v51/i04/

See Also

See Also as depth.RP, depth.FM and depth.mode.

Examples

Run this code
## Not run
## Double Random Projections in CanadianWeather data
 
# fdataobj<-fdata(t(CanadianWeather$dailyAv[,,1]))
# t=1:365
# 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.mode,draw=TRUE,
# method="fmm")
# out.RPD3=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)

Run the code above in your browser using DataLab