[r-cran-coda] 50/60: Imported Upstream version 0.19-1

Andreas Tille tille at debian.org
Fri Dec 16 12:11:28 UTC 2016


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository r-cran-coda.

commit e6609e951af6ad9823c12ae3082301b79238fb8e
Author: Andreas Tille <tille at debian.org>
Date:   Fri Dec 16 12:35:00 2016 +0100

    Imported Upstream version 0.19-1
---
 CHANGELOG       |  12 +++++++++
 DESCRIPTION     |   8 +++---
 INDEX           |  48 -----------------------------------
 MD5             |  21 ++++++++--------
 NAMESPACE       |   5 ++--
 R/gelman.R      |   3 ++-
 R/geweke.R      |   2 +-
 R/output.R      |  77 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
 data/line.rda   | Bin 9600 -> 9599 bytes
 inst/CITATION   |   4 +--
 man/densplot.Rd |  31 +++++++++++++++--------
 man/mcmc.Rd     |  14 ++++++++---
 12 files changed, 136 insertions(+), 89 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 1db2f67..2878995 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,15 @@
+0.19-1 Martyn Plummer <plummerm at iarc.fr>
+
+	- gelman.plot() now avoids superfluous calculation of multivariate
+	diagnostic. Thanks to Gert van Valkenhoef.
+
+	- Fixed various issues with the histogram produced by densplot()
+	for discrete-valued distributions. Thanks to Robert Goudie.
+
+	- Obsolete INDEX file removed
+
+	- Dimnames bug in geweke.plot fixed. Thanks to Jiri Moravec
+
 0.18-1 Martyn Plummer <plummer at iarc.fr>
 
 	- Arni Magnusson is fully credited as coauthor
diff --git a/DESCRIPTION b/DESCRIPTION
index b382d54..e0053a8 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
 Package: coda
