rmdcev v1.3.3 (Release date: 2026-07-20)
==============

New features:
- GenerateMDCEVData() now supports model = "gamma1", matching the "gamma1" specification
  already available in mdcev(). Sets alpha_0 = 1 and alpha_j = 0 so simulated data has no
  income effects.
- The low-level compiled simulation functions are now exported and documented:
  DrawError_rng(), MarshallianDemand(), HicksianDemand(), ComputeUtilJ(), CalcWTP_rng() and
  CalcMarshallianDemand_rng(), together with the RNG helpers rmdcev_get_rng() and
  rmdcev_get_stream(). Most users should continue to call mdcev.sim() instead.

Bug fixes:
- Fixed GenerateMDCEVData() always returning identical output regardless of R's RNG state.
  The internal Stan PRNG seed was hardcoded as 3L; it now draws from R's RNG via
  sample.int(.Machine$integer.max, 1L), so set.seed() controls reproducibility as expected.
- Fixed print(summary()) for "gamma1" models, which previously printed no model note
  explaining the alpha restrictions.
- Fixed the error message in GenerateMDCEVData() for an unrecognised model: it was
  misspelled ("specificied") and did not list the valid choices.

Compatibility:
- Removed the pre-generated src/SimulationFunctions.cpp from the package sources. It is now
  regenerated by rstantools at install time via configure/configure.win. The checked-in copy
  was produced by an older stanc and hand-edited, and would not compile against the Stan C++
  headers in the forthcoming rstan 2.39.0. Thanks to Andrew Johnson (@andrjohns, #11).
- Replaced non-ASCII em dashes in inst/stan/SimulationFunctions.stan comments, which caused
  stanc to fail under the rstan backend.

Documentation:
- README now recommends pak::pak() rather than devtools::install_github() for installing the
  development version.
- Documented that mdcev.data() accepts income = NULL for the "gamma1" model, which has no
  income effects and needs no income data.

Tests:
- Relaxed the precision of several snapshot values (choice, lc, simulations) that were
  sensitive to platform-specific optimizer output.
- Skipped the gamma1 parameter recovery test, whose convergence is seed- and
  platform-sensitive; gamma1 remains covered by the welfare and alpha-matrix tests.

rmdcev v1.3.2 (Release date: 2026-05-08)
==============

Bug fixes:
- Fixed incorrect delta-method standard errors for alpha parameters. The Jacobian now
  correctly uses p*(1-p) at the constrained value rather than exp(-p)/(1+exp(-p))^2,
  which was treating the constrained alpha as an unconstrained input.
- Fixed Hessian computation when backend = "cmdstanr": the rstan optimizing call used
  for Hessian extraction is now initialised at the cmdstanr optimum (par_list) instead
  of a potentially different starting point, ensuring the Hessian is evaluated at the
  same mode.
- Fixed crash in coef.mdcev() when called on Bayesian fitted objects. The function now
  returns an informative error directing users to summary() for Bayes posteriors.

API changes:
- Boolean arguments to mdcev() now accept TRUE/FALSE instead of 1/0. Affected arguments:
  fixed_scale1, single_scale, trunc_data, gamma_ascs, keep_loglik,
  jacobian_analytical_grad, gamma_nonrandom, alpha_nonrandom.
- Boolean arguments to mdcev.sim() now default to TRUE/FALSE: cond_err, draw_mlhs.
- seed argument default changed from "123" (character) to 123L (integer).
- backend argument is now an explicit named parameter in mdcev() rather than being
  passed via ....

Internal changes:
- processMDCEVdata() now copies model options to stan_data via explicit key assignment
  rather than a bulk list merge, preventing accidental inclusion of non-Stan fields.
- BayesMDCEV() index construction (start/end) replaced with direct arithmetic.
- StanSimulate() collapsed from four copy-pasted purrr::pmap branches into a single
  parameterised call.
- .build_lc_init() extracted as a private helper from maxlikeMDCEV() for latent class
  initialisation.
- .compute_corr_tau() vectorised using a 3D array and vapply instead of group_split
  and mapply.

rmdcev v1.3.1 (Release date: 2026-05-07)
==============

New features:
- Added "gamma1" model specification that fixes alpha_0 = 1 (no income effects). The numeraire
  utility is linear (U_0 = psi_0 * x0), so the shadow price of income is constant and
  non-numeraire demands do not depend on income. Non-numeraire alphas are fixed at 0, making
  this a restricted variant of the gamma model. Supported for MLE and Bayesian estimation,
  and for welfare simulation (Marshallian and Hicksian demand).
- Added psi_random argument to mdcev() for Bayesian random-parameter models. Allows the user
  to specify which psi formula terms should be treated as random coefficients (individual-
  specific draws) versus fixed (pooled) point estimates. Only applicable when
  algorithm = "Bayes" and random_parameters is "uncorr" or "corr".

Bug fixes:
- Fixed typo in StanSimulate.R: scale_sim renamed to scale_sims for consistency.

Tests:
- Added parameter recovery tests for gamma and hybrid0 models.
- Added parameter recovery tests for kt_ee model.
- Added test files for random-parameter models (test-rp.R, test-rp-correlated.R)
  and for the psi_random feature (test-psi-random.R).


rmdcev v1.3.0 (Release date: 2026-02-20)
==============

- major update to code
- added cmdstanr backend option
- removed global variable flags
- refactored code base for consistency


rmdcev v1.2.6 (Release date: 2024-03-01)
==============

- update array synatax with new rstan version
- fix test error on linux

rmdcev v1.2.5 (Release date: 2021-XX-XX)
==============

- add check for unique id's
- fix error with use of single_scale and latent class welfare

rmdcev v1.2.4 (Release date: 2020-09-30)
==============

- move to R 4.0 requirement
- add single_scale option for lc models
- Default to scale starting value as 1
- fix issue with non-"id" id.var for data.check

rmdcev v1.2.3 (Release date: 2020-09-15)
==============

- fix solaris compile issue


rmdcev v1.2.2
==============

- fix error in unconditional welfare calculations
- add additional tests

rmdcev v1.2.1
==============

- fix alt_name issue if alternatives not named alt
- fix phi / gamma naming in summary for random parmater models
- change default n_draws for non mvn to 0.
- fix phi error in GenerateMDCEVData
- fix prior_phi_sd issue
- remove stringr/tidyselect as dependencies
- changed hybrid0 to use log(numeraire) in utility function

rmdcev v1.2.0 (Release date: 2020-08-12)
==============

Changes:

Major changes as part of R Journal revision

** Added estimation and simulation capabilities for environmental economics KT formulation (von Haefen and Phaneuf, 2005)
** Changed psi argument of formula to incorporate alternative-specific constants for psi by default
** Changed default prior distribution for alpha parameter (beta(1,1) which is uniform(0,1) on transformed scale)
** Reformulated GenerateMDCEVData to accept income, price, dat_psi, and dat_phi data
** User can now set starting values for LC model
** default standard errors is now deltamethod
** revised dependcies to reflect new rstan requirements
** vignette coming soon

rmdcev v1.1.2 (Release date: 2019-11-22)
==============

Changes:

** reconfigure package to fit with rstantools
** Fix bug to allow Hessian = FALSE **


rmdcev v1.1.1 (Release date: 2019-11-22)
==============

Changes:

** Minor changes to be compatible with rstan 2.21 **


rmdcev v1.1.0 (Release date: 2019-10-15)
==============

Changes:

** Major change to function names and data input **

* Changed function name FitMDCEV to mdcev
* Changed function name SimulateMDCEV to mdcev.sim
* All summary functions can now be called with summary(.)
* Created new data object mdcev.data


rmdcev v1.0.0 (Release date: 2019-07-15)
==============

Changes:

* Added RP-MDCEV demand and welfare simulations
* Fixed error in LC-MDCEV simulations


rmdcev v0.8.0 (Release date: 2019-06-06)
==============

Changes:

* Changed model names to reflect Bhat (2008)
Old names -> New names
les -> gamma
alpha -> alpha
gamma -> hybrid
gamma0 -> hybrid0
