pdMean
calculates an (approximate) weighted Karcher or Frechet mean of a sample of
pdMean(M, w, metric = "Riemannian", grad_desc = FALSE, maxit = 1000,
reltol)
a
an sum(w) = 1
.
the distance measure, one of 'Riemannian'
, 'logEuclidean'
,
'Cholesky'
, 'Euclidean'
or 'rootEuclidean'
. Defaults to 'Riemannian'
.
if metric = "Riemannian"
, a logical value indicating if the
gradient descent algorithm in P06pdSpecEst should be used, defaults to FALSE
.
maximum number of iterations in gradient descent algorithm, only used if
grad_desc = TRUE
and metric = "Riemannian"
. Defaults to 1000
optional tolerance parameter in gradient descent algorithm, only used if
grad_desc = TRUE
and metric = "Riemannian"
. Defaults to 1E-10
.
# NOT RUN {
## Generate random sample of HPD matrices
m <- function(){
X <- matrix(complex(real=rnorm(9), imaginary=rnorm(9)), nrow=3)
t(Conj(X)) %*% X
}
M <- replicate(100, m())
z <- rnorm(100)
## Generate random weight vector
w <- abs(z)/sum(abs(z))
## Compute weighted (Riemannian) Karcher mean
pdMean(M, w)
# }
Run the code above in your browser using DataLab