//
// Changes and Bug Fixes
//
1.6.4 to 1.6.5
  * fixed warnings generated during c++ compiling 
  * matrix_random_access_iterator.h:97 matrix_forward_iterator.h:77, matrix_bidirectional_iterator.h:77 (void, void, void) is added 
	
1.6.3 to 1.6.4
  * optimize.h warning addresed
 
1.6.2 to 1.6.3
  * IndMH is set as a default mcmc.method for MCMCmnl

1.6.1 to 1.6.2
  * fixed warnings regarding deprecated C++ features
  * initialized double logmarglike = 0.0; int st = 0.0 in cHDPHMMnegbin.cc

1.6-0 to 1.6.1 
  * fixed "failure: the condition has length > 1" problem. 

1.5-0 to 1.6-0
  * MCMCpaircompare.R is added.

1.4-9 to 1.5-0 
  * Removed print(, digits=2) in MCMCmixfactanal  

1.4-8 to 1.4-9
  * error in marginal likelihood computation in MCMCregressChange
    Thanks to Sid Chib for letting us know it

1.4-6 to 1.4-7
  * print(, digits=2) in MCMCmixfactanal 
	
1.4-5 to 1.4-6
  * Fixed ... in testSubjectBreak.Rd

1.4-4 to 1.4-5
  * changed documentation for MCMCoprobit to reflect changes requested by Sid Chib
  * fixed typo in cMCMCoprobit.cc-- output at the end should be MH acceptance rate for gamma, not for beta
  * changed a few calls to model.matrix() that were passing the contrasts argument in an improper way. prior to R 3.6 these problems didn't throw warnings. with R 3.6 and greater warnings are thrown. This should be fixed now.
  * Missing bracelet is added to irt_theta_update in MCMCfcds.h
  * dealing with lto error in MCMCpack_init.c and cMCMCdynamicIRT1d.cc flagged by CRAN

1.4-3 to 1.4-4
  * fixed problem in MCMCoprobit identified by Shawn Treier-- Cowles ratio missing denom

1.4-2 to 1.4-3
  * some quotations and broken URLs fixed

1.4-1 to 1.4-2
  * fixed an error in cHDPHMMpoisson.cc

1.4-0 to 1.4-1
  * mixfactanal NAMESPACE issue fixed

1.3-9 to 1.4-0
  * documentation and NAMESPACE generated by Roxygen

1.3-8 to 1.3-9
  * Changes into a canonical CRAN URL 

1.3-7 to 1.3-8
  * modified MCMCordfactanal.cc and MCMCordfactanal.R
	
1.3-6 to 1.3-7
  * fixed bug in MCMCirtKd (thanks to Rudolf Debelak)

1.3-3 to 1.3-4
  * fixed bug in MCMCmetrop1R that caused the theta.init to be modified after
being passed to MCMCmetrop1R (thanks to Simon Barthelme)

1.3-2 to 1.3-3
  * fixed an error in MCMCpoissonChange: is.na(lambda.mu) and dropped offset argument
  (thanks to Brian Ripley)	
		
1.3-1 to 1.3-2
  * fixed two mistakes in marginal likelihood computation in MCMCregress 
    (thanks to Sid Chib). In computing log_sigma2, 
      - exp(digamma) -> digamma
      - averaging over tot_iter -> averaging over nstore
  * added MCMCintervention(), MCMCregressChange(), and plotIntervention()
  * sigma.mu and sigma.var are added in MCMCregress()
  * lambda.mu and lambda.sigma are added in MCMCpoissonChange()
  * fixed minor mistakes and change expressions for a recent version of g++
    (thanks to Jeffrey Oldham)

1.2-4 to 1.3-1
  * fixed many C++ issues related to clang and Solaris (many thanks to
     Brian Ripley for his significant contributions)

1.2-3 to 1.2-4
  * fixed a bug in HMMmultivariateGaussian.cc (comparison of unsigned and
    singed integers)
  * cleaned up g++ 4.7 compatibility issues (thanks to Dan Pemstein and
    Chris Lawrence)

1.2-2 to 1.2-3
  * fixed extraneous warnings in hidden.R (thanks to Jeffrey Arnold)
  * added make.breaklist.R
  * fixed example codes in HMMpanelFE.Rd and testpanelSubjectBreak.Rd
  * fixed testpanelSubjectBreak() to handle missing values in subject.id

