rbase.curvedist: Distance between Two Curves with Finite Difference...

Description Usage Arguments Value Examples

View source: R/rbase.curvedist.R

Description

Suppose we have to two curves f,g:I\subset \mathbf{R} \rightarrow \mathcal{M} evaluated at finite locations t_0 ≤ … ≤ t_N, rbase.curvedist computes distance between two curves f and g using finite difference approximation with trapezoidal rule. In order to induce no interpolation, two curves should be of same length.

Usage

1
rbase.curvedist(curve1, curve2, t = NULL, type = c("intrinsic", "extrinsic"))

Arguments

curve1

a S3 object of riemdata class, whose $data element is of length N.

curve2

a S3 object of riemdata class, whose $data element is of length N.

t

a length-N vector of locations. If NULL is given, it uses a equidistanct sequence from 1 to N.

type

type of Riemannian distance ("intrinsic" or "extrnisic").

Value

computed distance.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
### Generate two sets of 10 2-frames in R^4 : as grassmann points
ndata = 10
data1 = array(0,c(4,2,ndata))
data2 = array(0,c(4,2,ndata))
for (i in 1:ndata){
  tgt = matrix(rnorm(4*4),nrow=4)
  data1[,,i] = qr.Q(qr(tgt))[,1:2]
}
for (i in 1:ndata){
  tgt = matrix(rnorm(4*5, sd=2),nrow=4)
  data2[,,i] = qr.Q(qr(tgt))[,1:2]
}

gdata1 = riemfactory(data1, name="grassmann") # wrap as 'riemdata' class.
gdata2 = riemfactory(data2, name="grassmann")

rbase.curvedist(gdata1, gdata2)

## End(Not run)

kisungyou/RiemBase documentation built on Aug. 23, 2021, 5:12 a.m.