gmdepth.fd {bigdatadist}R Documentation

Generalized Mahalanobis Kernel Depth and Distance for Functional Data

Description

This function allows you to compute the Generalized Kernel Mahalanobis depth measure as stated in Hernandez et al (2018, submitted) and the Generalized Mahalanobis distance in Martos et al (2014), for functional data represented in a Reproducing Kernel Hilbert Space.

Usage

gmdepth.fd(fdframe, gamma = 1,kerfunc="rbf" , 
   kerpar=list(sigma=1,bias=0,degree=2),d=2,resol,k.neighbor)

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.

resol

resolution level to estimate the generalized Mahalanobis distance.

k.neighbor

number of neighbours to estimate the support of the disitribution.

Value

depth

the generalized Mahalanobis depth measure for the curves in the sample.

distance

the generalized Mahalanobis distance for the curves in the sample.

Author(s)

Hernandez and Martos

References

Hernandez N. et al (2018, submitted). Generalized Mahalanobis depth functions. Martos, G. et al (2014). Generalizing the Mahalanobis distance via density kernels. Inteligent Data Anal.

Examples

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

gmd.fit.fd = gmdepth.fd(raw.data,gamma=0.001,
            kerfunc="rbf",kerpar=list(sigma = 10))

gmd.fit.fd$distance
gmd.fit.fd$depth

rbPal <- colorRampPalette(c('red','black'))
color = rbPal(5)[as.numeric(cut(gmd.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]