[adegenet-commits] r319 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu May 21 20:21:35 CEST 2009


Author: jombart
Date: 2009-05-21 20:21:35 +0200 (Thu, 21 May 2009)
New Revision: 319

Modified:
   pkg/R/seqTrack.R
Log:
Small fixes. Seems to run quite well.


Modified: pkg/R/seqTrack.R
===================================================================
--- pkg/R/seqTrack.R	2009-05-21 18:16:56 UTC (rev 318)
+++ pkg/R/seqTrack.R	2009-05-21 18:21:35 UTC (rev 319)
@@ -320,7 +320,7 @@
 ## optimize.seqTrack
 #####################
 optimize.seqTrack <- function(nsim, seq.names, seq.dates, W, optim=c("min","max"),
-                              proxMat=NULL, mu0, seq.length, p=0.99, ...){
+                              proxMat=NULL, mu0, seq.length, ...){
 
     ## CHECKS ##
     optim <- match.arg(optim)
@@ -415,13 +415,13 @@
     ## and allows not to handle huge objects
     ## (which would grow exponentially)
 
-    res.best <- res.cur # initialization
+    res.best <- res.ini # initialization
     valRes <- numeric(nsim)
 
     for(i in 1:nsim){
-        myDates <- .rTimeSeq(n=NB.DATES.TO.SIM, mu0=mu0, L=seq.length, maxNbDays=2*RANGE.DATES)
+        myDates <- seq.dates + .rTimeSeq(n=NB.DATES.TO.SIM, mu0=mu0, L=seq.length, maxNbDays=2*RANGE.DATES)
         res.new <- seqTrack(seq.names=seq.names, seq.dates=myDates, W=W, optim=optim, proxMat=proxMat, ...)
-        valRes[i] <- sum(res.new$weight)
+        valRes[i] <- sum(res.new$weight,na.rm=TRUE)
         if(use.new.res(res.best, res.new)){
             res.best <- res.new
         }



More information about the adegenet-commits mailing list