Commit Graph

41 Commits (5b72a3041c4a25ade8fd5d39e36729db59b12822)

Author SHA1 Message Date
Stéphane Adjemian (Guts) 5b72a3041c
Use new unit tests interface. 2023-01-02 22:58:20 +01: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 236c69dac4
Testsuite: increase tolerance (again) in unitary tests for prior_draw.m 2021-10-01 17:39:57 +02:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Johannes Pfeifer 7541b1b116 prior_draw.m: cosmetic fix 2021-05-27 16:46:40 +02:00
Sébastien Villemot d8cd55109c
Testsuite: increase tolerance in unitary tests for prior_draw.m 2020-02-04 21:25:16 +01: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
Houtan Bastani f60945facc fix copyright dates 2016-03-11 16:22:42 +01:00
Stéphane Adjemian (Lupi) 08375e7ba6 Fixed wrong ordering of the hyperparameters when walling the routine for drawing random deviates from the Weibull distribution. 2016-03-04 16:45:06 +01:00
Stéphane Adjemian (Charybdis) e53f3a67fa Fixed unit test for prior_draw routine. 2015-12-14 23:50:56 +01:00
Stéphane Adjemian (Charybdis) 29a0765a48 Removed globals from prior_draw routine.
When initializing the persistent variables, bayestopt_ and
options_.prior_trunc need to be passed as input arguments.
2015-12-14 23:50:56 +01:00
Stéphane Adjemian (Charybdis) 88858a1fde Cosmetic change.
Use logicals instead of 0/1.
2015-12-11 19:11:47 +01:00
Stéphane Adjemian (Charybdis) a1aa2bcd6e Changed second input of prior_bounds routine.
Do not pass options_ structure but only the required field (prior_trunc).
2015-12-11 18:50:54 +01:00
Stéphane Adjemian (Charybdis) a859861e19 Fixed Bug.
Forgot to rename calls to the routine generating Weibull deviates.
2015-12-04 18:42:26 +01:00
Stéphane Adjemian (Charybdis) 5fb1b1cc23 Added Weibull prior. 2015-12-04 14:50:44 +01:00
Johannes Pfeifer 2620322122 Cosmetic improvements in prior_draw.m 2015-07-28 15:37:00 +02:00
Johannes Pfeifer 8b49b30f91 Add unit tests for prior sampling 2015-07-24 16:32:05 +02:00
Johannes Pfeifer b5aeefe526 Make prior_draw.m check for uniform distribution violation of bounds
Follows the logic for all other distributions
2015-07-24 16:23:40 +02:00
Johannes Pfeifer 560d9719db Correct copy and paste mistake in prior_draw.m for inverse gamma II
In case of bound violations, it was instead sampled from inverse gamma I
2015-07-24 15:59:40 +02:00
Stéphane Adjemian (Karaba) f48566aeae Fixed prior bounds (according to the doc in master branch).
* Second  and  third  positional  arguments  after the  name  of  the
   estimated  parameter   in  the  estimated_params   block  are  only
   considered in the optimization stage (not in the MCMC)

 * Do not  store bounds  in bayestopt_, because  bounds do  not always
   reflect restrictions implied by prior shapes.

 * prior_bounds routine  returns a structure  (with fields lb  and ub)
   instead of a matrix.
2014-10-20 16:18:54 +02:00
Sébastien Villemot 02652f6eb8 Updated copyright notices 2011-02-04 17:27:33 +01:00
Stéphane Adjemian (Scylla) bc155fd0df Changed calling sequence of prior_draw.m. 2010-09-03 15:23:05 +02:00
sebastien 502e3e1df8 Beautified MATLAB code (Unix newline convention + Emacs indentation), except: AIM, swz, particle
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3250 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-12-16 17:17:34 +00:00
ratto 20a469cfcf Fixed to allow truncated priors.
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3028 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-10-09 08:10:52 +00:00
stepan ff38cbdd5d Bug fix.
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2562 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-07 11:13:43 +00:00
stepan aa31417a05 Efficiency & Cosmetic changes related to the design of bayestopt_ and
the computation of the prior density.

