depth.fdata {fda.usc}R Documentation

Computation of depth measures for functional data

Description

Several depth measures can be computed for functional data for descriptive or classification purposes.

Usage

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

depth.RP(
  fdataobj,
  fdataori = fdataobj,
  trim = 0.25,
  nproj = 50,
  proj = "vexponential",
  dfunc = "TD1",
  par.dfunc = list(),
  scale = FALSE,
  draw = FALSE,
  ...
)

depth.RPD(
  fdataobj,
  fdataori = fdataobj,
  nproj = 20,
  proj = 1,
  deriv = c(0, 1),
  trim = 0.25,
  dfunc2 = mdepth.LD,
  method = "fmm",
  draw = FALSE,
  ...
)

depth.RT(
  fdataobj,
  fdataori = fdataobj,
  trim = 0.25,
  nproj = 10,
  proj = 1,
  xeps = 1e-07,
  draw = FALSE,
  ...
)

depth.KFSD(
  fdataobj,
  fdataori = fdataobj,
  trim = 0.25,
  h = NULL,
  scale = FALSE,
  draw = FALSE
)

depth.FSD(
  fdataobj,
  fdataori = fdataobj,
  trim = 0.25,
  scale = FALSE,
  draw = FALSE
)

depth.FM(
  fdataobj,
  fdataori = fdataobj,
  trim = 0.25,
  scale = FALSE,
  dfunc = "FM1",
  par.dfunc = list(scale = TRUE),
  draw = FALSE
)

Arguments

fdataobj

The set of new curves to evaluate the depth. fdata class object.

fdataori

The set of reference curves respect to which the depth is computed. fdata class object.

trim

The alpha of the trimming.

metric

Metric function, by default metric.lp. Distance matrix between fdataobj and fdataori.

h

Bandwidth parameter.

  • If h is a numerical value, the procedure considers the argument value as the bandwidth.

  • If is NULL (by default) the bandwidth is provided as the 15%–quantile of the distance among curves of fdataori.

  • If h is a character string (like "0.15"), the procedure reads the numeric value and consider it as the quantile of the distance in fdataori (as in the second case).

scale

=TRUE, the depth is scaled respect to depths in fdataori.

draw

=TRUE, draw the curves, the sample median and trimmed mean.

...

Further arguments passed to or from other methods. For depth.mode parameters for metric. For random projection depths, parameters to be included in rproc2fdata not included before.

nproj

The number of projections. Ignored if a fdata class object is provided in proj

proj

if a fdata class, projections provided by the user. Otherwise, it is the sigma parameter of rproc2fdata function.

dfunc

type of univariate depth function used inside depth function: "FM1" refers to the original Fraiman and Muniz univariate depth (default), "TD1" Tukey (Halfspace),"Liu1" for simplical depth, "LD1" for Likelihood depth and "MhD1" for Mahalanobis 1D depth. Also, any user function fulfilling the following pattern FUN.USER(x,xx,...) and returning a dep component can be included.f

par.dfunc

List of parameters for dfunc.

deriv

Number of derivatives described in integer vector deriv. =0 means no derivative.

dfunc2

Multivariate depth function (second step depth function) in RPD depth, by default mdepth.LD. Any user function with the pattern FUN.USER(x,xx,...) can be employed.

method

Type of derivative method. See fdata.deriv for more details.

xeps

Accuracy. The left limit of the empirical distribution function.

Details

Type of depth functions: Fraiman and Muniz (FM) depth, modal depth, random Tukey (RT), random projection (RP) depth and double random projection depth (RPD).

Value

Return a list with:

Author(s)

Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.oviedo@udc.es

References

Cuevas, A., Febrero-Bande, M., Fraiman, R. (2007). Robust estimation and classification for functional data via projection-based depth notions. Computational Statistics 22, 3, 481-496.

Fraiman R, Muniz G. (2001). Trimmed means for functional data. Test 10: 419-440.

Cuesta–Albertos, JA, Nieto–Reyes, A. (2008) The Random Tukey Depth. Computational Statistics and Data Analysis Vol. 52, Issue 11, 4979-4988.

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. https://www.jstatsoft.org/v51/i04/

Sguera C, Galeano P, Lillo R (2014). Spatial depth based classification for functional data. TEST 23(4):725–750.

See Also

See Also as Descriptive.

Examples

## Not run: 
#Ex: CanadianWeather data
tt=1:365
fdataobj<-fdata(t(CanadianWeather$dailyAv[,,1]),tt)
# Fraiman-Muniz Depth
out.FM=depth.FM(fdataobj,trim=0.1,draw=TRUE)
#Modal Depth
out.mode=depth.mode(fdataobj,trim=0.1,draw=TRUE)
out.RP=depth.RP(fdataobj,trim=0.1,draw=TRUE)
out.RT=depth.RT(fdataobj,trim=0.1,draw=TRUE)
out.FSD=depth.FSD(fdataobj,trim=0.1,draw=TRUE)
out.KFSD=depth.KFSD(fdataobj,trim=0.1,draw=TRUE)
## Double Random Projections
out.RPD=depth.RPD(fdataobj,deriv=c(0,1),dfunc2=mdepth.LD,
trim=0.1,draw=TRUE)
out<-c(out.FM$mtrim,out.mode$mtrim,out.RP$mtrim,out.RPD$mtrim)
plot(fdataobj,col="grey")
lines(out)
cdep<-cbind(out.FM$dep,out.mode$dep,out.RP$dep,out.RT$dep,out.FSD$dep,out.KFSD$dep)
colnames(cdep)<-c("FM","mode","RP","RT","FSD","KFSD")
pairs(cdep)
round(cor(cdep),2)

## End(Not run)


[Package fda.usc version 2.1.0 Index]