1.2-1 to 1.2-2
  * fixed bug in dwish() (thanks to Taráz E. Buck)
  * fixed .onAttach() to no longer require packages and use packageStartupMessage()
    (thanks to Brian Ripley)
  * updated to most recent version of Scythe library
  * cleaned up issues with cout, cerr, abort(), exit(), and pthread.h
    (thanks to Brian Ripley)
 
1.1-5 to 1.2-1
  * added HMMpanelFE()
  * added HMMpanelRE()
  * added testpanelGroupBreak()
  * added testpanelSubjectBreak()  
  * added MCMCresidualBreakAnalysis()
  * deleted #undef DO, #undef DS, #undef SO, #undef SS 
    due to a symbol clash with Solaris' headers (thanks to Brian Ripley)
  
1.1-4 to 1.1-5
  * fixed an error in MCMCregress: loglike should be dropped

1.1-3 to 1.1-4
  * fixed an error in MCMChregress: NQ has to be replaced by NP (line 223)
  * in MCMChregress, MCMChpoisson, MCMChlogit, R_CheckUserInterrupt(void) is replaced by R_CheckUserInterrupt()
  * fixed an error in the marginal likelihood computation 
    in MCMCproit.cc and MCMCregress.cc (thanks to Sid Chib)
  * changed B0 as prior precision in MCMCprobitChange, MCMCoprobitChange and MCMCpoissonChange
  * the acceptance rate is reported if verbose > 0
  * added the reporting of marginal likelihood components if verbose > 0 
      	
1.0-11 to 1.1-2
  * fixed an error in MCMCoprobit.R
  * changed the documentation of MCMCoprobit.
  * Added m=0 option to all changepoint models. Now all changepoint models allow users
    to set m=0 for marginal likelihood computation.
  * Fixed a bug in MCMCbinaryChange. I don't know why but log(dbeta) in Scythe often
    generates NaN results while lndbeta1() does not.

1.0-10 to 1.0-11
  * updated CITATION file in inst/ to coincide with JStatSoft publication
  * added reference to JStatSoft in references

1.0-9 to 1.0-10
  * added CITATION in inst/ to coincide with JStatSoft publication
  * compressed two large data files (Senate and Nethvote)

1.0-8 to 1.0-9
  * added MCMCprobitChange() 
  * added MCMCoprobitChange() 
  * modified MCMCprobit and MCMCprobitres for marginal likelihood estimation 	

1.0-7 to 1.0-8
  * fixed some NAMESPACE issues [thanks to Shawn Treier]

1.0-6 to 1.0-7
  * slight modifications to internals of rinvgamma to make parameterization 
    more clear [thanks to Daniel Runcie and Richard Morey]
  * fixed some NAMESPACE issues with SSVSquantreg and its methods [written by Craig
    Reed]

1.0-5 to 1.0-6
  * added SSVSquantreg [written by Craig Reed]
  * added functions to handle SSVSquantreg output [written by Craig Reed]
  * revisions to the MCMCquantreg function [written by Craig Reed]
  * revisions to the MCMCquantreg function [written by Craig Reed]
  * fixed parameterization issue with rinvgamma [thanks to Julian Stander]

1.0-4 to 1.0-5
  * added heteroskedastic IRT model [written by Ben Lauderdale]
  * minor changes to error status in hierarchical IRT [written by Mike Malecki]

1.0-3 to 1.0-4
  * little change to parameterization of BQR [contributed by Craig Reed]

1.0-2 to 1.0-3
  * fix to hierarchical IRT documentation [written by Mike Malecki]
  * added Bayesian quantile regression [contributed by Craig Reed]

1.0-1 to 1.0-2
  * added Poisson regression changepoint analysis MCMCpoissonChange() [JHP]
  * Old MCMCpoissonChangepoint() is deprecated [JHP]
  * added binary data changepoint model MCMCbinaryChange() [JHP]
  * plotState() function modified to support new models [JHP]
  * plotChangepoint() function modified to support new models
  * added a number of new helper functions in btsutil.R [JHP]

