# \donttest{
# Example taken from https://arxiv.org/abs/2212.04797 .
data(phoneme)
# resampling the log-periodograms
# 12 sample covariances for each phoneme
# each estimated on 50 curves
set.seed(12345)
nsubsamples <- 12
n <- 50
gg <- unique(Phoneme)
nphonemes <- length(gg)
K <- n*nsubsamples*nphonemes
M <- NCOL(logPeriodogram)
Sigma <- array(dim=c(M, M, nphonemes*nsubsamples))
r <- 0
for (l in gg) {
for (i in 1:nsubsamples) {
r <- r+1
Sigma[,,r] <- cov(logPeriodogram[sample(which(Phoneme==l),n), ])
}
}
pca <- tangentPCA(Sigma, max.iter=3)
summary(pca)
plot(pca)
# See https://arxiv.org/abs/2212.04797 for the interpretation
# of the figure
pairs(pca$x[,1:5], col=rep(1:nphonemes, rep(nsubsamples, nphonemes)))
# }
Run the code above in your browser using DataLab