# NOT RUN {
set.seed(2020)
N<-20
supp.size<-10^2
L<-sqrt(supp.size)
d<-2
data.list<-vector("list",N)
image.list<-vector("list",N)
for (i in 1:N){
t.vec<-seq(0,2*pi,length.out=supp.size)
pos<-cbind(cos(t.vec)*runif(1,0.2,1),sin(t.vec)*runif(1,0.2,1))
theta<-runif(1,0,2*pi)
rotation<-matrix(c(cos(theta),sin(theta),-1*sin(theta),cos(theta)),2,2)
pos<-pos%*%rotation
pos<-pos+1
pos<-pos/2
W<-rep(1/supp.size,supp.size)
data.list[[i]]<-transport::wpp(pos,W)
}
res1<-wasserstein_bary(data.list,return_type = "wpp",method="alternating",
supp.size = supp.size,warmstartlength = 2,pos_maxIter = 50,
weights_maxIter = 0,maxIter = 1,stepsize=1)
pcomps<-ws_logpca(data.list,res1,3)
## Set the image and/or gif flags to TRUE to run the example.
## CRAN policy prevents examples from generating files in the working directory,
## so this had to be disabled.
plotGeodesic(pcomps$components[[1]],File="PCA1",images=FALSE,gif=FALSE)
plotGeodesic(pcomps$components[[2]],File="PCA2",images=FALSE,gif=FALSE)
plotGeodesic(pcomps$components[[3]],File="PCA3",images=FALSE,gif=FALSE)
# }
Run the code above in your browser using DataLab