0.9-6 to 1.0-1
   * added one-dimensional dynamic IRT model 
   * added Rehnquist Court data to illustrate dynamic IRT model

0.9-5 to 0.9-6
   * fixed bug in MCMCmetrop1R.R [thanks to many for spotting memory issue]
   * fixed by in Lecuyer seeds [thanks to Eduardo Leoni]

0.9-4 to 0.9-5
  * changed how missing values are handled when calculating agreement scores
    for starting values in factor analysis and IRT models
  * added warning about incomparable models to BayesFactor
  * fixed bug with MCMCmnl example [thanks to Duncan Murdoch]
  * fixed formula interface bug for all models [thanks to Duncan Murdoch]
  * added hierarchical IRT code [written by Mike Malecki]

0.9-3 to 0.9-4
  * fixed issue with MCMCmetrop1R.R [thanks to Jim Albert]
  * fixed Linux compilation issue [thanks to Chris Lawrence]

0.9-2 to 0.9-3
  * added gcc 4.0 check in configure.ac and SystemRequirements
  * added verbose option to plotChangepoint()

0.9-1 to 0.9-2
  * fixed Makevars per Ripley's email [PKG_CXXFLAGS to PKG_CPPFLAGS]
  * fixed encoding on some documentation files [thanks to Kurt Hornik]
  * added other estimation algorithms for MCMCoprobit
  * added other estimation algorithms for MCMCmnl
  * added MCMCpoissonChangepoint with estimation in compiled C++
  * a variety of other minor fixes
  
0.8-2 to 0.9-1
  * first release of JStatSoft version
  * full port to Scythe 1.0.2 (nearly all C++ has been radically changed)
  * MCMCpanel() deprecated
  * a number of minor fixes [thanks to anonymous reviewers]

0.8-1 to 0.8-2
  * models with multivariate normal priors now check for symmetry and positive
    semi-definiteness of precision matrix
  * fixed bug in how models with marginal likelihood calculations check for
    prior propriety [thanks to Gary Rosner for spotting this]
  * fixed bug in how MCMCmetrop1R handled a singular Hessian 
    [thanks to Piers Dunstan for spotting this] 

0.7-4 to 0.8-1
  * added MCMCPoissonChangepoint() model (authored by Jong Hee Park)
  * added two plot methods for changepoint models:
       plotPostChangepoint() and plotPostState() (authored by Jong Hee Park)
  * package cleaned up prior to submission of piece to JStatSoft, including
    major edit of documentation
 
0.7-3 to 0.7-4
  * fixed minor bug in MCMCpoisson() that was causing the function to 
    not work on Windows machines.
  * changed 
      test <- grep("\.nonconst$", c.names)
    to 
      test <- grep("\\.nonconst$", c.names)
    and
      c.names <- sub("\.nonconst$", "", c.names)
    to 
    c.names <- sub("\\.nonconst$", "", c.names)
    in automate.R. [Thanks to Kurt Hornik for noticing this.]

0.7-2 to 0.7-3
  * following posting by Radford Neal at:  
      http://www.stat.columbia.edu/~cook/movabletype/archives/2006/03/ adaptive_metrop.html
    switched a < to a <= in the shrinkage procedures used in the various slice
    sampling implementations.
  * modified tomogplot() and dtomogplot() to handle situations in which 
    r1[i] == 0. [thanks to David Hugh-Jones for making this suggestion].
  * allowed for more user control of the initial call to optim in 
    MCMCmetrop1R [thanks to Luca La Rocca for this suggestion].
  * allowed users to pass the variance-covariance matrix of the Gaussian 
    proposal directly without resorting to a call to optim 
    [thanks to Luca La Rocca for this suggestion].
  * fixed minor bug in developer mode in automate.R [thanks to Ben Goodrich].
  * fixed a minor bug in the developer mode documentation template.
  * fixed minor bug in nonconst call in MCMCregress.



0.7-1 to 0.7-2
  * added procrustes() to NAMESPACE so that it can be seen (function and 
    documentation already there).
  * fixed the prior in the full conditional for theta_i in MCMCirtKdRob. 
    Previously was uniform on the unit circle which was not consistent with
    the documentation and could cause problems given how the starting values
    were chosen. 	
  * fixed prior for lambda_j in MCMCirtKdRob (similar to point above)	
  * fixed the the calculation of the full conditional for gamma[i] in 
    MCMCSVDreg()
  * Fixed a bug in MCMCbetabinomial() [thanks to John Wood].