bayestopt_.p1 is always the prior mean
bayestopt_.p2 is always the prior standard deviation
bayestopt_.p3 is unchanged
bayestopt_.p4 is unchanged
bayestopt_.p5 [new field] is the prior mode
bayestopt_.p6 [new field] is the first hyper-parameter of the prior density
bayestopt_.p7 [new field] is the second hyper-parameter of the prior density
 
These fields are defined in  set_prior and are never changed after. In
the previous version of Dynare,  the hyper parameters of the densities
were  updated at  each iteration  of the  optimization routine  or the
metropolis.

Removed fields pmean and pstdev.

Vectorized the code in priordens.

Fixed the bug mentionned by Gianni. If a (logged) density is evaluated
outside the  prior domain, the  output of priordens if  minus infinity
(instead of a complex number).


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2556 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-06 14:38:37 +00:00
stepan 0bb00c71eb v4.1::
+ Added new file for prior sampling (prior_sample.m). 
+ Undo previous change on prior_draw.m (transposition of pdraw).
+ Bug correction in prior_draw.m.
+ Added field in options_: the default number of mc simulations in the
prior distribution.


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2431 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-02-19 16:27:04 +00:00
stepan 476e2d847f v4.1:: Transposition of the output argument. pdraw is a column vector.
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2429 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-02-18 11:19:29 +00:00
stepan 95b5c69c35 v4.1::
+ Removed input arguments 2 and 3.
+ Removed the prior bounds.


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2426 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-02-17 20:07:37 +00:00
stepan 74c8e53140 v4.1:: Vectorization of the prior sampling algorithm.
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2424 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-02-17 17:21:05 +00:00
sebastien b61c9e6a69 v4 matlab:
* added preprocessor support for inverse gamma of type 2
* added support for this distribution in prior_bounds.m and rndprior.m
* other cosmetic changes


git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1983 ac1d8469-bf42-47a9-8791-bf33cf982152
2008-08-05 10:48:04 +00:00
sebastien f76badf151 v4 matlab: rreplaced beta_rnd.m and gamm_rnd. by GPL'ed custom ones
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1980 ac1d8469-bf42-47a9-8791-bf33cf982152
2008-08-05 09:07:02 +00:00
sebastien db50368418 v4 matlab: fixed some existing copyright headers (and some other minor header issues)
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1974 ac1d8469-bf42-47a9-8791-bf33cf982152
2008-08-01 12:40:33 +00:00
michel 8b841cda0b v4: corrected bug in prior_draw.m (inv-gamma2)
reindented priordens.m

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1816 ac1d8469-bf42-47a9-8791-bf33cf982152
2008-05-02 04:55:06 +00:00
assia f766304d9e header updated
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1638 ac1d8469-bf42-47a9-8791-bf33cf982152
2008-01-21 17:16:02 +00:00
ratto 11da7c6eb2 Needs persistent p1 and p2;
global estim_params abd bayestopt_.
Debugged generalised beta prior.
index (i) missing somewhere


git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1104 ac1d8469-bf42-47a9-8791-bf33cf982152
2006-11-27 14:07:57 +00:00
michel 9bf2af2a17 v4 prior_draw.m new version
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1039 ac1d8469-bf42-47a9-8791-bf33cf982152
2006-11-05 13:43:05 +00:00
adjemian 22e0f21220 Draws a vector of candidate deep parameters in the joint prior density. B&K conditions have to be tested on each draw...
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@999 ac1d8469-bf42-47a9-8791-bf33cf982152
2006-10-28 13:25:20 +00:00
adjemian 897a084881 New functions. posterior draws used after the metropolis (forecasts, irfs, moments) are built and saved just after the call to metropolis.m
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@964 ac1d8469-bf42-47a9-8791-bf33cf982152
2006-10-10 19:37:26 +00:00