energyDistance: Energy distance between two datasets

Description Usage Arguments Value References Examples

Description

Estimate energy distance which is a metric that measures the distance between the distributions of random vectors \insertCiterizzo-szekely10changedetection. The energy distance is zero if an only if the distributions are identical, otherwise it will diverge.

Usage

1
energyDistance(x1, y1, x2, y2, l = NULL, alpha = 1)

Arguments

x1

matrix of first period regressors with variables in columns and observations in rows

y1

matrix of first period responses with variables in columns and observations in rows

x2

matrix of second period regressors with variables in columns and observations in rows

y2

matrix of second period responses with variables in columns and observations in rows

l

approximate number of contributing variables (default: overall number of regressors)

alpha

parameter for energy distance formula (default: '1')

Value

energy distance value

References

\insertAllCited

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
T<-60
change<-35
x<-rnorm(n=T, m=0, sd=1)
e<-scale(rt(n=T,3), scale=FALSE)
y1<-5*x[1:(change-1)]+e[1:(change-1)]
y2<--2*x[change:T]+e[change:T]
y<-c(y1,y2)

ed <- energyDistance(x1=as.data.frame(x[1:30]),
                     y1=as.data.frame(y[1:30]),
                     x2=as.data.frame(x[31:T]),
                     y2=as.data.frame(y[31:T]))

changedetection documentation built on June 17, 2019, 5:03 p.m.