0.6-6 to 0.7-1
  * Added robust k-dimensional IRT model MCMCirtKdRob().
  * Added SVD regression MCMCSVDreg().
  * Updated auto.Scythe.call() to have any number of non-constants args; this
    is necessary to return other things from the C++ code besides the
    posterior density sample (including log-marginal likelihoods,
    acceptance rates, etc.).
  * Updated form.mcmc.object() to add additional attributes to an
    mcmc object to hold other quantities of interest (such as
    log-marginal likelihoods, acceptance rates, data, etc.).
  * For linear regression model, added option to compute log-marginal
    likelihood via the method of Chib (1995) or via the Laplace Approximation.
  * For logistic regression model, added option to compute log-marginal
    likelihood via the Laplace Approximation.
  * For probit regression model, added option to compute log-marginal
    likelihood via the Laplace Approximation.
  * For Poisson regression model, added option to compute log-marginal
    likelihood via the Laplace Approximation.
  * Added methods to calculate Bayes factors and posterior probabilities 
    of models and handle log-marginal likelihoods. 
  * Added teaching model MCbinomialbeta().
  * Added teaching model MCpoissongamma().
  * Added teaching model MCnormalnormal().
  * Added teaching model MCmultinomdirichlet().
  * patched xpnd() function to provide more functionality.  Thanks to
    Gregor Gorjan for the patches.
  * added the function procrustes() that performs a Procrustes 
    transformation of a matrix.
  * made some minor changes to MCMCirt1d() to help conserve memory when
    dealing with large datasets (MORE OPTIMIZATION NEEDS TO BE DONE IN
    TERMS OF BOTH SPEED AND MEMORY)	

0.6-5 to 0.6-6
  * fixed the std::accumulate problem pointed out by Kurt Hornik. Thanks
    to Dan Pemstein for tracking the problem down and making the fix.
  * fixed up how the force.samp option works with MCMCmetrop1R-- previously
    if a diagonal element of the Hessian was 0 the correction wouldn't work. 
  * changed how additional arguments are passed to user-defined function
    in MCMCmetrop1R. This breaks old code but provides a more standard
    interface. 
  * when logfun==FALSE in MCMCmetrop1R the initial call to optim() now
    maximizes the log of the user-defined function
  * cleaned up the *.Rd files for the model fitting functions a bit 
    (more still needs to be done)
  * MCMClogit now optionally accepts a user-defined prior density

0.6-4 to 0.6-5
  * added a check so one can run MCMCirt1d without passing constraints
  * fixed the Senate dataset so there are no duplicate names in the
    member variables, and modified examples accordingly 
  * slightly edited DESCRIPTION file to get some important keywords
    in the first sentence
  * compute dinvgamma() on the log scale so it does not blow up
    for large shape and scale parameters
  * changed how MCMCmetrop1R handles a non-negative definite Hessian
    from optim--sampling can now proceed if the user flips a switch
  * fixed minor error in how std.mean was passed to MCMCmixfactanal
  * fixed the error in the beta full conditional in MCMCpanel that resulted
    from a typo in the Chib and Carlin paper
  * changed factor.score.eigen.start() in hidden.R to use squared 
    distances rather than distances so as to be compatible with 
    Poole, 2005. _Spatial Models of Parliamentary Voting_	
  * fixed a minor bug in how the verbose argument was handled in the C++
    code for MCMCmetrop1R and MCMCfactanal [thanks to Lingji Chen]
  * fixed a minor documentation bug in the MCMCirtKd model [thanks to
    Guillermo Rosas]
  * fixed the text echoed at start-up so it does not have to be updated 
    year to year

0.6-3 to 0.6-4
  * fixed bug with verbose in MCMCmetrop1R pointed out by a referee for 
    Rnews
  * added a little clarification to the lecuyer.h file about the dual-
    licensing scheme Pierre L'Ecuyer agreed to on 7 August 2004.

