# NOT RUN {
## Example
set.seed(1)
# Generate data 20 matrix that can be jointly diagonalized
d <- 10
A <- matrix(rnorm(d*d), d, d)
A <- A%*%t(A)
Rx <- lapply(1:20, function(x) A %*% diag(rnorm(d)) %*% t(A))
# Perform approximate joint diagonalization
ptm <- proc.time()
res <- uwedge(Rx,
return_diag=TRUE,
max_iter=1000)
print(proc.time()-ptm)
# Average value of offdiagonal elements:
print(res$meanoffdiag)
# }
Run the code above in your browser using DataLab