Learn R Programming

kml3d (version 0.6)

dist3d: ~ Function: dist3d ~

Description

Compute the distante between two joint trajectories.

Usage

dist3d(x, y, method = "euclidian", power = 2)

Arguments

x
[matrix(numeric)]: first trajectory. The colomn are time, the line are variables.
y
[matrix(numeric)]: second trajectory. The colomn are time, the line are variables.
method
[character]: method used. Should be one of the method used by the function dist.
power
[numeric]: if method="minkowski", poweris the power used.

Value

  • A numeric

Author(s)

Christophe Genolini INSERM U669 / PSIGIAM: Paris Sud Innovation Group in Adolescent Mental Health Modal'X / Universite Paris Ouest-Nanterre- La Defense Contact author : genolini@u-paris10.fr

Details

Compute the distante between two joint trajectories, using one of the distance define by dist.

References

Article "KmL: K-means for Longitudinal Data", in Computational Statistics, Volume 25, Issue 2 (2010), Page 317. Web site: http://christophe.genolini.free.fr/kml

Examples

Run this code
### Generate artificial data
  myCld <- gald()

  ### Distance between individual 1 and 3 (there are in the same group)
  dist3d(myCld['traj'][1,,],myCld['traj'][3,,])

  ### Distance between individual 1 and 51 (there are in two different groups)
  dist3d(myCld['traj'][1,,],myCld['traj'][51,,])

Run the code above in your browser using DataLab