0.6-2 to 0.6-3
  * cleaned up the docs for MCMCirtKd
  * MCMCirtKd now fits a model with a difficulty parameter rather than
    a negative difficulty (easiness ???) parameter
  * MCMCirtKd and MCMCordfactanal now do a better job of dropping 
    variables that have 0 variance.
  * fixed Senate examples for MCMCirt1d and MCMCirtKd. EVENTUALLY THE 
    SENATE DATA SHOULD BE FIXED DIRECTLY SO THAT THERE ARE NO DUPLICATE 
    NAMES IN THE MEMBER VARIABLE.
  * users can interrupt all estimation algorithms now with CTL-C
  * changed the behavior of the verbose switch. Now if verbose is greater
    than 0 output is printed every verboseth iteration.
  * changed the settings when mcmc objects are created so that 
    "start=burnin+1" and "end=mcmc+burnin"
  * fixed documentation of MCMCmetrop1R to make clear how data are passed
    to the log-posterior function
  * fixed factor.score.start.check to not return an error when a vector of
    starting values is passed
  * improved the way factor.score.start.check enforces constraints

0.6-1 to 0.6-2
  * fixed documentation for rinvgamma() and dinvgamma() so that it is clear
    that these functions take shape and scale parameters as arguments.
  * fixed documentation and R code for riwish(), diwish(), rwish(), and 
    dwish() so that it is more clear how these distributions are parameterized.
  * fixed line endings in MCMCtobit.cc
  * changed how MCMCordfactanal and MCMCmixfactanal report MH acceptance
    rates. They now report separate rates for each manifest variable.
  * fixed a bug with starting values in the IRT and factor models.  If no
    starting values were passed, those created in factor.score.start.check()
    did not include the constraints (hard or soft), so the check failed.  Now
    the constructed starting values meet the constraints.

0.5-2 to 0.6-1
   * added a tobit model for a linear model with censoring in MCMCtobit()
   * added multinomial logit model in MCMCmnl()
   * added vote data from the Netherlands to illustrate MCMCmnl()
   * added choicevar() function to specify choice-specific variables in 
     multinomial choice models
   * fixed some data-handling issues in MCMCmixfactanal() and
     MCMCordfactanal() [thanks to Ben Goodrich for isolating these and
     providing patches]
   * fixed the Metropolis-Hastings step for the Cowles algorithm for
     cutpoints in MCMCoprobit(), MCMCordfactanal(), and MCMCmixfactanal()
     [thanks to Alexander Raach for isolating the problem and providing
     a patch]
   * removed gcc specific compilation flags from Makevars.in (per the 
     request of Brian Ripley and Kurt Hornik)
   * added informative message for templates created in auto.Scythe.call()
   * modified vector.tune() hidden function
   * fixed Neal's shrinkage procedure in MCMChierEI.cc  
   * a number of editorial fixes, updating for new calendar year, etc.
   * removed functions acosh, asinh, atanh, and expm1 from smath.h and 
     smath.cc so cross-compilation will work

//
// Old Changes and Bug Fixes
//

MCMCpack 0.5-1 was a major revision of MCMCpack.  The entire package was
been essentially re-written using the new development environment (documented
in the MCMCpack specification) and the new Scythe Statistical Library 1.0.
This following list summarizes major changes, but is by no means 
exhaustive.

0.5-1 to 0.5-2
   * C++ code for truncated normal draws optimized for speed
   * with the permission of Pierre L'Ecuyer licensing of RngStream code
     changed to a dual license setup that is GPL compatible. Thanks to Chris 
     Lawrence for bringing the licensing issues to our attention and 
     drafting a new licensing statement and to Pierre L'Ecuyer for
     agreeing to use the new licensing statement for his RngStream
     code.
   * Fixed serious bugs in MCMChierEI() and MCMCdynamicEI() 
   * Implemented a new sampling scheme based on slice sampling for
     MCMChierEI() and MCMCdynamicEI().
   * Removed MCMCbaselineEI()
   * Added delay argument to dtomogplog() 