-Version: 0.18-1
-Date: 2015-10-16
+Version: 0.19-1
+Date: 2016-12-07
 Title: Output Analysis and Diagnostics for MCMC
 Authors at R: c(person("Martyn", "Plummer", role=c("aut","cre","trl"),
        	            email="plummerm at iarc.fr"),
@@ -19,7 +19,7 @@ Description: Provides functions for summarizing and plotting the
 	distribution of the Markov chain.
 License: GPL (>= 2)
 NeedsCompilation: no
-Packaged: 2015-10-16 14:52:42 UTC; martyn
+Packaged: 2016-12-07 15:34:56 UTC; martyn
 Author: Martyn Plummer [aut, cre, trl],
   Nicky Best [aut],
   Kate Cowles [aut],
@@ -30,4 +30,4 @@ Author: Martyn Plummer [aut, cre, trl],
   Arni Magnusson [aut]
 Maintainer: Martyn Plummer <plummerm at iarc.fr>
 Repository: CRAN
-Date/Publication: 2015-10-16 20:00:43
+Date/Publication: 2016-12-08 10:25:11
diff --git a/INDEX b/INDEX
deleted file mode 100644
index 0c61bd9..0000000
--- a/INDEX
+++ /dev/null
@@ -1,48 +0,0 @@
-as.matrix.mcmc          Conversions of MCMC objects
-as.ts.mcmc              Coerce mcmc object to time series
-autocorr                Autocorrelation function for Markov chains
-autocorr.diag           Autocorrelation function for Markov chains
-autocorr.plot           Plot autocorrelations for Markov Chains
-batchSE                 Batch Standard Error
-bugs2jags               Convert WinBUGS data file to JAGS data file
-codamenu                Main menu driver for the coda package
-coda.options            Options settings for the codamenu driver
-crosscorr               Cross correlations for MCMC output
-crosscorr.plot          Plot image of correlation matrix
-cumuplot                Cumulative quantile plot
-densityplot.mcmc        Trellis plots for mcmc objects
-densplot                Probability density function estimate from MCMC
-                        output
-effectiveSize           Effective sample size for estimating the mean
-gelman.diag             Gelman and Rubin's convergence diagnostic
-gelman.plot             Gelman-Rubin-Brooks plot
-geweke.diag             Geweke's convergence diagnostic
-geweke.plot             Geweke-Brooks plot
-heidel.diag             Heidelberger and Welch's convergence diagnostic
-HPDinterval             Highest Posterior Density intervals
-line                    Simple linear regression example
-mcmc                    Markov Chain Monte Carlo Objects
-[.mcmc                  Extract or replace parts of MCMC objects
-mcmc.list               Replicated Markov Chain Monte Carlo Objects
-mcmcUpgrade             Upgrade mcmc objects in obsolete format
-mcpar                   Mcpar attribute of MCMC objects
-multi.menu              Choose multiple options from a menu
-nchain                  Dimensions of MCMC objects
-pcramer                 The Cramer-von Mises Distribution
-plot.mcmc               Summary plots of mcmc objects
-raftery.diag            Raftery and Lewis's diagnostic
-read.and.check          Read data interactively and check that it
-                        satisfies conditions
-read.coda               Read output files in CODA format
-read.coda.interactive   Read CODA output files interactively
-read.openbugs           Read CODA output files produced by OpenBUGS
-rejectionRate           Rejection Rate for Metropolis-Hastings chains
-spectrum0               Estimate spectral density at zero
-spectrum0.ar            Estimate spectral density at zero
-summary.mcmc            Summary statistics for Markov Chain Monte Carlo
-                        chains
-thin                    Thinning interval
-time.mcmc               Time attributes for mcmc objects
-traceplot               Trace plot of MCMC output
-varnames                Named dimensions of MCMC objects
-window.mcmc             Time windows for mcmc objects
diff --git a/MD5 b/MD5
index 066cbe3..b846239 100644
--- a/MD5
+++ b/MD5
@@ -1,29 +1,28 @@
-5d573790477b5f532496ced708cf98b1 *CHANGELOG
-ee63dce424da3eb1d6694384207193d5 *DESCRIPTION
-ff890b50eaa074ed668c6f2fac1b4141 *INDEX
-201d6ba76723e5bc6a9a51df4d7f99a3 *NAMESPACE
+f93beeb84925a019cbfa2f38abb14735 *CHANGELOG
+513f2231a06978c1f585257dc68dce26 *DESCRIPTION
+b0ab1efea562993f9f77ada2eeefd6d9 *NAMESPACE
 45f88adec7bcfab586a4deebba1cc02d *R/HPDinterval.R
 841853b3b96462cffe376cf9fad6abb9 *R/autocorrdiag.R
 02152920c66f540422f88e51c88f0428 *R/batchSE.R
 4e1a55cb0aed5bcaa0f2f9d474e2fdea *R/codamenu.R
 df4c85619867ba81878499f5059e875d *R/cumuplot.R
-7403a684ac51932afbbb617d1f606a9a *R/gelman.R
-a97024cb207bcef6fd4bc7c00283c1ed *R/geweke.R
+678f462e907298fc9e2e66b3395dc291 *R/gelman.R
+6ff93635a342cc91ae1e417da7c49485 *R/geweke.R
 6fb74d6977e5e3b5190eda35829cdc23 *R/heidel.R
 ae77a3ec34f086bd7ec8ea787baeeb1e *R/jags.R
 0473eacf2812c4d9641e1c7fd09056b4 *R/mcextractor.R
 97fef151be1d2924942ca84de70c87f4 *R/mcmc.R
 f60ceb305b2ab088484ab63d938333d1 *R/mcmclist.R
-bd120c9296e4467265ee10409799e61f *R/output.R
+146b8b73cb0439dabe303c4549002937 *R/output.R
 389758882050a375ac4b5298a42ae35f *R/raftery.R
 4caafbeb9941605b240d3ae9f6c8d5ff *R/rejectionRate.R
 d41d8cd98f00b204e9800998ecf8427e *R/thin.R
 553b1effc0816a68e0ad4dfd7847757f *R/trellisplots.R
 1e363c43c22c2a0e9658866463a0542d *R/util.R
 4d7d828d6d2b4fee5357d3a4dd108458 *README
-ff0a8b17ed6881971cbd33c7ddb3fbda *data/line.rda
+b38b3e053deb49b88462b8acfdfff9df *data/line.rda
 52066ed7a20504a282a091060a794d57 *inst/AUTHORS
-81c1ae300d47f9a787eb871fbaafeb9f *inst/CITATION
+28e8ead6b87a0c883522b26f0e163d68 *inst/CITATION
 868ded8f4d10a67c7b31854bce6f3d63 *man/Cramer.Rd
 7bfe602ce737efac910300e5be5a8552 *man/HPDinterval.Rd
 f5361dc01c864e905a9c3eb84e060c67 *man/as.ts.mcmc.Rd
@@ -37,7 +36,7 @@ e704de229cf312aa584094b126529e1a *man/coda.options.Rd
 d3b21ba8f4c82fd92adfb1d4380d4cc8 *man/crosscorr.Rd
 80c2893a13683e442443b36764810498 *man/crosscorr.plot.Rd
 18609dc8a896f624c979de557280cbf0 *man/cumuplot.Rd
-14365306d891deafd1ca602f59e4520f *man/densplot.Rd
+586e55b5b9734e6577b1ad18126f1aed *man/densplot.Rd
 2b5bbbb8d683384c9287a9c8e1f7a01f *man/effectiveSize.Rd
 c78c35ac982bcd74befe51f98ba641e4 *man/gelman.diag.Rd
 394ae6df9b067ecb6120067aba37728c *man/gelman.plot.Rd
@@ -45,7 +44,7 @@ aa5ee817bb15d58b4fd40089432ba99b *man/geweke.diag.Rd
 efd11972209251ece16ec61d8326bdce *man/geweke.plot.Rd
 0c3865e05310e0a2ea9af0e4912ed036 *man/heidel.diag.Rd
 5fc3363fee1907a6c2ba1567cf40eea2 *man/linepost.Rd
-0718d4266cbcbf5101b79158dc441920 *man/mcmc.Rd
+4c57d4e645396dd72ce68e474e7e3dcf *man/mcmc.Rd
 e32d079a18aa183c78933b01da34a4b2 *man/mcmc.convert.Rd
 e32462705734dbab825107b00fc3d8b0 *man/mcmc.list.Rd
 8e47ffb91930e7f05171861b666c71b5 *man/mcmc.subset.Rd
diff --git a/NAMESPACE b/NAMESPACE
index 4485dc2..03d1794 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -123,11 +123,10 @@ S3method(print, raftery.diag)
 S3method(print, summary.mcmc)
 
 ## Imports
-
 importFrom(grDevices, dev.cur, dev.interactive, dev.off, postscript,
-           topo.colors)
+           topo.colors, nclass.Sturges)
 importFrom(graphics, abline, axis, hist, legend, lines, matplot, par,
-           plot, polygon, text, title)
+           plot, polygon, text, title, barplot)
 importFrom(lattice, xyplot, qqmath, densityplot, levelplot,
            panel.abline, panel.xyplot, trellis.par.get, do.breaks,
            panel.superpose, prepanel.qqmathline, splom)
