Commit Graph

7111 Commits (beb7d42d748f9f0f5216ed7aca93dceb4f73df2c)

Author SHA1 Message Date
Houtan Bastani cf0d8f319e
remove extra whitespace 2019-01-18 14:09:40 +01:00
Houtan Bastani 3293ff62c1
handle nested UnaryOpNodes in OLS-style equations 2019-01-18 11:50:10 +01:00
Houtan Bastani 0badb00687
handle AR(1) with no parameter 2019-01-17 18:57:24 +01:00
Houtan Bastani cfd9eff6fb
simplify common parsing 2019-01-17 18:06:43 +01:00
Houtan Bastani b62ec7dc55
handle hard-coded constant*variable in AR(1) 2019-01-17 18:06:36 +01:00
Houtan Bastani 4c133ac23a
olsgibbs: small fixes 2019-01-16 14:53:22 +01:00
Houtan Bastani 556b5b6e88
small change to avoid an extra conditional 2019-01-16 14:53:22 +01:00
Houtan Bastani 4dbbdb2c09
move common dates to parsing function 2019-01-16 14:53:22 +01:00
Houtan Bastani ee8e8c4282
small simplification 2019-01-16 14:53:22 +01:00
Houtan Bastani 0fb88114c1
rename functions and change error message to be more general is parsing is shared between several different functions 2019-01-16 14:53:22 +01:00
Houtan Bastani bb9418a473
dyn_ols: only one output from function, remove varargout 2019-01-16 14:53:21 +01:00
Houtan Bastani 03eaac8b6d
make plot_contributions use get_ast_jsonmodel 2019-01-16 14:53:21 +01:00
Houtan Bastani 9a61c57102
remove functions that are no longer used 2019-01-16 14:53:21 +01:00
Houtan Bastani f755cfdcd4
surgibbs: small fixes 2019-01-16 14:53:21 +01:00
Houtan Bastani 3247b1aa02
pooled_fgls: fix and update 2019-01-16 14:53:21 +01:00
Houtan Bastani e4dc7c403e
parse residual information 2019-01-16 14:53:21 +01:00
Houtan Bastani 72081e640e
pooled_ols: fix dates 2019-01-16 14:53:20 +01:00
Houtan Bastani efe0a15e0e
comment out code 2019-01-16 14:53:20 +01:00
Houtan Bastani 9ed97b88c1
account for potentially differing number of observations per equation when creating SUR matrices 2019-01-16 14:53:20 +01:00
Houtan Bastani a7181a8151
fix common parsing function to impose same dates per equation 2019-01-16 14:53:20 +01:00
Houtan Bastani 3427d93c09
add comment to function 2019-01-16 14:53:20 +01:00
Houtan Bastani 5d80fc903b
pooled_ols: fix up and use common parsing 2019-01-16 14:53:20 +01:00
Houtan Bastani 1e41235b6b
common parsing: small fixes 2019-01-16 14:53:19 +01:00
Houtan Bastani 934a22c3a7
sur: small fixes 2019-01-16 14:53:19 +01:00
Houtan Bastani ef391b1304
surgibbs: fix up and make work with sur changes 2019-01-16 14:53:19 +01:00
Houtan Bastani f8c0282b01
sur: fix up and use common code to create matrices 2019-01-16 14:53:19 +01:00
Houtan Bastani d8f26525b0
olsgibbs: fix up and use common parsing functions 2019-01-16 14:53:19 +01:00
Houtan Bastani a477075825
ols: further simplifications 2019-01-16 14:53:19 +01:00
Houtan Bastani a35fd291c5
ols: move json file parsing to a separate file 2019-01-16 14:53:19 +01:00
Houtan Bastani 013124eedf
ols: move parsing to a helper function 2019-01-16 14:53:18 +01:00
Houtan Bastani 093dd493d8
ols: catch unexpected case 2019-01-16 14:53:18 +01:00
Houtan Bastani 7d35cb5c5a
fix typo 2019-01-14 15:02:32 +01:00
Houtan Bastani e8333421e7
remove unnecessary file 2019-01-10 10:44:19 +01:00
Stéphane Adjemia (Scylla) 3bc6b34161
Bug fix.
Be agnostic about the name of the PAC model.
2019-01-07 13:33:08 +01:00
Stéphane Adjemia (Scylla) c829e7968d
If possible define boundaries for the share of optimizing agents in PAC/NLS.
The parameter is constrained to be in (0,1) for the following algorithms

 - lsqnonlin (without Levenberg-Marquardt)
 - fmincon
 - annealing
 - particleswarm