0.4-8 to 0.5-1
   * NAMESPACE implemented
   * hidden functions are now available to aid in development (see hidden.R)
   * a function is available to automate the C++ call and generate
     template C++ code for estimation (see automate.R)
   * all model functions have been updated to the new specification, and 
     most use hidden functions and automate
   * added a general purpose Metropolis sampler that allows the user
     to sample from an arbitrary (log)-density.
   * C++ code now using Scythe 1.0 (now using the unedited Scythe codebase
     through IFDEFs)
   * support for arbitrary random number generators, including
     the L'Ecuyer RNG for parallel computation (the RNG helper functions
     are available in MCMCrng.cc)
   * many full conditional distributions are available in MCMfcnds.cc 
   * documentation for density functions and RNGs have been made "R-like"
   * fixed some spelling errors and misnomers in the documentation
   * all documentation updated to reflect changes
   * MCMCirt1d() has a new interface with new types of constraints--
     sampling for this model is also now much faster. 

0.4-8 to 0.4-9
   * Fixed a minor Scythe issue to fix error found by gcc 3.4.   

0.4-7 to 0.4-8
   * Repaired Scythe_Simulate.*, for which an outdated version was included
     in the last release.

0.4-6 to 0.4-7
   * Fixed some Scythe bugs, including a problem with memory allocation for
     matrix multiplication.  See http://sourceforge.net/projects/scythestat/
     for the latest version of Scythe, which is now distributed with MCMCpack.
     The Scythe code differs slightly in the paths ../include and ../src are
     replace with the current path, and in pnorm2 the isnan() function is
     commented out to allow for cross-compilation.
   * Rolled out http://mcmcpack.wustl.edu website.
   * Mixed response factor code.
   * Fixed factanal.
   * Fixed irtKd.
   
0.4-5 to 0.4-6
   * Fixed a bug in rnoncenhypergeom() [thanks to Tom LaFramboise]
   * Patched Scythe0.3 to fix an error in inv() [thanks to Donour Sizemore].  
     Note that this function is not called in MCMCpack, so was causing no
     explicit errors.

0.4-3 to 0.4-5
   * Fixed a bug in xpnd() [thanks to Michael Man]
   * Fixed some inconsistencies in documentation [thanks to Kurt Hornik]

0.4-2 to 0.4-3
   * Fixed bug in Scythe truncated Normal generators (which had been
     fixed before but sneaked into the last release) -- this fixes 
     a problem with MCMCirt1d
   * Cleaned up MCMCbaselineDA.cc (eliminated unused arguments)
   * Cleaned up MCMCbaseline.R (tuning argument)
   * Set seed in MCMClogit.cc fixed
   * Set seed in MCMCpoisson.cc fixed   
   * Fixed all examples such that they work out of the box

0.4-1 to 0.4-2
   * Optimized some of the Scythe 0.4 code, which provides faster
     computation for most models.
   * Corrected a permissions problem on cleanup [thanks to Kurt Hornik] 
   * Added explicit licensing information and a text echo when loading
     MCMCpack.

0.3-11 to 0.4-1
   * Ported to Scythe Version 0.4 (which will soon be publicly available)
   * Cleaned up the codebase and documentation (changes will 
     soon be part of the specification)
   * Added vech() and xpnd() utility functions
   * Included data file of 106th Senate roll call votes for the
     MCMCirt1d() and MCMCirtKd() models
   * Added Dirichlet, Noncentral Hypergeometric, and Inverse Gamma
     generators and densities [with contributions from Kevin Rompala]
   * Added read.Scythe() function to read matrices written by Scythe
     [contributed by Kevin Rompala]
   * Added helper functions to make coding easier [contributed by
     Kevin Rompala]
   * Added three models: a K-dimensional item response theory
     model (MCMCirtKd), a linear factor model (MCMCfactanal), and
     an ordinal item response theory model (MCMCordfactanal)
   * Added a pre-processor command to handle ininf() compilation
     issues on SGI [thanks to Dave Henderson]
   * All MCMC* functions now only allow starting values for the
     first simulated block of parameters and use check.parameters()
     function.
   * Range checking is turned off in the compiled C++ code, yielding
     significant speed gains for most models.

0.3-10 to 0.3-11
   * Fixed a bug in MCMCpoisson() re: non-negative counts
   * Included a data file of Supreme Court votes for the
     MCMCirt1d() model [thanks to Simon Jackman for the suggestion]
   * Fixed memory leak caused by Scythe_Matrix.cc [thanks to Dan Pemstein]
