[R] Generative Topographic Map

mauede at alice.it mauede at alice.it
Wed Mar 31 11:09:43 CEST 2010


I tried to use R version of package 
I noticed the original MatLab Pckage is much better documented. 
I had a look at the R demo code "gtm_demo" and found that variable Y is used in advanced of being created:
I wrote my own few lines as follows:
 inDir <-  "C:/Documents and Settings/Monville/Alanine Dipeptide/DBP1/DHA"

 setwd(inDir)
 T <- read.table("DHA_TNH.txt")  
 L <- 3
 X <- matrix(nrow=nrow(T),ncol=3,byrow=TRUE)
 MU <- matrix(nrow=round(nrow(T)/5), ncol=L)

 for(i in 1:ncol(X)) {
   for(j in 1:nrow(X)) {
      X[j,i] <- RANDU()
   }
 }

 for(i in 1:ncol(MU)) {
  for(j in 1:nrow(MU)) {
     MU[j,i] <- RANDU()
  }
 }
 sigma <-1

 FI <- gtm_gbf(MU,sigma,X)
 W <- gtm_ri(T,FI)
 Y= FI%*%W
 b = gtm_bi(Y)
 lambda <- 0.001
 for (m in 1:15) {
    trnResult = gtm_trn(T, FI, W, lambda, 1, b, 2,quiet = TRUE, minSing = 0.01)
    W = trnResult$W
    b = trnResult$beta
    Y = FI %*% W
 }

I ran the above script on my own data representing 1969 samples of 7 dihedral angles of a folding molecule (attached.
Upon running the 1st iteration of the training function "gtm_trn" I get the following error that I cannot interpret.
Any help and/or suggestion is welcome:

>  trnResult = gtm_trn(T, FI, W, lambda, 1, b, 2,quiet = TRUE, minSing = 1.)
Error in gtmGlobalR %*% T : 
  requires numeric/complex matrix/vector arguments
In addition: Warning messages:
1: In chol.default(A, pivot = TRUE) : matrix not positive definite
2: In gtm_trn(T, FI, W, lambda, 1, b, 2, quiet = TRUE, minSing = 1) :
  Using 7 out of 395 eigenvalues

Thank you in advance,
Maura





e tutti i telefonini TIM!
Vai su 


More information about the R-help mailing list