kmdepth.fd {bigdatadist}R Documentation

Kernel Mahalanobis Depth for Functional Data

Description

This function allows you to compute the Generalized Kernel Mahalanobis depth measure for a sample of functional data as stated in Hernandez et al (2018, submitted).

Usage

kmdepth.fd(fdframe, gamma = 1, kerfunc = "rbf" ,
                        kerpar = list(sigma = 1, bias = 0, degree = 2) ,
                        d = 2 , robust=TRUE , h=0.1 , nsamp=250)  

Arguments

fdframe

an fdframe object storing raw functional data.

gamma

regularization parameter.

kerfunc

kernel function to be used.

kerpar

a list of kernel parameters where sigma is the scale with both kernels.

d

truncation parameter in the Reproducing Kernel Hilbert Space representation.

robust

TRUE if the covariance matrix is estimated through Robust Maximum Likelihood method.

h

numeric parameter controlling the a-prioir precentage of outliers in the sample (value between 0 and 1, by def = 0.1).

nsamp

number of subsets used for initial estimates (by def = 250).

Value

depth

the kernel-mahalanobis depth measure for the curves in the sample.

Author(s)

Hernandez and Martos

References

Hernandez N. et al (2018, submitted). Generalized Mahalanobis depth functions.

Examples

data(Ausmale); t <- Ausmale[[1]]
t = as.numeric(( t - min(t) ) / length(t))
raw.data = fdframe(t=t, Y=Ausmale[[2]])

kmd.fit.fd = kmdepth.fd(raw.data, gamma = 0.0001, kerfunc = "rbf" ,
                        kerpar = list(sigma = 10) , d = 2 , robust=TRUE)  

kmd.fit.fd$depth

rbPal <- colorRampPalette(c('red','black'))
color = rbPal(5)[as.numeric(cut(kmd.fit.fd$depth,breaks = 5))]
plot(rkhs(raw.data,gamma=0.0001,kerfunc="rbf",kerpar=list(sigma = 10)),
 col = color, xlab='time',ylab='')

[Package bigdatadist version 1.1 Index]