Learn R Programming

fdasrvf (version 2.5.0)

elastic.distance: Calculates two elastic distance

Description

This functions calculates the distances between functions in \(R^1\) \(D_y\) and \(D_x\), where function 2 is aligned to function 1

Usage

elastic.distance(f1, f2, time, lambda = 0, pen = "roughness")

Value

Returns a list containing

Dy

amplitude distance

Dx

phase distance

Arguments

f1

sample function 1, provided as a vector of length \(M\)

f2

sample function 2, provided as a vector of length \(M\)

time

sample points of functions, provided as a vector of length \(M\)

lambda

controls amount of warping (default = 0)

pen

alignment penalty (default = "roughness") options are second derivative ("roughness"), \(L^2\) distance of the warping function from id ("l2gam"), \(L^2\) distance of the SRVF of the warping function from that of id ("l2psi"), geodesic distance from id ("geodesic"), and no penalty ("none"). "norm" is kept for backward compatibility as an alias for "l2gam". The penalty is weighted by lambda, so it has no effect when lambda = 0.

References

Srivastava, A., Wu, W., Kurtek, S., Klassen, E., Marron, J. S., May 2011. Registration of functional data using fisher-rao metric, arXiv:1103.3817v2.

Tucker, J. D., Wu, W., Srivastava, A., Generative Models for Function Data using Phase and Amplitude Separation, Computational Statistics and Data Analysis (2012), 10.1016/j.csda.2012.12.001.

Examples

Run this code
distances <- elastic.distance(
  f1 = simu_data$f[, 1],
  f2 = simu_data$f[, 2],
  time = simu_data$time
)

Run the code above in your browser using DataLab