This version of the function is still being developed, and as such will almost certainly contain numerous bugs.  If you find one, or if you have any comments/criticisms/questions about the function, then please feel free to email me at matthew.denwood@glasgow.ac.uk  Thanks!


OPEN ISSUES


BUGS

None known.


FEATURES TO BE IMPLEMENTED

None planned.




VERSION HISTORY


Version 0.9.9  (sourceforge revision 19, date: 18/11/2010)

NEW FEATURES

The development version of runjags is now being hosted on sourceforge using svn

Setting a monitor of 'dic' now results in DIC calculations being returned (monitor 'deviance' can also be used as an alternative to monitor.deviance)

An 'xapply' function (convenience wrapper for xgrid.run) has been added

All feedback using cat now wraps to the screen width nicely

combine.mcmc (and therefore autorun.jags) now returns the exact number of iterations specified to return.samples rather than just the closest ceiling

The xgrid.results function can now return partially completed jobs

run.jags now checks that it is not being run on Xgrid to resolve a problem with the interruptible method when being run as 'nobody'

The parallel and xgrid JAGS methods now ensure that up to 4 chains have different RNG names and give a warning if more than 4 chains are used.  The issue of chain independence is discussed in the help files

The run.jags function now aborts if attempting to monitor DIC, pd, popt or pd.i with a single chain (or parallel or separate chains)

JAGS functions now return HPD intervals as well as summary statistics

Introduced a new autocorr.diag function which will be much faster for models with lots of monitored variables

Introduced the capability to specify R64 over R32 etc with Rbuild


BUG FIXES

A warning message about start values not being changed has been removed

The name of pd.i has been corrected on model outputs

Fixed scoping bug that could cause functions sent to Xgrid to fail to find variables that should be available

Bug preventing monitoring pd.i for large models fixed

Fixed a bug in autorun.jags which crashed the function if the time limit was exceeded

Bug fixed preventing tempdir=FALSE from working

Potential bug when attempting to parallelise chains in Windows fixed

Fixed an issue that could cause errors when normalising chains of less than 1000 iterations

Misuse of the Sys.which function corrected

Fixed issues with backslashes and over-writing global variables in Windows that could cause modules to fail to load

Improved error handling for potentially misconfigured JAGS installations

Many other miscellaneous code tweaks and bug fixes.



Version 0.9.7

NEW FEATURES

The object list supplied to xgrid.submit/xgrid.run can now be a character list, for which objects will be looked for in the global environment.

The 'cleanup' and 'keep files' options have been moved to the retrieving xgrid functions.  Options relating to processing the MCMC chains (such as convergence and plotting options) can now be provided to xgrid.results.jags.

Code for autorun.jags optimised in several places to speed up processing of large MCMC objects between runs.

Support for factories added.

Support for new popt/deviance/pd features of JAGS 2 added.

The number of variables is now displayed when calculating convergence statistics.

xgrid.results and xgrid.results.jags now display the output so far if the job isn't complete


BUG FIXES

Bug fixed that could cause the .jagsfile functions to not find objects correctly.

Bug fixed in autorun.jags preventing modules from being loaded

Bugs fixed that prevented errors being reported under Windows

Bug fixed in mgrid that prevented directory names with spaces being used.

Manual over-hauled to improve appearance and prevent truncation of examples on PDF version.

Bug fixed that could mistake error returns from mgrid/xgrid as job numbers

New examples added and some examples corrected.

Many other miscellaneous code tweaks and bug fixes.



Version 0.9.6

NEW FEATURES

There are new methods for calling JAGS under unix-alikes.  You can now specify 'interruptible' which allows JAGS to be fully interruptible using sigterm on the terminal/console, 'parallel' which runs each chain as a separate task, 'xgrid' which sends the JAGS call to an xgrid distributed computing cluster, or 'simple' which runs JAGS as a single process in the foreground (legacy behaviour and sole option on Windows).  The run.jags function now has the new arguments 'method' and 'xgrid.options' to control these settings.

There are also new functions for running JAGS models remotely on Apple Xgrid distributed computing clusters, as well as functions for running arbitrary code over Xgrid.  A BASH shell script called mgrid which extends the functionality of the base Apple Xgrid software is also now included, but needs to be installed manually if required.

