#### analysis for means data Y[,,1]<-Y[,,1]-mean(Y[,,1]) Y[,,2]<-Y[,,2]-mean(Y[,,2]) m<-dim(Y) K<-length(m) par(mfrow=c(3,2)) for(k in 1:K) { d<-svd(mat(Y,k))$d plot(d,type="h",ylim=c(0,max(d))) } r<-rep(2,K) hYa<-US.als(Y,r) par(mfrow=c(3,2)) plotwtxt(hYa$U[[1]],labels=dimnames(Y)[[1]]) plotwtxt(hYa$U[[2]],labels=dimnames(Y)[[2]]) plotwtxt(hYa$U[[3]],labels=dimnames(Y)[[3]]) plotwtxt(hYa$U[[4]],labels=dimnames(Y)[[4]]) plotwtxt(hYa$U[[5]],labels=dimnames(Y)[[5]]) ## does changing the rank for one mode affect the SVs of another? ## (a) truncated svd ## (b) ols/als