Description Usage Arguments Value Examples
View source: R/rbase.curvedist.R
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.
1 | rbase.curvedist(curve1, curve2, t = NULL, type = c("intrinsic", "extrinsic"))
|
curve1 |
a S3 object of |
curve2 |
a S3 object of |
t |
a length-N vector of locations. If |
type |
type of Riemannian distance ( |
computed distance.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.