## generate 3-dimensional normal data
X = matrix(rnorm(100*3), nrow=100)
## replicate 3 times with translations
Y = cbind(X-10,X,X+10)
## use PCA thresholding estimation with 95% variance explainability
## desired return is for dimension 3.
output = est.pcathr(Y)
pmessage = paste("* estimated dimension is ",output$estdim, sep="")
print(pmessage)
## use screeplot
opar <- par(no.readonly=TRUE)
plot(output$values, main="scree plot", type="b")
par(opar)
Run the code above in your browser using DataLab