library(fastICA) lf = matrix(scan("http://civil.colorado.edu/~balajir/CVEN6833/R-sessions/session4/LeesFerry-monflows-1906-2006.txt"), ncol=13, byrow=T) year = lf[,1] lf = lf[,2:13] lf = lf*0.0004690502 # convert to cms lfann = apply(lf,1,sum) lfscale = scale(lf,scale=FALSE) K = dim(lfscale)[2] # number of ICA components to obtain zout = fastICA(lfscale,K) ### zout$X will be equal to lfscale ## zout$X = zout$S %*% zout$A ### zout$S are the ICs ### zout$W = inverst(zout$A %*% zout$K) ### zout$K = V in the paper. ### Simulate.. nd = dim(lfscale)[2] N = dim(lfscale)[1] xsim = lfscale for(i in 1:nd){ xsim[,i]=sample(zout$S[,i],N,replace=TRUE) } xsim1 = xsim %*% zout$A ## generate a number of simulations - use your other codes to compute statistics and ### boxplots