Other algorithms do not allow the definition of boundaries... We should add a
penality function to the objective for these algorithms.
2018-12-19 16:05:34 +01:00
Stéphane Adjemia (Scylla) df57bf7eb9
Fixed bug.
PAC/NLS routine was only working if the PAC model was named `pacman`.
2018-12-19 16:00:57 +01:00
Stéphane Adjemia (Scylla) 11b24a0663
Add a constraint on the share of optimizing agents PAC/Iterative OLS.
Ensure that the parameter value lies betwwen 0 and 1.
2018-12-19 15:43:36 +01:00
Stéphane Adjemia (Scylla) c0570ff0af
Fixed typo. 2018-12-19 15:41:32 +01:00
Stéphane Adjemia (Scylla) 23e37e45c4
Cosmetic change.
create a namespace for each {VAR/PAC} expectation model.
2018-12-19 11:43:26 +01:00
Stéphane Adjemia (Scylla) 351da3b865
Do not update a dseries object, but instantiate a new object. 2018-12-19 10:53:09 +01:00
Stéphane Adjemia (Scylla) 4775bca073
Fixed ordering of the columns of the Companion matrix...
For the level representation of the trend component model.
2018-12-14 17:37:35 +01:00
Stéphane Adjemia (Scylla) 2cff485113
Fixed bug in the routine evaluating the (PAC/VAR) expectations. 2018-12-14 17:29:46 +01:00
Stéphane Adjemia (Scylla) 38c8462142
If NLS, do not check the ordering of estimated parameters in PAC. 2018-12-12 16:28:19 +01:00
Houtan Bastani 44e5a88ddd
dyn_ols: use AST instead of regex to parse equations 2018-12-07 19:54:32 +01:00
Stéphane Adjemia (Scylla) cb4384bb27
Create on the fly a routine for evaluating the (VAR/PAC) expectations.
The routine takes a dseries object as unique argument and return an updated
object with the expectation term.

If the mod file is named `example.mod` and if the (VAR/PAC) expectation model is
named `toto`, then after

var_expectation.print('toto');

the expectation term can be evaluated:

ts = example.var_expectations.evaluate_varexp(ts);

where ts is a dseries object containing all the time series appearign in the
auxiliary (var or trend_component).
2018-12-03 15:07:43 +01:00
Stéphane Adjemia (Scylla) 53ab321de8
Added the possibility to use linear expressions in VAR_EXPECTATION_MODEL.
See tests/var-expectations/9/example.mod for a self documented example.

