Description Usage Arguments Value Author(s) Examples

For manifold-valued data, Fréchet mean is the solution of following cost function,

*\textrm{min}_x ∑_{i=1}^n ρ^2 (x, x_i),\quad x\in\mathcal{M}*

for a given data *\{x_i\}_{i=1}^n* and *ρ(x,y)* is the geodesic distance
between two points on manifold *\mathcal{M}*. It uses a gradient descent method
with a backtracking search rule for updating.

1 |

`x` |
either an array of size |

`type` |
type of geometry, either |

`eps` |
stopping criterion for the norm of gradient. |

`parallel` |
a flag for enabling parallel computation with OpenMP. |

a named list containing

- mu
an estimated mean matrix for ONB of size

*(n\times k)*.- variation
Fréchet variation with the estimated mean.

Kisung You

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
## generate a dataset with two types of Grassmann elements
# first four columns of (8x8) identity matrix + noise
mydata = list()
sdval = 0.1
diag8 = diag(8)
for (i in 1:10){
mydata[[i]] = qr.Q(qr(diag8[,1:4] + matrix(rnorm(8*4,sd=sdval),ncol=4)))
}
## compute two types of means
mean.int = gr.mean(mydata, type="intrinsic")
mean.ext = gr.mean(mydata, type="extrinsic")
## visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,2))
image(mean.int$mu, main="intrinsic mean")
image(mean.ext$mu, main="extrinsic mean")
par(opar)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.