diff --git a/R/gelman.R b/R/gelman.R
index b6bc0bf..f506429 100644
--- a/R/gelman.R
+++ b/R/gelman.R
@@ -218,7 +218,8 @@
     shrink[i, , ] <- gelman.diag(window(x, end = last.iter[i]), 
                                  confidence = confidence,
                                  transform = transform,
-                                 autoburnin = autoburnin)$psrf
+                                 autoburnin = autoburnin,
+                                 multivariate = FALSE)$psrf
   }
   all.na <- apply(is.na(shrink[, , 1, drop = FALSE]), 2, all)
   if (any(all.na)) {
diff --git a/R/geweke.R b/R/geweke.R
index 2571f54..6d9d08a 100644
--- a/R/geweke.R
+++ b/R/geweke.R
@@ -49,7 +49,7 @@
   ystart <- seq(from = start(x), to = (start(x) + end(x))/2, length = nbins)
   if (is.R())
     gcd <- array(dim = c(length(ystart), nvar(x), nchain(x)), 
-               dimnames = c(ystart, varnames(x), chanames(x)))
+               dimnames = list(ystart, varnames(x), chanames(x)))
   else
     gcd <- array(dim = c(length(ystart), nvar(x), nchain(x)), 
                dimnames = list(ystart, varnames(x), chanames(x)))
diff --git a/R/output.R b/R/output.R
index d44c5eb..650dafb 100644
--- a/R/output.R
+++ b/R/output.R
@@ -104,9 +104,68 @@ function (x, col = topo.colors(10), ...)
     invisible()
 }
 
