riem.distlp {Riemann} | R Documentation |
Distance between Two Curves on Manifolds
Description
Given two curves , we are
interested in measuring the discrepancy of two curves. Usually, data are given
as discrete observations so we are offering several methods to perform the task. See
the section below for detailed description.
Usage
riem.distlp(
riemobj1,
riemobj2,
vect = NULL,
geometry = c("intrinsic", "extrinsic"),
...
)
Arguments
riemobj1 |
a S3 |
riemobj2 |
a S3 |
vect |
a vector of domain values. If given |
geometry |
(case-insensitive) name of geometry; either geodesic ( |
... |
extra parameters including
|
Value
the distance value.
Default Method
Trapezoidal Approximation
Assume and
for
. In the Euclidean space,
distance between two
scalar-valued functions is defined as
. We extend this approach to manifold-valued curves
where is an intrinsic/extrinsic distance on manifolds. With the given
representations, the above integral is approximated using trapezoidal rule.
Examples
#-------------------------------------------------------------------
# Curves on Sphere
#
# curve1 : y = 0.5*cos(x) on the tangent space at (0,0,1)
# curve2 : y = 0.5*cos(x) on the tangent space at (0,0,1)
# curve3 : y = 0.5*sin(x) on the tangent space at (0,0,1)
#
# * distance between curve1 & curve2 should be close to 0.
# * distance between curve1 & curve3 should be large.
#-------------------------------------------------------------------
## GENERATION
vecx = seq(from=-0.9, to=0.9, length.out=50)
vecy1 = 0.5*cos(vecx) + rnorm(50, sd=0.05)
vecy2 = 0.5*cos(vecx) + rnorm(50, sd=0.05)
vecy3 = 0.5*sin(vecx) + rnorm(50, sd=0.05)
## WRAP AS RIEMOBJ
mat1 = cbind(vecx, vecy1, 1); mat1 = mat1/sqrt(rowSums(mat1^2))
mat2 = cbind(vecx, vecy2, 1); mat2 = mat2/sqrt(rowSums(mat2^2))
mat3 = cbind(vecx, vecy3, 1); mat3 = mat3/sqrt(rowSums(mat3^2))
rcurve1 = wrap.sphere(mat1)
rcurve2 = wrap.sphere(mat2)
rcurve3 = wrap.sphere(mat3)
## COMPUTE DISTANCES
riem.distlp(rcurve1, rcurve2, vect=vecx)
riem.distlp(rcurve1, rcurve3, vect=vecx)