fda.usc (version 2.0.1)

depth.mfdata: Provides the depth measure for a list of p--functional data objects

Description

This function computes the depth measure for a list of p--functional data objects. The procedure extends the Fraiman and Muniz (FM), modal, and random project depth functions from 1 functional dataset to p functional datasets.

Usage

depth.modep(
  mfdata,
  mfdataref = mfdata,
  h = NULL,
  metric,
  par.metric = list(),
  method = "euclidean",
  scale = FALSE,
  trim = 0.25,
  draw = FALSE,
  ask = FALSE
)

depth.RPp( mfdata, mfdataref = mfdata, nproj = 50, proj = "vexponential", trim = 0.25, dfunc = "mdepth.TD", par.dfunc = list(scale = TRUE), draw = FALSE, ask = FALSE )

depth.FMp( mfdata, mfdataref = mfdata, trim = 0.25, dfunc = "mdepth.MhD", par.dfunc = list(scale = FALSE), draw = FALSE, ask = FALSE, ... )

Arguments

mfdata

A list of new curves (list of fdata ojects) to evaluate the depth.

mfdataref

A set of reference curves (list of fdata ojects) w.r.t. the depth of mfdata is computed.

h

Bandwidth, h>0. Default argument values are provided as the 15%--quantile of the distance between fdataobj and fdataori.

metric

Metric or semi--metric function used for compute the distance between each element in ldata w.r.t. ldataref, by default metric.lp.

par.metric

list of parameters for the metric function.

method

Type of the distance measure (by default euclidean) to compute the metric between the p-distance matrix computed from the p functional data elements.

scale

=TRUE, scale the depth.

trim

The alpha of the trimming.

draw

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

ask

logical. If TRUE (and the R session is interactive) the user is asked for input, before a new figure is drawn.

nproj

The number projection.

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.

dfunc

Type of multivariate depth (of order p) function used in Framiman and Muniz depth, depth.FMp or in Random Projection depth,depth.FMp: :

  • The mdepth.SD function provides the simplicial depth measure for bivariate data.

  • The mdepth.LD function provides the Likelihood depth measure based on Nadaraya--Watson estimator of empirical density function.

  • The mdepth.HS function implements a half-space depth measure based on random projections.

  • The mdepth.TD function implements a Tukey depth measure.

  • The mdepth.MhDfunction implements a Mahalanobis depth measure.

  • The mdepth.RP function provides the depth measure using random projections for multivariate data.

par.dfunc

list of parameters for the dfunc depth function, see Depth.Multivariate.

Further arguments passed to or from other methods.

Value

  • lmed Index deepest element median.

  • ltrim Index of curves with trimmed mean mtrim.

  • dep Depth of each curve of fdataobj w.r.t. fdataori.

  • dfunc second depth function used as multivariate depth, see details section.

  • par.dfunc list of parameters for the dfunc depth function.

  • proj The projection value of each point on the curves.

  • dist Distance matrix between curves or functional data.

Details

  • depth.FMp, this procedure suposes that each curve of the mfdataobj have the same support [0,T] (same argvals and rangeval). The FMp depth is defined as: \(FM_i^p =\int_{0}^{T}Z_i^p(t)dt\) where \(Z_i^p(t)\) is a \(p\)--variate depth of the vector \((x_i^1(t),\ldots,x_i^p(t))\) w.r.t. the sample at \(t\). derivatives. In this case,note solo un dato funcional se reduce depth.FM=depth.FM1

  • The depth.RPp function calculates the depth in two steps. It builds random projections for the each curve of the mfdata w.r.t. each curve of the mfdataref object. Then it applyes a multivariate depth function specified in dfunc argument to the set of random projections. This procedure is a generalization of Random Projection with derivatives (RPD) implemented in depth.RPD function. Now, the procedure computes a p-variate depth with the projections using the \(p\) functional dataset.

  • The modal depth depth.modep function calculates the depth in three steps. First, the function calculates a suitable metrics or semi--metrics \(m_1+\cdots+m_p\) for each curve of the mfdata w.r.t. each curve in the mfdataref object using the metric and par.metric arguments, see metric.lp or semimetric.NPFDA for more details. Second, the function uses the \(p\)--dimensional metrics to construct a new metric, specified in method argument, by default if method="euclidean", i.e. \(m:=\sqrt{m_1^2+\cdots+m_p^2}\). Finally, the empirical h--depth is computed as: $$\hat{f}_h(x_0)=N^{-1}\sum_{i=1}^{N}{K(m/h)}$$ where \(x\) is dataset with p observed fucntional data, \(m\) is a suitable metric or semi--metric, \(K(t)\) is an asymmetric kernel function and h is the bandwidth parameter.

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. 10: 419-440. 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 Descriptive.

Examples

Run this code
# NOT RUN {
data(tecator)
xx<-tecator$absorp
xx1<-fdata.deriv(xx,1)
lx<-list(xx=xx,xx=xx1)
# Fraiman-Muniz Depth
par.df<-list(scale =TRUE)
out.FM1p=depth.FMp(lx,trim=0.1,draw=TRUE, par.dfunc = par.df)
out.FM2p=depth.FMp(lx,trim=0.1,dfunc="mdepth.LD",
par.dfunc = par.df, draw=TRUE)

# Random Project Depth
out.RP1p=depth.RPp(lx,trim=0.1,dfunc="mdepth.TD",
draw=TRUE,par.dfunc = par.df)
out.RP2p=depth.RPp(lx,trim=0.1,dfunc="mdepth.LD",
draw=TRUE,par.dfunc = par.df)

#Modal Depth
out.mode1p=depth.modep(lx,trim=0.1,draw=T,scale=T)
out.mode2p=depth.modep(lx,trim=0.1,method="manhattan",
draw=T,scale=T)

par(mfrow=c(2,3))
plot(out.FM1p$dep,out.FM2p$dep)
plot(out.RP1p$dep,out.RP2p$dep)
plot(out.mode1p$dep,out.mode2p$dep)
plot(out.FM1p$dep,out.RP1p$dep)
plot(out.RP1p$dep,out.mode1p$dep)
plot(out.FM1p$dep,out.mode1p$dep)
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace