riem.distlp | R Documentation |
Given two curves γ_1, γ_2 : I \rightarrow \mathcal{M}, 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.
riem.distlp( riemobj1, riemobj2, vect = NULL, geometry = c("intrinsic", "extrinsic"), ... )
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
|
the distance value.
Trapezoidal Approximation Assume γ_1 (t_i) = X_i and γ_2 (t_i) = Y_i for i=1,2,…,N. In the Euclidean space, L_p distance between two scalar-valued functions is defined as
L_p^p (γ_1 (x), γ_2 (x) = \int_{\mathcal{X}} |γ_1 (x) - γ_2 (x)|^p dx
. We extend this approach to manifold-valued curves
L_p^p (γ_1 (t), γ_2 (t)) = \int_{t\in I} d^p (γ_1 (t), γ_2 (t)) dt
where d(\cdot,\cdot) is an intrinsic/extrinsic distance on manifolds. With the given representations, the above integral is approximated using trapezoidal rule.
#------------------------------------------------------------------- # 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.