Commit Graph

34 Commits (7cdb09991fec17548ee1825b8400524d8d0363ce)

Author SHA1 Message Date
Sébastien Villemot 441ef7e102 Merge branch 'fixes_6.x' into 'master'
collection of small individual bug fixes

See merge request Dynare/dynare!2223
2023-12-14 09:12:42 +00:00
Marco Ratto f102a992aa fixed for the case when mcmc is incomplete WITHIN a block file (useful for expensive models and expensive methods like slice or TaRB) 2023-12-13 21:01:21 +01:00
Marco Ratto aad5c36081 bug fix: with option mh_initialize_from_previous_mcmc, we need also to check if some prior changed, which may lead last draw in previous mcmc falling outside new prior bounds. 2023-12-13 21:01:09 +01:00
Stéphane Adjemian (Ryûk) 60c0ed0180
Add Sequential Monte Carlo sampler. 2023-12-13 15:30:38 +01:00
Johannes Pfeifer 3a115d4fcc Remove full oo_ input from likelihood functions 2023-10-02 09:48:34 +02:00
Johannes Pfeifer e65662151f Eliminate set_dynare_seed.m calls with globals 2023-09-28 17:00:21 +02:00
Willi Mutschler a41fbdefbc
estimation: more flexible handling of displayed string in command window
Also removed estim_params_ as unused input argutment to CutSample
2023-09-19 13:26:33 +02:00
Willi Mutschler 960c075420
Replace "Estimation::mcmc::" by a variable
This enables re-using estimation functions for other Bayesian estimation routines such as Bayesian method_of_moments and printing it nicer to the console.
2023-09-07 09:36:27 +02:00
Johannes Pfeifer 8532d6abd7 Cosmetic changes to various estimation routines 2023-07-13 14:40:01 -04:00
Johannes Pfeifer e6c43c2a29 load_last_mh_history_file: make sure number of blocks and parameters matches loaded files 2023-07-13 14:39:50 -04:00
Stéphane Adjemian (Ryûk) 015513380f
Add new class for priors.
This commit only changes the routine used to draw random deviates from
the prior distribution, without relying on persistent variables (which allows
parallelisation).
2023-04-26 10:39:13 +02:00
Johannes Pfeifer 9de0688cfe Make default jscale depend on number of estimated parameters
Related to https://git.dynare.org/Dynare/dynare/-/issues/1849
2022-12-03 16:00:27 +01:00
Johannes Pfeifer df09084a89 posterior_sampler_initialization.m: save missing ProposalCovariance for mh_recover 2022-07-28 11:12:18 +02:00
Sébastien Villemot 10af04c6d8
Use Unicode copyright symbol (in UTF-8 encoding) in all source files
It is now supported by the MATLAB editor (as of R2022a).

The old ASCII notation is left in some files that we copy as-is from other
sources (e.g. in the contrib/ and m4/ subdirectories).

The particles submodule is not updated at this point, because it is in an
inconsistent state.

[skip ci]
2022-04-13 14:54:25 +02:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Marco Ratto a0f2b2399b
New option mh_initialize_from_previous_mcmc that allows to pick initial values for a new MCMC from a previous one
If an additional parameter is estimated, it is initialized using prior_draw.
2021-05-11 18:48:43 +02:00
Johannes Pfeifer fa739c3a63 posterior_sampler_initialization.m: update record if different sampler is used
Also removes redundant field
2021-01-22 15:01:23 +01:00
Johannes Pfeifer c78890d5ca posterior_sampler_initialization.m: Allow running different samplers after each other
Transform error to warning
2021-01-22 15:01:22 +01:00
Johannes Pfeifer 32bdb82cf8 Make load_mh_file honor use_mh_covariance option 2021-01-22 15:01:02 +01:00
Johannes Pfeifer 9e5cb1422d
Save jscale to record structure before running MCMC
Useful in conjunction with mh_tune_jscale in cases where the posterior sampler crashes
2020-02-29 10:28:50 +01:00
Sébastien Villemot 49dc997073
Global reindentation of MATLAB code (excluding submodules)
Also convert to Unix end-of-lines, and remove trailing whitespaces.
2019-12-20 16:30:27 +01:00
Marco Ratto da4baa5d50 make mh_recover robust to crashed parallel jobs 2019-12-12 22:24:30 +01:00
Johannes Pfeifer d4ed77c67e posterior_sampler_initialization.m: provide missing function input
Fixes #1622
2019-09-06 23:03:07 +02:00
Marco Ratto 47900a5909 trap slice sampler when doing mh_recover
(cherry picked from commit 4ba9c9296f1939fa14b1401886d9e9b86541e5e3)
2019-01-17 09:50:07 +00:00
Stéphane Adjemian (Charybdis) 5417b27ac7 Fixed indentation of matlab files. 2017-05-16 15:10:20 +02:00
Stéphane Adjemian (Charybdis) a53636e24e Fixed copyright notices. 2017-05-16 14:11:15 +02:00
Stéphane Adjemian (Charybdis) 88e1701289 Removed useless commas and semicolons. 2017-05-16 13:24:46 +02:00
Marco Ratto 0a40cdf064 Bud fix for cases where record does not contain proposal covariance. 2016-11-07 17:18:41 +01:00
Johannes Pfeifer 7ff6c5b2b7 Cosmetic change to posterior_sampler_initialization.m 2016-10-03 22:10:00 +02:00
Johannes Pfeifer b3877b3a9e Save chain's proposal density and make load_mh_file and mh_recover load it
Closes #504
2016-06-14 15:09:05 +02:00
Marco Ratto 7b3c42c6e1 provisions for reworked posterior sampling options:
- handle sub lists of individual samplers
- split checks in dynare_estimation_init.m and before running posterior_sampler.m [invhess checks]
- posterior sampler options checks moved from initial_estimation_checks.m to check_posterior_sampler_options.m
- added use_mh_covariance_matrix to imh and rwmh
- slice re-sets mode_compute=0 cova_compute=0
- updated test function
2016-05-19 14:37:05 +02:00
Marco Ratto 4445f17efa Manual merge with commit history of metropolis_hastings_initialization.m and random_walk_metropolis_hastings_core.m 2016-05-19 14:34:09 +02:00
Marco Ratto 357e3c2ac7 Make posterior_sampler_initialization.m compatible with new form of prior_draw.m 2016-05-19 14:34:09 +02:00
Marco Ratto c30b6f20a6 Added routines that factor out posterior samplers into the iteration routine posterior_sampler_iteration.m.
It generalizes the random_walk_metropolis_hastings.m structure but adds two new items:
- check_posterior_sampler_options.m which is a wrapper for method specific options (stored in options_.posterior_options)
- posterior_sampler_iteration.m which is a wrapper of the individual iteration of any posterior sampler.

It already embeds, with parallelization implementation:
- random_walk metropolis hastings
- independent metropolis hastings
- slice sampler

It also contains a quick fix for TARB, although the latter should be embedded in posterior_sampler_iteration.m as well.

Any new posterior sampler can be simply added to posterior_sampler_iteration.m, with  wrapper to specific iterations in check_posterior_sampler_options.m
2016-05-19 14:34:09 +02:00