#compositional analysis library(compositions) x<-c(.1,.5,.4) V<-t(ilrBase(x)) D<-rbind(c(1,0,-1),c(0,1,-1)) x_alr<-D%*%log(x) x_ilr<-V%*%log(x) x_alr alr(x) x_ilr ilr(x,t(V)) #matrix to convert ilr to alr directly A<-D%*%t(V) #is A invertible? det(A) #should be nonzero x_alr2<-A%*%x_ilr