Compute full season baseball stats given year-to-date stats.

bugs.ver can be used to set the location of the OpenBUGS program.  As of 3/25/2012, this function has been disabled.  Right now, JM cannot think of a reason for wanting version 3.1.2, but it is possible that there was a reason that has now been forgotten.  If so, you can download and install OpenBUGS version 3.1.2, and reactivate the bugs.ver function by editing it.

As of 4/4/2011, the possible versions are 3.1.2 and 3.2.1. 

if (ver == "3.1.2" | ver == "312" | ver == 312)
bugs.program = "C:/Program Files/OpenBUGS/OpenBUGS312/OpenBUGS.exe"

if (ver == "3.2.1" | ver == "321" | ver == 321)
bugs.program = "C:/Program Files/OpenBUGS/OpenBUGS321/OpenBUGS.exe"

UNFINISHED (5/30/2013): bugsArgs computes the values of nChains, nIter, nThin and nTotalSamples from a subset of these values.  

nChains:  The number of chains.

nIter:  The number of samples per chain (a.k.a nPerChain)

nThin:  The thinning rate (1 = no thinning).

nTotalSamples:  Total number of samples saved per parameter.

'cap.names' transforms names like 'SMITH, JOHN THOMAS' to
'Smith, John Thomas'.
ARGUMENTS:
'name' = the name as a character string.
'add.caps = TRUE' if you want a name like 'smith, john' to be
transformed to 'Smith, John'; if 'add.caps = FALSE', it is assumed
that capital letters need to be transformed to lower case, but not
vice versa.

'censor' is a function for sampling from a censored distribution.  By
default, the sampled value xx must be strictly between the bounds, 'lower < xx
< upper', i.e., the samples are drawn from an open interval (lower, upper).
This default can be overridden (see 'include.ends' below).
ARGUMENTS:
'lower' = lower bound of censoring interval.  Set 'lower = -Inf' (default)
if no lower bound is desired.
'upper' = upper bound of censoring interval.  Set 'upper = Inf' (default)
if no upper bound is desired.
'FUN' is function that randomly samples from a specified distribution.  Typically,
'FUN' has the form 'FUN = function() rdistribution(n = 1, <parameters>)', where
'rdistribution' is replaced with an R distribution like 'rnorm' or 'rbeta' and
<parameters> are replaced with the parameter values to be used in the random
sampling.
'n.iterations' specifies the number of times samples are drawn before
ceasing to attempt to sample between 'lower' and 'upper'.  'n.iterations'
is set to 100 (default) only to prevent an infinite loop in the case where
the user mistakenly sets (lower, upper) to be outside of the range
of possible samples, e.g., if 'lower = -3', 'upper = -2', and
'FUN = function() rbeta(n = 1, shape1 = 1, shape2 = 1)'.  If you are
certain that 'FUN' is capable of drawing samples between 'lower' and 'upper',
then one can set 'n.iterations = Inf' to make sure that the call to 'censor'
will yield a numeric value.
'include.ends = FALSE' (default) implies that 'lower' and 'upper' are
not acceptable values of the sample; if 'include.ends = TRUE', then
'lower' and 'upper' are accepted as within the interval of acceptable
values.