The locally specified temporary directory is now used rather than the working directory if tmpdir=TRUE (default).  Any temporary files created are always deleted even if the process is killed by sigterm etc.

If keep.jags.files then the jags directory is copied to the working directory with a unique filename based on the name 'runjagsfiles'

In new_unique if the suffix supplied does not start with '.' one is now automatically prepended

(auto)run.jags can now take inits as named lists or a list of named lists

(auto)run.jags now returns a named list as end.state rather than a dump.format string

new_unique now has a touch option (default TRUE) which creates the named directory (if new option type=='d') or file (if type=='f)

/usr/local/bin/jags now examined for JAGS if popen=TRUE


BUG FIXES

The densityplot and traceplot returned by (auto)run.jags now only return one plot per variable, rather than two with one printed over the top of the other.  The 'plotindpages' class is also now documented in the help files for run.jags/autorun.jags under the values for trace and density.

Popen=TRUE is now more accurate for testjags

Bug fixed in read.winbugs that failed to identify separate variables specified on the same line

Many other miscellaneous code tweaks and bug fixes.



Version 0.9.5

NEW FEATURES

The default value of collapse.chains in the combine.mcmc function is now to automatically collapse the chains if a single mcmc object is provided, and not otherwise.

The data block returned by read.winbugs is now returned within a 'data{}' block for consistency with the model block.

Data blocks are now passed directly to JAGS rather than being interpreted to allow use of iterative loops etc.

The autorun.jags function now has a keep.jags.files option similar to run.jags.

The (auto)run.jagsfile and read.winbugs functions are now able to differentiate data that should be passed to jags in the model code from data that should be passed as data.  Substantial parts of the read.winbugs function were modified to achieve this, so some behaviours may be slightly different.  The relevant help files have also been updated.


BUG FIXES

The summary statistics returned by run.jags and autorun.jags now report the correct number of chains.

Bug fixed in run.jags that would cause an error when calculating summary statistics with only 1 chain

Citation information updated for compatibility with R version 2.10


Version 0.9.4

NEW FEATURES

dump.format now checks for '.RNG.name' and double quotes the value if not already double quoted

Help files updated to explain how to explicitly control the random number generators in JAGS


BUG FIXES

Hideous bug fixed in combine.mcmc that prevented 3 or more objects being combined correctly

timestring now rounds the time in seconds to 0.1 seconds (more consistent with other units)

Bug fixed in combine.mcmc that prevented thinning being applied correctly if the objects were already thinned; help page updated to better explain the results of thinning chains that are already thinned

Bug fixed that could cause autorun.jags to update only a small number of iterations to improve convergence if the model ran very slowly the first time

Bug fixed in find.parameters that could cause problems when an init/data list with more parameters than needed was provided

Bug fixed in find.parameters that could result in the output list being formatted wrongly causing dump.format to return an error

Bug fixed that could prevent re-use of existing chains in run.jags

Check added to make sure dev.new exists before calling it for compatibility with older (Linux) versions of R


Version 0.9.3

NEW FEATURES

Chains can now be combined using combine.mcmc (new option collapse.chains)

Thinning of chains in JAGS is now supported in autorun.jags and run.jags via a new thin option

autorun.jags and run.jags now also return a value for 'thin' representing the thin amount of the chains in JAGS

Usage of external JAGS modules is now supported, including the DIC module

New options for monitor.deviance, monitor.popt, and monitor.pd now available

Explanation for summary not calculated now returned when psrf not being calculated

autorun.jags now checks that there is sufficient memory available to store all values of an MCMC chain before calling the simulation

plot is now default TRUE in autorun.jags and run.jags

autorun.jags now thins chains before calculating summary statistics

New option for keeping MCMC files in run.jags added

The plots from autorun.jags and run.jags are now done using a print method which should be more efficient

Summary statistics are now taken from the combined chains


BUG FIXES

Fixed a bug causing convergence extensions to go beyond max.time in autorun.jags(file)

Commas added between 'seealso' items in help files

Fixed bug in autorun.jags that could cause a crash when the multivariate PRSF could not be calculated

Bugs preventing the correct value for jags being passed from autorun.jags to run.jags now fixed

Occasional bug in calculating the Gelman-Rubin statistic fixed

The required sample size is now calculated taking into account the number of chains correctly

Bug causing the calculated time remaining to be wrong when the simulation did not converge quickly now fixed


Version 0.9.2

NEW FEATURES

autorun.jags and run.jags now produce trace and density plots of all monitored variables (if plots==TRUE), which are returned as $trace[[variable]] and $density[[variable]]

Multiple model files or strings (or a mixture) can now be specified as a character vector to read.winbugs

User can now change options for the Raftery and Lewis diagnostic via 'raftery.options' for autorun.jags(file)

When a simulation is aborted due to crashes or unexpected results from autorun.jags(file), an error message is now printed as well as returned

combine.mcmc will now ignore a request to return more samples than provided rather than returning an error

combine.mcmc can now accept a single mcmc list or mcmc object to be thinned (or returned unchanged if thin=1)

autodata and autoinits can now be specified as a vector (or array) of missing data


BUG FIXES

Bug fixed that could result in chain values being returned as infinite causing an error with the gelman rubin statistic if normalise==TRUE

Bug fixed in combine.mcmc that resulted in mcmcchains with only 1 variable causing an error

Bug fixed that resulted in models being specified to (auto)run.jagsfile being ignored

Errors resulting from use of 'summary' in autorun.jags and run.jags now suppressed correctly

Efficiency of the normalise.mcmc function dramatically increased for chains with many variables

Time limit in autorun.jags now does not include time spent waiting for dialogs to be answered, and is only used for simulation extensions to improve convergence (simulation is always extended for sample size if necessary)

Bug fixed that could result in extended chains with non-stochastic monitored nodes causing an error in autorun.jags

Bug fixed that resulted in crashed datasets always causing autorun.jags to return an error

Bug fixed that prevented parameters specified as functions inside the datalist or initlist lists (or functions) being interpreted correctly


Version 0.9.1

NEW FEATURES

Number of failures to calculate the gelman-rubin statistic reduced by:
Checking for monitored variables that are not stochastic and remove from inclusion in gelman-rubin statistic
Option to improve normality of posterior distributions before estimating the gelman rubin statistic in run.jags and autorun.jags (normalise.mcmc option).
New function to catch instances where gelman.diag fails for multiple parameters and calcualte the psrf individually (without multivariate psrf)

autorun.jags and run.jags now returns 'psrf.target' as part of $psrf

psrf.target added as an option to run.jags the same as autorun.jags

NAMESPACE file used now

Output of read.winbugs is now consistent - if data or initial value blocks are not found their values are returned as NA

Warning that JAGS under Windows may be slower than Unix now removed


BUG FIXES

Bug fixed in combine.mcmc that could prevent thinning being performed as specified

Bug fixed in autorun.jags that resulted in the output chain being replicated and combined together

Bug fixed in run.jagsfile that caused problems when monitors weren't supplied in the model file

Typo fixed in run.jags that caused simulations with only 1 chain to print a converged message

Behaviour changed in run.jags so that a warning is printed if initial values are not the right length

Bug fixed in run.jagsfile (findparams) that caused data containing any missing data to not be found

autorun.jags now recalculates the gelman rubin statistic on the final chains and prints a warning if the chains have fallen out of convergence

Bug fixed in run.jags that caused issues with calculating the Gelman Rubin statistic when the number of expected monitored nodes was not equal to the number of actual monitored nodes

Bug fixed in autorun.jags and run.jags that caused the gelman rubin diagnostic to be calculated on the second half of the chain only

For run.jagsfile, when n.chains was not consistent with length of inits it was ignored.  Now the length of inits is altered to match n.chains, with a warning.

Bug fixed in new_unique that caused the counter to be added and not incremented if a file ending with '_1' existed already

Delay after reading coda files partially replaced with flush.console() for Windows/Aqua, and removed for other OS types

Bug fixed in autorun.jags that could produce a warning message if the chains were extended for convergence

Bug fixed in run.jags that resulted in an error if the convergence calculation failed

autorun.jags modified to attempt to reduce some of the strange errors and warnings sometimes encountered



Version 0.9.0

New to version 0.9; separated from bayescount to form 2 distinct packages.
For version history of the package before 0.9 see the version_history file for bayescount.