From: Gregor G. <gre...@bf...> - 2007-04-19 10:56:25
|
Hi, In my opinion Dawn's change make sense also for R side. Does anyone have any objection for not porting this also to R side? Gregor -------- Original Message -------- Subject: [Bugs-r-devel] SF.net SVN: bugs-r: [12] trunk/R2WinBUGS/R/bugs.script.R Date: Tue, 17 Apr 2007 07:21:52 -0700 From: woo...@us... To: bug...@li... Revision: 12 http://svn.sourceforge.net/bugs-r/?rev=12&view=rev Author: woodard_ Date: 2007-04-17 07:21:52 -0700 (Tue, 17 Apr 2007) Log Message: ----------- In S-PLUS, the handling of the thinning is done differently than in R. bin represents the number of iterations between saves, before thinning, where in R it is the number of iterations between saves, after thinning. This alternative handling of the thinning is done so that the resulting samples have the correct iteration indexes in the output (coda) files. Therefore, if the samples are read into S-PLUS using the coda package, the thinning will be correctly labelled in the resulting mcmc object. In R, the thinning is always labelled as 1, even if thinning was done. Modified Paths: -------------- trunk/R2WinBUGS/R/bugs.script.R Modified: trunk/R2WinBUGS/R/bugs.script.R =================================================================== --- trunk/R2WinBUGS/R/bugs.script.R 2007-04-16 11:21:38 UTC (rev 11) +++ trunk/R2WinBUGS/R/bugs.script.R 2007-04-17 14:21:52 UTC (rev 12) @@ -21,6 +21,24 @@ initlist <- paste("inits (", 1:n.chains, ", '", inits, "')\n", sep="") savelist <- paste("set (", parameters.to.save, ")\n", sep="") redo <- ceiling((n.iter-n.burnin)/(n.thin*bin)) + + if (is.R()){ + thinUpdateCommand <- paste("thin.updater (", n.thin, ")\n", + "update (", ceiling(n.burnin/n.thin), ")\n", sep = "") + } else{ ... + thinUpdateCommand <- paste("update (", n.burnin, ")\n", + "thin.samples (", n.thin, ")\n", sep = "") + bin = bin * n.thin + } + cat( "display ('log')\n", "check ('", native2win(model), "')\n", @@ -28,8 +46,7 @@ "compile (", n.chains, ")\n", if(is.inits) initlist, "gen.inits()\n", - "thin.updater (", n.thin, ")\n", - "update (", ceiling(n.burnin/n.thin), ")\n", + thinUpdateCommand, savelist, if(DIC) "dic.set()\n", rep( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Bugs-r-devel mailing list Bug...@li... https://lists.sourceforge.net/lists/listinfo/bugs-r-devel -- Lep pozdrav / With regards, Gregor Gorjanc ---------------------------------------------------------------------- University of Ljubljana PhD student Biotechnical Faculty www: http://www.bfro.uni-lj.si/MR/ggorjan Zootechnical Department blog: http://ggorjan.blogspot.com Groblje 3 mail: gregor.gorjanc <at> bfro.uni-lj.si SI-1230 Domzale fax: +386 (0)1 72 17 888 Slovenia, Europe tel: +386 (0)1 72 17 861 ---------------------------------------------------------------------- |