MFHD: Multivariate functional halfspace depth and median for...

Description Usage Arguments Value Author(s) References Examples

View source: R/MFHD.R

Description

MFHD calculates the MFHD depth and MFHD median for two-dimensional functional data. Additionally MFHD computes for every curve at every time point whether or not it is outlying, based on the bivariate bagplot.

Usage

1
  MFHD(y1,y2,alpha=0.125,Beta=0.5,Time=NULL)

Arguments

y1

first set of n functional curves, matrix with T columns.

y2

second set of curves (in particular, y2 can be the derivative of y1).

alpha

the level of the depth regions used for the computation of the weights: This value should be smaller than the maximal halfspace depth at any time point, divided by n. Default is 0.125. alpha=NULL defaults to uniform weights for all cross-sections.

Beta

beta-value for the dispersion curve. Should be between 0 and 1. Default is 0.50.

Time

If the measurements are not equidistant, a sorted numeric vector containing a set of time points. Default to NULL in which case it is ignored.

Value

A list with the following components:

MFHDdepth

n-vector containing the MFHD depth of every curve.

MFHDmedian

2 by T-vector of MFHD median.

weights

T-vector of MFHD weights (used in the definition of the MFHD depth).

disp

(2xT)-vector of dispersion curves (of level Beta) for y1 and y2.

loc.outl

n by T matrix of flags (takes value 1 if curve i is outlying at time point j).

Author(s)

M. Hubert, K. Vakili.

References

Claeskens, G., Hubert, M., Slaets, L. and Vakili, K. (2013) "Multivariate Functional Halfspace Depth", Journal of the American Statistical Association, in press.

Examples

1
2
3
4
5
6
7
8
set.seed(123)
n<-30;
T<-60;
t.<-seq(0,2*pi,l=T)
y1<-matrix(NA,n,T)
for(i in 1:n) y1[i,]<-loess((1/2*sin(t.)+3/2*cos(t.)+rnorm(T))~I(1:T),span=1/4)$fitted
y2<-derivcurves(y1)
results<-MFHD(y1=y1,y2=y2,alpha=0.125,Beta=0.5) 

Example output

Loading required package: fda.usc
Loading required package: fda
Loading required package: splines
Loading required package: Matrix

Attaching package: 'fda'

The following object is masked from 'package:graphics':

    matplot

Loading required package: MASS
Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-28. For overview type 'help("mgcv-package")'.
Loading required package: rpart
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 

     PLEASE NOTE:  The components "delsgs" and "summary" of the
 object returned by deldir() are now DATA FRAMES rather than
 matrices (as they were prior to release 0.0-18).
 See help("deldir").
 
     PLEASE NOTE: The process that deldir() uses for determining
 duplicated points has changed from that used in version
 0.0-9 of this package (and previously). See help("deldir").

MFHD documentation built on May 2, 2019, 3:24 a.m.