Also updated all the integration tests using the option `expression` instead of
`variable` (which is deprecated and will be removed at some point).
2018-11-30 23:36:06 +01:00
Stéphane Adjemia (Scylla) 650c78f99d
Merge branch 'master' into ecb-master 2018-11-30 21:34:56 +01:00
Stéphane Adjemia (Scylla) d501d6d511
Added interface to lsqnonlin (Mathworks' optimization toolbox) in pac.estimate.nls. 2018-11-29 10:29:55 +01:00
Stéphane Adjemia (Scylla) c79be57447
Fixed definition of h (PAC expectation reduced form). 2018-11-27 10:05:40 +01:00
Stéphane Adjemia (Scylla) e6c716ae9b
Added the possibility to use Gauss-Newton in pac/nls.
Also added the computation of the covariance matrix of the NLS estimator (using
White and Domovitz approach) and integration test.
2018-11-26 09:53:18 +01:00
Stéphane Adjemia (Scylla) 139c58dd76
Added Gauss Newton algorithm for minimizing sum of squared residuals. 2018-11-26 09:48:50 +01:00
Sébastien Villemot efec664667
Preprocessor update + corresponding change in parameters derivatives
In the *_params_derivs.m files, in the "hp" matrix, the preprocessor now fully
outputs the symmetric elements, so getH needs to be adapted.

By the way, also clean up code for "rpp" and "gpp", were full symmetric
elements were also already present (and therefore do not need to be duplicated
in getH).
2018-11-22 17:53:39 +01:00
Stéphane Adjemia (Scylla) cf35496c06
Fixed bug in the evaluation of the sum of squared residuals (PAC/NLS). 2018-11-21 15:21:23 +01:00
Stéphane Adjemia (Scylla) 7d2d0d6590
Added the possibility to estimate the share of optimizing agents by iterative OLS (PAC). 2018-11-21 15:07:15 +01:00
Sébastien Villemot 635aa65665 Merge branch 'ident_plot_bug' into 'master'
identification_analysis.m: Fix bug introduced in 60d95b65f2

See merge request Dynare/dynare!1637
2018-11-16 16:21:14 +00:00
Johannes Pfeifer b615d2d795 identification_analysis.m: Fix bug introduced in 60d95b65f2
We already used a variable called offset
2018-11-16 16:20:27 +01:00
Johannes Pfeifer 4ecbcbb136 evaluate_steady_state_file.m: Remove redundant setting of auxiliary variables
The original problems seems to have been fixed by #1133

Essentially reverts 3c7e60b744 and closes #1175
2018-11-16 14:12:55 +01:00
Johannes Pfeifer f947a31b80 evaluate_steady_state_file.m: fix two bugs in debugging mode 2018-11-16 09:24:43 +00:00
Johannes Pfeifer 60d95b65f2
Identification strength: make plotting consistent
1. Rely on actually computed standard deviations in bayestopt_ instead of potentially unset estim_params_
2. Remove arbitrary normalizations/omitted normalization in case of division by 0 in normalization
3. Distinguish between 0 identification and division by 0 due to normalization in plots

(cherry picked from commit 7341e21a381850c47fbed018bf6a7acdda4fa92e)
2018-11-16 10:17:30 +01:00
Sébastien Villemot ad451ad224 Merge branch 'prior_dens_info' into 'master'
Deal with info returned by priordens being a vector

See merge request Dynare/dynare!1629
2018-11-15 09:39:11 +00:00
Sébastien Villemot 513f3ec68e Merge branch 'evaluate_steady_state' into 'master'
evaluate_steady_state.m: consistently use params

Closes #1627

See merge request Dynare/dynare!1630
2018-11-15 09:22:09 +00:00
Johannes Pfeifer 30361ccb49 GSA scatter plots: Correctly pass LaTeX-names to figure 2018-11-14 18:37:54 +01:00
Johannes Pfeifer 022913579a map_calibration.m: Fix bug that prevented display of restrictions 2018-11-14 18:37:05 +01:00
Johannes Pfeifer c16c2fb894 evaluate_steady_state.m: consistently use params
Prevents erroneously relying on stale parameters from M.params (thanks to Tom Holden); closes #1627
2018-11-14 16:01:55 +01:00
Johannes Pfeifer 09a166f4e7 Revert "adding missing any()"
This reverts commit a5b97a28a0.
2018-11-14 15:04:27 +01:00
Johannes Pfeifer c1b0bb5ee3 initial_estimation_checks.m: Turn vector info into scalar
Related to a5b97a28a0 that needs to be reverted
2018-11-14 15:02:15 +01:00
Sébastien Villemot 18faa9733c
Further updates related to minimal MATLAB version bump 2018-11-13 18:29:20 +01:00
Sébastien Villemot 7a75872f72
Modernization: use tilde (~) syntax for ignored output arguments 2018-11-13 18:02:09 +01:00
Sébastien Villemot ce49cd95df
Add missing iscolumn and ismatrix for MATLAB < R2010b
Also fix a bug in isrow (it was not checking the rank of the array).
2018-11-13 16:59:27 +01:00
Sébastien Villemot 736d43c4e6
Bump minimal MATLAB version requirement to 7.9 (R2009b) 2018-11-13 15:59:16 +01:00
Sébastien Villemot 096936be9c
The preprocessor now compiles the MEX when use_dll is specified
Update documentation accordingly (except on macOS where the solution has not
yet been implemented).

Also include MinGW in the Windows installer.
2018-10-29 14:41:34 +01:00
Sébastien Villemot cc4183d3a5
Fix for recent MATLABs under Windows 2018-10-26 15:02:26 +02:00
Sébastien Villemot 8cb51e26e6
options_.instruments is now a cell array
This fixes crashes under Octave (while MATLAB seems to accept array-indexing
with cell arrays).
2018-10-25 15:01:53 +02:00
Stéphane Adjemia (Scylla) dcea7514d9
Merge branch 'master' into ecb-master 2018-10-24 18:31:31 +02:00
Houtan Bastani 8a2c38cf6c olsgibbs: save fitted values in dataset; allow use of dictionary as in dyn_ols 2018-10-24 17:17:01 +02:00
Stéphane Adjemia (Scylla) 510bc2e299
Removed unused variable. 2018-10-24 12:08:00 +02:00
Stéphane Adjemia (Scylla) 1c1a3ea0a4
Removed tests on targets.
A target does not need to be a random walk. Also added a new integration
test (where the target is a constant, 0).
2018-10-24 12:06:14 +02:00
Stéphane Adjemia (Scylla) a53c63d6d5
Added routines to print PAC_EXPECTATION and VAR_EXPECTATION in files.
Each new routine pac.print() and var_expectation.print(), creates two files
that can be included (using the macro language) in a mod file. The first
file, {pac,var}expectationmodename-parameters.inc saved under
{M_.fname}/model/{pac,var}expectationmodel, contains the declaration of the
parameters created for the expanded (var or pac) expectation model, with
calibrated values. The second file, {pac,var}expectationmodename-parameters.inc
saved in the same subfolder, contains the expanded version of the (pac or var)
expectation term as a linear combination of the variables in the companion
representation of the expectatino model.
2018-10-14 16:57:51 +02:00
Stéphane Adjemia (Scylla) e5317b17de
Cosmetic change. 2018-10-06 17:52:58 +02:00
Stéphane Adjemia (Scylla) 108854a484
Bug fix. verbosity option was not honoured in simplex algorithm (8).
Thanks to Reuben for reporting.
2018-10-06 17:50:37 +02:00
Stéphane Adjemia (Scylla) dfafe86246 Save teh posterior mean of the slope parameters as a column vector. 2018-10-06 16:55:42 +02:00
Stéphane Adjemian (Charybdis) 82187f9d41
Fixed olsgibbs routine. 2018-10-06 16:08:28 +02:00
Stéphane Adjemian (Charybdis) 798aaaa968
Cosmetic change. 2018-10-04 23:17:49 +02:00
Houtan Bastani ee2ad1ee15 olsgibbs: linear regression with Gibbs sampler 2018-10-04 17:12:47 +02:00
Houtan Bastani 57bf291c00 add comment 2018-10-04 17:12:47 +02:00
Stéphane Adjemian(Charybdis) ae71599292
Switch to new get_companion_matrix routine. 2018-09-28 19:27:17 +02:00
Stéphane Adjemian(Charybdis) bbbaabc702
Cosmetic change. 2018-09-28 12:26:59 +02:00
Michel Juillard 3ad654b9b8
Allowing for different number of periods in conditional_forecast_path.
Updated preprocessor submodule.
2018-09-27 18:58:24 +02:00
Stéphane Adjemian(Charybdis) 07141a8681
Various optimizations. 2018-09-26 22:51:05 +02:00
Stéphane Adjemian(Charybdis) 7c83ba7ea7
Fixed documentation header. 2018-09-26 22:51:05 +02:00
Houtan Bastani 973c3955f0 adjust for ‘targets’ keyword instead of ‘trends’ 2018-09-25 14:58:36 +02:00
Houtan Bastani 974bcd92ae Merge branch 'ecb-master' into ecb-master-targets 2018-09-25 14:41:11 +02:00
Houtan Bastani c6d5b09c29 fix typo 2018-09-25 14:39:48 +02:00
Stéphane Adjemian(Charybdis) b3a8062b46
Added missing output. 2018-09-19 17:39:58 +02:00
Stéphane Adjemian(Charybdis) 031e2c87c6
New version of get_companion_matrix + new integration test.
The routine is still buggy. In PAC and VAR_EXPECTATION models we
use get_companion_matrix_legacy routine instead.
2018-09-19 17:39:48 +02:00
Stéphane Adjemian(Charybdis) 2cf6ccdaa5 Updated dseries submodule. 2018-09-18 17:37:37 +02:00
Stéphane Adjemian(Charybdis) 3e6e448134 Updated dates and dseries submodules. 2018-09-14 23:13:13 +02:00
Stéphane Adjemian(Charybdis) 99aadf7d1a Updated m-unit-tests submodule. 2018-09-14 15:37:30 +02:00
Houtan Bastani 62301fa1e9 dyn_ols: fix typo 2018-09-14 15:09:31 +02:00
Stéphane Adjemian(Charybdis) 2518cd9884 Raise error of an optimization algorithm is not available. 2018-09-13 16:16:07 +02:00