+"pretty.discrete" <- function(y, right)
+{
+    ## Used to created break points for hist() for discrete data.
+    ## Works around some limitations of pretty() for discrete data.
+    ## The acid test is that the histogram produced by densplot for
+    ## discrete data should be visually uniform if the underlying
+    ## discrete distribution is uniform.
+    
+    ybreaks <- pretty(y, nclass.Sturges(y))
+    yunique <- unique(y)
+    if (length(yunique) == 1) {
+        return(ybreaks)
+    }
+    
+    if (length(ybreaks) > length(yunique)) {
+        ## Pretty puts in too many breaks
+        ybreaks <- sort(yunique)
+    }
+
+    nb <- length(ybreaks)
+
+    if (right) {
+        if (max(y) < ybreaks[nb]) {
+            ## Last bin is too wide
+            ybreaks[nb] <- max(y)  
+        }
+        if (min(y) > ybreaks[1]) {
+            ## First bin is too wide
+            ybreaks[1] <- min(y) - 1
+        }
+        else if (min(y) == ybreaks[1]) {
+            ## The hist() function adds some fuzz to its break
+            ## points causing the first two categories to be
+            ## merged.  Work around this by adding extra
+            ## breakpoints on the left.
+            ybreaks <- c(ybreaks[1] - 1, ybreaks)
+        }
+    }
+    else {
+        if (min(y) > ybreaks[1]) {
+            ## First bin is too wide
+            ybreaks[1] <- min(y)
+        }
+        if (max(y) < ybreaks[nb]) {
+            ## Last bin is too wide
+            ybreaks[nb] <- max(y) + 1  
+        }
+        else if (max(y) == ybreaks[nb]) {
+            ## The hist() function adds some fuzz to its break
+            ## points causing the first two categories to be
+            ## merged.  Work around this by adding extra
+            ## breakpoints on the left.
+            ybreaks <- c(ybreaks[nb] + 1, ybreaks)
+        }
+    }
+    
+    ybreaks
+}
+
 "densplot" <-
 function (x, show.obs = TRUE, bwf, ylim, xlab, ylab = "", type = "l", main,
-          ...) 
+          right=TRUE, ...) 
 {
     xx <- as.matrix(x)
     for (i in 1:nvar(x)) {
@@ -127,10 +186,14 @@ function (x, show.obs = TRUE, bwf, ylim, xlab, ylab = "", type = "l", main,
             else paste("Density of", varnames(x)[i])
         }
         else main
-        
-        if (max(abs(y - floor(y))) == 0 || bw == 0) {
-            ## Draw histogram
 
+        if (max(abs(y - floor(y))) == 0 || bw == 0 || length(unique(y)) == 1)
+        {
+            ## Draw histogram for discrete data or constant data or if
+            ## bandwidth is zero.
+
+            ybreaks <- pretty.discrete(y, right)
+            
             ## Set default values for graphical parameters
             if (missing(xlab)) {
                 xlab <- ""
@@ -138,8 +201,10 @@ function (x, show.obs = TRUE, bwf, ylim, xlab, ylab = "", type = "l", main,
             if (missing(ylim)) {
                 ylim.par <- NULL 
             }
-            hist(y, prob = TRUE, xlab=xlab, ylab=ylab,
-                 ylim=ylim.par, main=main.par, ...)
+            yhist <- hist(y, breaks=ybreaks, right=right, plot=FALSE)
+            plot(yhist, xlab=xlab, ylab=ylab, ylim=ylim.par, main=main.par,
+                 xaxt="n", freq=FALSE, ...)
+            axis(side=1, at=ybreaks)
         }
         else {
             ## Draw density plot
diff --git a/data/line.rda b/data/line.rda
index 960a9f6..ff571a8 100644
Binary files a/data/line.rda and b/data/line.rda differ
diff --git a/inst/CITATION b/inst/CITATION
index f9cb00f..231daa0 100644
--- a/inst/CITATION
+++ b/inst/CITATION
@@ -11,7 +11,7 @@ citEntry(entry="Article",
          volume = 6,
          number = 1,
          pages = "7--11",
-         url = "http://CRAN.R-project.org/doc/Rnews/",
-         pdf = "http://CRAN.R-project.org/doc/Rnews/Rnews_2006-1.pdf",
+         url = "https://journal.r-project.org/archive/",
+         pdf = "https://www.r-project.org/doc/Rnews/Rnews_2006-1.pdf",
          textVersion = "Martyn Plummer, Nicky Best, Kate Cowles and Karen Vines (2006). CODA: Convergence Diagnosis and Output Analysis for MCMC, R News, vol 6, 7-11")
 
diff --git a/man/densplot.Rd b/man/densplot.Rd
index 7d7fee1..37cf4c4 100644
--- a/man/densplot.Rd
+++ b/man/densplot.Rd
@@ -3,7 +3,7 @@
 \title{Probability density function estimate from MCMC output}
 
 \usage{densplot(x, show.obs = TRUE, bwf, 
-                ylim, xlab, ylab = "", type="l", main, \ldots)}
+                ylim, xlab, ylab = "", type="l", main, right=TRUE, \ldots)}
 
 \arguments{
   \item{x}{An \code{mcmc} or \code{mcmc.list} object}
@@ -18,25 +18,36 @@
   \item{ylab}{Y-axis label. By default, this is blank. See \code{plot}}
   \item{type}{Plot type. See \code{plot}}
   \item{main}{An overall title for the plot. See \code{title}}
+  \item{right}{Logical flag for discrete-valued distributions passed to
+    the \code{hist} function. See Details}.
   \item{\dots}{Further graphical parameters}
 }
 
 \description{
   Displays a plot of the density estimate for each variable in \code{x},
-  calculated by the \code{density} function.
+  calculated by the \code{density} function. For discrete-valued
+  variables, a histogram is produced.
 }
+\details{
 
-\note{
-  You can call this function directly, but it is more usually
-  called by the \code{plot.mcmc} function.
+  For discrete-valued distributions, a histogram is produced and values
+  are aggregated using the pretty() function. By default, tick marks
+  appear to the right of the corresponding bar in the histogram and give
+  the inclusive upper limit of the hist (\code{right=TRUE}). This can be
+  modified by specifying \code{right=FALSE}. In this case tick marks
+  appear on the left and specify the inclusive lower limit of the bar.
 
-  If a variable is bounded below at 0, or bounded in the interval [0,1],
-  then the data are reflected at the boundary before being passed to the
-  density() function. This allows correct estimation of a non-zero
-  density at the boundary.
+  For continous distributions, if a variable is bounded below at 0, or
+  bounded in the interval [0,1], then the data are reflected at the
+  boundary before being passed to the density() function. This allows
+  correct estimation of a non-zero density at the boundary.
+}
+\note{
+  You can call this function directly, but it is more usually called by
+  the \code{plot.mcmc} function.
 }
 
 \seealso{
-  \code{\link{density}}, \code{\link{plot.mcmc}}.
+  \code{\link{density}}, \code{\link{hist}}, \code{\link{plot.mcmc}}.
 }
 \keyword{hplot}
diff --git a/man/mcmc.Rd b/man/mcmc.Rd
index 5d82869..83d4935 100644
--- a/man/mcmc.Rd
+++ b/man/mcmc.Rd
@@ -23,9 +23,17 @@ is.mcmc(x)
 
 \description{
 
-   The function `mcmc' is used to create a Markov Chain Monte Carlo object.
-   The data are taken to be a vector, or a matrix with one column per
-   variable.
+   The function \code{mcmc} is used to create a Markov Chain Monte Carlo
+   object.  The input data are taken to be a vector, or a matrix with
+   one column per variable.
+
+   If the optional arguments \code{start}, \code{end}, and \code{thin}
+   are omitted then the chain is assumed to start with iteration 1 and
+   have thinning interval 1. If \code{data} represents a chain that
+   starts at a later iteration, the first iteration in the chain should
+   be given as the \code{start} argument. Likewise, if \code{data}
+   represents a chain that has already been thinned, the thinning
+   interval should be given as the \code{thin} argument.
 
    An mcmc object may be summarized by the \code{summary} function
    and visualized with the \code{plot} function.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/r-cran-coda.git



More information about the debian-science-commits mailing list