Learn R Programming

fda.usc (version 0.9.4)

depth.mode: Provides the depth measure (mode) for functional data

Description

The depth.mode function implements the modal depth that select the curve most densely surrounded by others as the deepest one. By default, the distance is calculated using metric.lp function.

Usage

depth.mode(fdataobj,trim=0.25,metric=metric.lp,h=0.15,scale=TRUE,
draw=FALSE,...)

Arguments

fdataobj
fdata class object.
trim
The alpha of the trimming.
h
Bandwidth, h>0.
metric
Metric function, by default metric.lp.
scale
=TRUE, scale the matrix, see scale.
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.
  • depDepth of each curve.
  • distDistance matrix between curves or functional data.

Details

The mode of a functional data will be the deepest curve.

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, 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. Cuevas A, Febrero M, Fraiman R. 2006. On the use of bootstrap for estimating functions with functional data. Computational Statistics and Data Analysis 51: 1063{-}1074.

See Also

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

Examples

Run this code
#Ex: CanadianWeather data
t=1:365
fdataobj<-fdata(t(CanadianWeather$dailyAv[,,1]),t)
#Modal Depth
out.mode=depth.mode(fdataobj)
out.mode2=depth.mode(fdataobj,trim=0.10,draw=TRUE)
out.mode3=depth.mode(fdataobj,metriC=semimetric.basis, draw=TRUE)
out.mode4=depth.mode(fdataobj,h=0.05, draw=TRUE)
plot(out.mode$mtrim)
lines(out.mode2$mtrim,col=2)
lines(out.mode3$mtrim,col=3)
lines(out.mode4$mtrim,col=4)

Run the code above in your browser using DataLab