Commit Graph

603 Commits (440a0e460bd26a1b773ed3876d430dffb60fe620)

Author SHA1 Message Date
Sébastien Villemot 8065e9d439
Build system: by default, error out if some dependency is missing
In particular, if either MATLAB or Octave is missing, one needs to pass either
--disable-matlab or --disable-octave.

Moreover, several new configure flags have been introduced for disabling some
components:
--disable-doc
--disable-dynare++
--disable-mex-dynare++
--disable-mex-ms-sbvar
--disable-mex-kalman-steady-state
2019-11-26 13:53:42 +01:00
Sébastien Villemot 12d7d8cef2
Testsuite: use XLSX for Octave and MATLAB ≥ R2012a, and XLS for MATLAB < R2012a
In 98bdf76581, all XLSX files were removed in
favour of XLS, for compatibility with MATLAB R2009b.

But this broke the very same tests under Octave, since XLS support is not very
good there.

This commit implements a solution that works everywhere, by using XLSX whenever
possible, and XLS otherwise.
2019-11-19 12:49:01 +01:00
Sébastien Villemot e04ccd9b01
Fix construction of source tarball
Was broken by the previous commit, which renamed some datafile without updating
EXTRA_DIST in tests/Makefile.am.
2019-11-15 22:49:45 +01:00
Sébastien Villemot 56e7144b91
Merge remote-tracking branch 'community/master' into enterprise 2019-10-23 16:30:29 +02:00
Houtan Bastani 43c73a74c8
test for matlab namespace function in steady_state_model block. closes #1639 2019-10-09 16:39:33 +02:00
Houtan Bastani cd83a7790e
add .m files from 4a1b5eccb2 to EXTRA_DIST
[skip ci]
2019-10-09 16:35:32 +02:00
Houtan Bastani 4a1b5eccb2
Support MATLAB namespaces in function calls #1639
shorten test names because adding `_namespace` made some .mod file names too long
2019-10-09 16:22:32 +02:00
Sébastien Villemot 8875ac14d8
Merge remote-tracking branch 'community/master' into enterprise 2019-10-09 12:32:12 +02:00
DoraK 41c66583ac Add linear combination support for growth neutrality in Iiterative OLS. 2019-10-08 23:18:40 +02:00
Sébastien Villemot b3d1e8412b
Add support for mode_compute=1 under Octave
Since version 1.6, the optim Forge package has an implementation of fmincon.
Hence we can now use mode_compute=1 under Octave.

This commit also adds tests/optimizers/fs2000_1.mod to the testsuite. It will
be skipped under MATLAB if the optimization toolbox is not there, or under
Octave if optim ≥ 1.6 is not there.
2019-10-08 18:38:15 +02:00
Stéphane Adjemian (Charybdis) fb3335f191 Added unitary tests for aggregate routine. 2019-10-02 10:41:32 +02:00
Sébastien Villemot cbb59fe6f8
Merge remote-tracking branch 'community/master' into enterprise 2019-09-26 16:54:27 +02:00
Sébastien Villemot 42392df3bc
Put binary test datafiles in the git repository
This makes the testsuite robust to network failures.
2019-09-19 14:20:00 +02:00
Stéphane Adjemian (Charybdis) 75945a62ac Fixed plot_contribution routine. 2019-05-14 22:12:33 +02:00
Stéphane Adjemian (Charybdis) 92e7010b97 Added integration test. 2019-04-29 23:39:14 +02:00
Stéphane Adjemian (Charybdis) b6a80229a9 Added integration test for cherrypick and agregate routines. 2019-04-27 18:12:53 +02:00
Sébastien Villemot f1b16ced4e
k-order DLL: check computed policy functions at order 9 against Burnside's model
Ref #217
2019-04-26 18:46:04 +02:00
Stéphane Adjemia (Scylla) 8740355407
Rewrote evaluate routine.
- Can handle more than one equation.
 - Can handle identities.
 - Forbids dynamic equations.
 - Can handle following LHS y, diff(y), diff(diff(y)), log(y), diff(log(y)) and
   diff(diff(log(y))), other transformations will result in an error.
 - Added integration tests.

Remark 1. In the integration tests I compare the values returned by the
          evaluate routine with the values computed with the simulation
          routines. Normally the discrepancies should be small, but this is not
          the case when the endogenous variable appear under a log on the
          LHS. My current conclusion is that this has more to do with the
          cumulation of the accuracy errors in the simulation routine (a
          sequence of Newton algorithms) rather than with the evaluate routine.

Remark 2. Currently the only allowed nonlinear transformation on the LHS
          endogenous variable is the log. It is not difficult to generalise, at
          some point I had all the matlab functions allowed by Dynare,
          but this would complicate the code for not much gain.
2019-04-08 11:01:34 +02:00
Stéphane Adjemia (Scylla) 94b20fe7e8
Activate two integration tests. 2019-04-02 22:57:23 +02:00
Stéphane Adjemian (Charybdis) bb0660d506
Added integration tests (trend component models). 2019-03-29 17:58:03 +01:00
Stéphane Adjemian (Charybdis) 7b7bca8bda
Generalised trend component model.
Added the possibility to associate more than one trend to an endogenous
variable. The number of error correction equations is longer required to be
equal to the number of trends.
2019-03-29 17:52:46 +01:00
Houtan Bastani d242ed88a2
dyn_ols: add date range option 2019-03-26 15:04:16 +01:00
Houtan Bastani 9ab4c6f80d
ols-style equations: handle additive elements separated by + and -
use same algorithm as in preprocessor to facilitate future changes
2019-03-26 11:06:30 +01:00
Stéphane Adjemian (Charybdis) a77de6ce75
Revert last patch on Makefile.am. 2019-03-25 20:09:14 +01:00
Sébastien Villemot d1df9317ab
Indentation fixes (tabs are meaningful in Makefiles) 2019-03-25 18:47:49 +01:00
Sébastien Villemot e7dfc6ab36
The MATLAB testsuite now works under Windows, so no need to special-case it 2019-03-25 18:47:49 +01:00
Stéphane Adjemian (Charybdis) 8a8ef89004
Added example for new agregate() routine. 2019-03-25 18:16:38 +01:00
Sébastien Villemot 0f28974c2c
Provisions for MATLAB R2019a
In particular, use the new "-batch" option for running the testsuite.
2019-03-22 16:43:40 +01:00
Sébastien Villemot 4a62fbb687
Remove spurious file in EXTRA_DIST, introduced in 666c9b8003 2019-03-21 18:30:44 +01:00
Willi Mutschler 666c9b8003 Improvement of Identification Toolbox
# Improvements
  * heavily commented (also auxiliary functions) and changed notation to make all the functions (hopefully) more readable and understandable, and hence, easier to debug
  * added identification criteria of Komunjer and Ng (2011, Econometrica) and Qu and Tkachenko (2012, Quantitative Economics)
  * tests can be turned of, i.e. nostrength disables identification strenght, noreducedform disables reduced form criteria, nomoments disables moment criteria, nospectrum disables spectrum criteria, nominimal disables minimal system criteria
  * all kronflags (analytic_derivation_mode) actually work in all functions
  * added functionality when there is correlation in Sigma_e and when one wants to consider corr parameters of exogenous shocks. Previously, (1) corr parameters were not allowed when calling identification and (2) when Sigma_e was not diagonal then the toolbox relied on numerical derviatives only (kronflag=-1). Now it is possible to handle both identification of corr parameters as well as correct analytical derivatives when Sigma_e is not diagonal with all possible kronflag values (-1|-2|0|1)
  * all plots and results are stored in the same folder named identification (previously there was another one with a capital I (Identification))

# Needed changes to preprocessor
  * add as field to options_ident:

    - tex (same as in options_)
    - nostrength (to turn off identification strength)
    - noreducedform (to turn off reduced form criteria)
    - nomoments (to turn off Iskrev's moment criteria)
    - nominimal (to turn off Komunjer and Ng's minimal system criteria)
    - nospectrum (to turn off Qu and Tkachenko's spectrum criteria)

  * add to options_ident:
    - normalize_jacobians (whether to normalize Jacobians or not)
    - grid_nbr (integer used to discretize the interval [-pi;pi]
    - tol_rank (tolerance level to compute ranks)
    - tol_deriv (tolerance level to select nonzero columns in derivatives)
    - tol_sv (tolerance level to select nonzero singular values)
    - ChecksViaSubsets (for debugging purposes, uses different function to find problematic parameter sets)
    - max_dim_subsets_groups (for debugging purposes, used for ChecksViaSubsets)

# Further Suggestions
  * Rename getH.m into getParamsDerivReducedForm.m to make the purpose of this function evident
  * Rename getJJ.m into getIdentificationJacobians.m to make the purpose of this function evident
  * Rename thet2tau.m into IdentificationNumericalObjectiveFunction.m to make the purpose of this function evident
  * dYss, d2Yss, dg1 should also include derivatives wrt to stderr and corr parameters (even though these are just 0), as in other functions (getJJ, dynare_estimation) we always add these manually
  * I am pretty sure the current handling in getH.m of dYss and d2Yss is not correct in the case of nonstationary variables (if g2static is nonempty), I added a warning message, as I am not sure whether this is ever used
  * It would be straigthforward to also include stderr and corr parameters of measurement errors (these is not possible right now). Should I do this?
  * Computations of d2A and d2Om need to be checked, as the differences between computing these with analytically (kronflag=0|1) or numerically kronflag=-1|-2 is really large for the example model of AnSchorfheide.
  * I am not sure how to best normalize Qu and Tkachenko's G matrix. It looks (and in the Gaussian case actually is) very similar to the Ahess matrix. So I used the same normalization rule as for the Ahess matrix. See comments in identification_checks.m. Anyone has a better idea? Please also check the models in test/identification/cgg for differences.
  * parts that are unclear to me are marked by a [@wmutschl] tag
  * the run time of tests/identification/as2007.mod increases from 0h01m27s to 0h03m46s (as Qu and Tkachenko's G matrix takes a little while to compute). One could decrease prior_mc=250 to prior_mc=150.

# New functions
  * commutation: Returns Magnus and Neudecker's commutation matrix that solves k*vec(X)=vec(X')
  * DerivABCD: Derivative of X(p)=A(p)*B(p)*C(p)*D(p) w.r.t to p as in Magnus and Neudecker (1999), p. 175
  * DeriveMinimalState: Derives minimal state space system by checking observability and controllability of all possible combinations of variables
  * duplication: Duplication Matrix (and its Moore Penrose Inverse) as defined by Magnus and Neudecker (2002), p.49, Dp*vec(X) = X
  * identification_checks_via_subsets: finds problematic parameters in a bruteforce fashion: It computes the rank of the Jacobians for all possible parameter combinations, if the rank condition is not fullfilled, these parameter sets are flagged as non-identifiable. For debugging purposes only, as the current identification_checks.m (based on nullspace and multicorrelation coefficients) is much faster

# Detailed changes in getH.m
  * functionality improvements

    - heavily commented (also auxiliary functions) and changed notation of several variables to make this function (hopefully) more readable and understandable, and hence, easier to debug
    - added functionality when Sigma_e is not diagonal and/or when one wants to consider corr parameters of exogenous shocks independent of the value of kronflag
    - fixed function for all values of kronflag, i.e. kronflag=-2|-1|0|1. Previosuly, only kronflag=-2|0 were working, all other kronflags ran into errors (-1 was actually never called , but was dealt with in getJJ.m). I assume kronflag=-1|1 was used only for debugging issues, but still was not working. I fixed this now, the function now works out-of-the-box for all kronflag values.
    - I also outlined and documented what each kronflag does and point to the corresponding equations in Ratto and Iskrev (2012) or Iskrev (2010,Appendix A)
    - the function additionally outputs the Jacobians of B and Sig, which are needed for Qu and Tkachenko (2012) and Komunjer and Ng (2011)'s criteria
    - Moved computation of Jacobian of tau=[ys;vec(A);vech(B * M_.Sigma_e * B')] into getJJ.m to have all Jacobians which are needed for identification in one place. That is, getH.m computes first and second parameter derivatives of (1) reduced-form solution, (2) steady state and (3) Jacobian of dynamic model, whereas getJJ computes and sets up all Jacobians which are used for identification purposes. Therefore, getH might be useful more generally for other purposes than identification. For instance, when doing a GMM estimation, we could use this function to compute analytically the gradient of the moments and provide this to the optimizer used in a GMM context.

  * output arguments

    - renamed `H` (Jacobian wrt parameters of tau=[ys;vec(A);vech(B * M_.Sigma_e * B')] into dTAU, (as H is very confusing, e.g. in other functions it is a Hessian, or Hss and H2ss is also just the steady state. Morevoer, tau is used in Iskrev(2010) for the steady state and reduced-form solution)
    - renamed `Hss` (Jacobian of steady state wrt model parameters only) into `dYss` (as H is very confusing here, see above)
    - renamed `H2ss` (Hessian wrt model parameters only of ys) into d2Yss (as H is very confusing, see above)
    - renamed `gp` into `dg1`, where g1 corresponds to the same variable as in dynamic model files. Note that in params_deriv files gp lacks the contribution of Jacobian wrt steady state and dg1 includes this using the implicit function theorem as outlined in Ratto and Iskrev (2012). Hence, dg1 denotes Jacobian wrt to parameters. It is useful and important to distinguish gp and dg1.
    - added `dB` (Jacobian wrt parameters of solution matrix B) needed for Qu and Tkachenko (2012) as well as Komunjer and Ng (2011)
    - added `dSig` (Jacobian wrt parameters of M_.Sigma_e) needed for Qu and Tkachenko (2012) as well as Komunjer and Ng (2011)

  * input arguments

    - renamed `indx` (index of model parameters to be checked) into `indpmodel`, the p makes it more clear that this is a parameter index
    - renamed `indexo` (index of stderr parameters) into `indpstderr`, the p makes it more clear that this is a parameter index
    - renamed `iv` (index of variables to consider) into `indvar`
    - Renamed `M_` to `M`, `estim_params_` to `estim_params`, `options_` to `options` , `oo_` to `oo` to visualize that these are local and not global variables
    - included `indpcorr` a matrix of indices for corr parameters to be checked

  * misc

    - distinguished clearly between variables in DR or in declaration order without overwriting this in between
    - added which functions call getH.m
    - updated copyright to 2010-2019

# Detailed changes in getJJ.m

  * functionality improvements

    - heavily commented and changed notation of several variables to make this function (hopefully) more readable and understandable, and hence, easier to debug
    - added functionality when Sigma_e is not diagonal and/or when one wants to consider corr parameters of exogenous shocks independent of the value of kronflag
    - tidied the function up, such that it sets up all Jacobians which are needed for identification, i.e. Iskrev's J matrix, Qu and Tkachenko (2012)'s G matrix, Komunjer and Ng (2011)'s D matrix, reduced-form solution (dTAU), linear rational expectation (i.e. Jacobian of steady state and dynamic model equations dLRE).
    - dTAU is now constructed in getJJ instead of in getH (see comment above in getH.m)
    - works for all kronflags, i.e. for numerical derivatives (-1 and -2) as well as for analytical derivatives based on kronecker products (1) or Sylvester Equations (0)
    - added functionality for stderr and corr parameters independent of the value of kronflag (previously this was only possible with numerical derivatives, now it works for all kronflags)
    - finds minimal state vector needed for Komunjer and Ng (2011)'s criteria (function `DeriveMinimalState.m`)
    - moved computations from kronflag=-1 (which were used in case of corr in shock block) into getH.m, so that getJJ now only sets up the Jacobians for LRE, Iskrev's J, Qu and Tkachenko's G and Komunjer and Ng's D, whereas getH computes the Jacobians (wrt parameters) of A, B, Sigma_e, Om, Yss and g1. This should simplify debugging as everything is now in one place and not in two

  * output arguments

    - renamed `JJ` into `J`
    - renamed `H` into `dTAU` (as H is very confusing, e.g. in other functions it is a Hessian, or Hss and H2ss is also just the steady state. Morevoer, tau is used in Iskrev(2010) for the steady state and reduced-form solution)
    - renamed `gp` into `dLRE`, as this corresponds to Jacobian of LRE=[Yss;vec(g1)] where g1 is the Jacobian of the dynamic model equations.
    - renamed `gam` into `MOMENTS`
    - added `G` for Qu and Tkachenko's Jacobian matrix G
    - added `D` for Komunjer and Ng's Jacobian matrix D
    - reordered output arguments

  * input arguments

    - added `options_ident` as input argument; hence, `kronflag`, `nlags` and `useautocorr` are removed from input arguments as these are available in options_ident
    - Renamed `M_` to `M`, `estim_params_` to `estim_params`, `options_` to `options` , `oo_` to `oo` to visualize that these are local and not global variables
    - renamed `indx` (index of model parameters to be checked) into `indpmodel`, the p makes it more clear that this is a parameter index
    - renamed `indexo` (index of stderr parameters) into `indpstderr`, the p makes it more clear that this is a parameter index
    - added `indpcorr` (index of corr parameters)
    - renamed `mf` (index of VAROBS variables) into `indvobs`

  * misc

    - updated copyright to 2010-2019
    - provided some comments on several ways to compute the spectral density matrix
    - added which functions call getJJ.m

# Detailed changes in thet2tau.m

  * functionality improvements

    - heavily commented and changed notation of several variables to make this function (hopefully) more readable and understandable, and hence, easier to debug
    - Added output option to compute spectral density matrix
    - Reorded and added some output option.
    - Instead of Om, `outputflag=0` computes B and Sigma_e, which are needed for Qu and Tkachenko as well as Komunjer and Ng. The Jacobian of Om is then computed in getJJ or getH from Jacobian of B and Sigma_e. Due to some testing with An and Schorfheide model this seems to be more accurate when I compare these with the analytical derivatives. The old behavior (computing Om directly) can be restored by setting `outputflag=-2`.
    - In total this function can now be used to compute numerically Jacobians of Yss, A, B, Sigma_e, Om, g1, autocovariogram and spectral density
    - Clearly distinguished (and commented) on the different outputs of this function.
    - Works for all types of parameters, ie. model, stderr and corr.
    - This function can now also be used when there is no estimated_params block. Previously, there was an error when there was no estimated_params block when calling `set_all_parameters` as this requires some information in `estim_params`. I fixed this by providing a temporary local estim_parms structure with the necessary information on model, stderr and corr parameters. In this way, this can be easily extended to also include stderr and corr parameters of measurement errors.

  * output arguments

    - renamed `tau` into `out`, as this function computes *very* different things (and not only tau) depending on an input flag

  * input arguments

    - renamed `flagmoments` into `outputflag` as this function does not only compute moments but many other things (see above)
    - renamed `indx` (index of model parameters to be checked) into `indpmodel`, the p makes it more clear that this is a parameter index
    - renamed `indexo` (index of stderr parameters) into `indpstderr`, the p makes it more clear that this is a parameter index
    - added `indpcorr` (index of corr parameters)
    - merged `mf` (index of observable variables) and `iv` (index of variables to consider) into a single index `indvar` as there is no need to distinguish between these two indices (they were never used in combination)
    - added `grid_nbr` (number of grid points to compute spectral density)
    - reordered input arguments

  * misc

    - added which functions call thet2tau
    - updated copyright to 2010-2019

# Detailed changes in identification_analysis.m

  * functionality improvements

    - heavily commented and changed notation of several variables to make this function (hopefully) more readable and understandable, and hence, easier to debug
    - renamed `dg1` to `dLRE`, renamed `vecg1` to `lre`, renamed `H` to `dTAU` (see comments above)
    - added option `numzerotolderiv` with default `1.e-8` used for non-zero derivatives
    - added option `numzerotolrank` with default `1.e-10` used for rank computations
    - added theoretical identification analysis based on Komunjer and Ng (2011)'s method, i.e. steady state and observational equivalent spectral densities within a minimal system
    - added theoretical identification analysis based on Qu and Tkachenko (2012)'s method, i.e. steady state and spectral density
    - restructured the code slightly to combined chunks of code that belong together on the one hand, and on the other hand to differentiate between the different criteria
    - added call to new function `identification_checks_via_subsets.m` (see above for the definition of the functionality) to perform identification checks differently as find it more intuitive and (most likely) more precise.

  * input arguments

    - removed `bounds` and `dataset_` as input argument, because these are not needed
    - moved `name_tex` and `tittxt` into `options_ident` as these two inputs are only used in `ident_bruteforce.m` and already set in `dynare_identification.m`

  * output arguments

    - added `ide_spectrum` structure for Qu and Tkachenko's criteria based on the spectral density
    - added `ide_minimal` structure for Komunjer and Ng's criteria based on the minimal state space system
    - reordered output arguments

  * misc

    - added which functions call identification_analysis
    - updated copyright to 2010-2019

# Detailed changes in dynare_identification.m

  * functionality improvements

    - heavily commented and changed notation of several variables to make this function (hopefully) more readable and understandable, and hence, easier to debug
    - included more options (and default values) which can be set by the user, i.e. nostrength, nomoments, nominimal, nospectrum, tex, tol_rank, tol_deriv, tol_sv, grid_nbr, ChecksViaSubsets, max_dim_subsets_group
    - instead of turning warnings globally off, I specified the relevant warnings for matlab and octave, respectively, off
    - improved the warning messages slightly
    - restructured chunks of code with respect to different criteria

  * output arguments

    - renamed arguments: TAU to STO_TAU, GAM to STO_MOMENTS, LRE to STO_LRE, gp to STO_si_dLRE, H to STO_si_dTAU, JJ to STO_si_J
    - added arguments: STO_G and STO_D for the two new criteria

  * misc

    - added which functions call dynare_identification
    - updated copyright to 2010-2019

# Detailed changes in identification_checks.m

  * functionality improvements

    - added checks for Komunjer and Ng's D matrix. Note that the Jacobian D=[D_par D_rest], where D_par depends on the parameters and D_rest does not. So this is taken into account.
    - added checks for Qu and Tkachenko's G matrix. Note that the Jacobian G is a Gram matrix with dimension nparam x nparam, similar to Ahess. So this is taken into account. I am, however, not sure whether this is correct regarding the multicorrelation and pairwise correlation coefficients. Please double check.
    - the rank is now actually computed at the prespecified tolerance level (and not Matlab's default level), so this is in accordance to the further analysis of problematic parameter sets

  * output arguments

    - added the rank to output arguments which is later also displayed
    - replaced the J or JJ part in the variable names with X as this function is used for all sorts of Jacobians, not only Iskrev's J

  * input arguments

    - renamed hess_flag to output_flag (and clearly outlined what each value does)
    - added tol_rank and tol_sv as input arguments, such that the tolerance levels can be changed by the user and not preimplemented in this function
    - added param_nbr which is needed for Komunjer and Ng's D matrix

  * misc

    - updated copyright to 2010-2019

# Detailed changes in ident_bruteforce.m

  * functionality improvements

    - the output directory was set with a capital I, i.e. Identification, whereas in all other functions we rely on lower case i, i.e. identification. I changed this to lower-cases, so everything is now saved in the same folder.
    - changed displayed strings to be more precise with the corresponding papers and notation

  * input arguments

    - renamed `n` to `max_dim_cova_group` to name options the same across functions
    - renamed `pnames_TeX` to `name_tex` to name options the same across functions
    - added `tol_deriv` as tolerance level which can be changed by the user

  * misc

    - Added some comments
    - updated copyright to 2010-2019

# Detailed changes in disp_identification.m

  * functionality improvements

    - this function displays the same output for different Jacobians, hence I put the common code into a for loop. This should simplify changing the output that is printed to the console. Previously the code was simply repeated for the different criteria and only the strings changed.
    - some settings relevant for the computation are now printed as a summary to the console
    - the tolerance level, rank and required rank are always displayed on the command line to see how many problematic sets there are and which tolerance level was used
    - the function is also able to display problematic parameters computed by the new function `identification_checks_via_subsets.m` which is only used for debugging.

  * input arguments

    - added `idespectrum` structure for analysis based on Qu and Tkachenko
    - added `ideminimal` structure for analysis based on Komunjer and Ng
    - added `options_ident` to have all necessary settings in a structure

  * misc

    - Added some comments
    - Removed uncommented code that was not used as this was redundant and probably an artifact of the original programming?!
    - updated copyright to 2010-2019

# Detailed changes in dsge_likelihood.m

  * misc

    - adjusted call of getH due to changes of input and output arguments
    - updated copyright to 2010-2019

# Detailed changes in cosn.m

  * misc

    - commented functionality, input and output arguments of this function
    - updated copyright to 2010-2019
2019-03-20 15:44:54 +00:00
Stéphane Adjemian (Charybdis) 567ca19000
Added routine to evaluate the RHS of an equation. 2019-03-19 07:08:55 +01:00
Houtan Bastani 7858a88764
add dependency for test for parallelization of test suite 2019-03-15 17:01:25 +01:00
Houtan Bastani 543470b331
separate ECB tests so as to be able to test everything in one go 2019-03-15 16:44:59 +01:00
Houtan Bastani 4ac5ebbefc
add var AR test 2019-03-15 14:22:50 +01:00
Stéphane Adjemian (Charybdis) 52eed33c42
Fixed growth neutrality correction in presence of exogenous variables.
Also fixes growth neutrality correction in models with non optimizing
agents (correction was not taking into account the value of the share of non
optimizing agents).
2019-03-11 11:54:53 +01:00
Stéphane Adjemian (Charybdis) 6997e0a4a6
Added the possibility to have exogenous variables in the optimal part of PAC.
Works with iterative ols and nls.
2019-03-08 14:34:41 +01:00
Houtan Bastani ba416f12ad
makefile: use tabs instead of spaces 2019-03-08 11:16:26 +01:00
Houtan Bastani d7246b3489
ols-style routines: allow user to specify parameters to be estimated 2019-03-08 11:15:33 +01:00
Houtan Bastani 6b4b2bb8b3
fix path to test 2019-03-07 18:06:53 +01:00
Stéphane Adjemian (Charybdis) d4814c6b92
Removed pointer to missing file in Makefile.am. 2019-03-07 17:33:40 +01:00
Stéphane Adjemian (Charybdis) dac08da6a4
Added the possibility to tag a varexo variable as an observed variable. 2019-03-07 15:31:34 +01:00
Houtan Bastani 92b1c25b9f
fix typo 2019-03-07 10:47:02 +01:00
Houtan Bastani f3a10d0238
add test for estimating certain parameters in sur 2019-03-07 10:47:02 +01:00
Houtan Bastani 59ab4f4b34
update tests 2019-03-04 15:08:19 +01:00
Stéphane Adjemian (Charybdis) cdadab34b4
Streamlined code in print_expectations and allow diff and unary op in growth option of pac_model. 2019-03-02 22:36:13 +01:00
Stéphane Adjemian (Charybdis) d00b57541e
Allow exogenous variables in pac.estimation.iterative_ols routine.
The parameters associated to these additional variables can be estimated or calibrated.
2019-03-01 23:32:47 +01:00
Stéphane Adjemian (Charybdis) f07b1e8028
Account for exogenous variables in PAC's RoT part.
Fixes the iterative_ols estimation of PAC equation when the Rule of Thumbs (non
optimizing) part of the equations contains endogenous and/or exogenous variables.
2019-02-27 15:53:25 +01:00
Stéphane Adjemian (Charybdis) 379431b05b
Added integration test.
Check that the content of pac.[pacmodel].equations.[eqtag].non_optimizing_behaviour.vars is correct.
2019-02-27 14:22:59 +01:00
Sébastien Villemot b6f0071501
Testsuite: activate k_order_perturbation/fs2000k4.mod 2019-02-26 18:59:42 +01:00
Houtan Bastani 0c8867cbad
fix typo 2019-02-26 12:52:38 +01:00
Stéphane Adjemian (Charybdis) 445f88df55
Fixed PAC/MCE with non optimizing behaviour.
Alse added integration tests for PAC/MCE.
2019-02-25 23:07:57 +01:00
Stéphane Adjemian (Charybdis) 1aa7f4a93f
Added PAC with Model Consistent Expectations. 2019-02-25 17:31:58 +01:00
Houtan Bastani 030737b9c0
sur: fix input checks 2019-02-25 14:23:48 +01:00
Sébastien Villemot 548a6283ca
Testsuite: also move fataltests.m under tests/utils/ 2019-02-17 12:46:26 +01:00
Sébastien Villemot ce70e2a9ca
Testsuite: do not add top-level tests/ directory to the MATLAB/Octave path
This directory is cluttered with so many files that it creates problem (e.g.
dynare-command-options/ramst.mod was broken under Octave because of this).

Move files that have to be found through the path in a utils/ subdirectory.
2019-02-15 18:43:20 +01:00
Stéphane Adjemia (Scylla) 3cb3b4aee5
Allow models with leads in bgp.write().
Also added tests to check that we are able to identify the Balanced Growth
Path, note that it does not work with tests/bgp/fs2000.mod.
2019-02-15 16:59:26 +01:00
Sébastien Villemot 0b1b365ed3
Testsuite: invert colors (green vs red) for expected failures
I.e. a test that is expected to fail and that actually fails will be displayed
in green. If it actually succeeds, it will be red.
2019-02-14 17:03:35 +01:00
Stéphane Adjemia (Scylla) 468d0f5ae5
Added integration test (IRFs of backward models). 2019-02-13 15:19:18 +01:00
Stéphane Adjemia (Scylla) b7c60ddf59
Added a routine for writing the problem to be solved to compute the BGP of a model.
- Only works with backward models.
 - Probably doesn't work if the model includes auxiliary variables.
 - Assumes that the trends are multiplicative.
2019-02-04 10:04:33 +01:00
Sébastien Villemot 1238fb2071
Remove duplicate test file
Another version is already under tests/trend_var/ directory.
2019-01-31 19:01:41 +01:00
Houtan Bastani 85e903ef90
tabs instead of spaces in Makefile.am 2019-01-30 16:29:21 +01:00
Houtan Bastani 20256b5be9
test zero equations in SUR 2019-01-30 16:29:11 +01:00
Stéphane Adjemia (Scylla) 74520e77bf
Allow for lags on endogenous variable in growth option of pac_model. 2019-01-28 11:25:30 +01:00
Houtan Bastani 169ed2a655
reorder tests, slowest first 2019-01-22 17:13:03 +01:00
Houtan Bastani 407ac26f5b
separate test call for ols style mod files 2019-01-22 15:55:15 +01:00
Stéphane Adjemia (Scylla) 9b06086ea7
Added rules for running tests in ecb and estimation/univariate subfolders. 2019-01-16 16:05:05 +01:00
Houtan Bastani df713e907b
add tests to makefile 2019-01-16 14:52:01 +01:00
Houtan Bastani 4804e729e8
makefile: fix spacing 2019-01-16 12:54:30 +01:00
Johannes Pfeifer 32b9853277
Add unit test for correctness of posterior moments 2018-12-15 19:23:05 +01:00
Stéphane Adjemia (Scylla) ecad43085c
Added integration test (epilogue block). 2018-12-10 16:16:15 +01:00
Stéphane Adjemia (Scylla) 0d5b310207
Added integration tests (for constrained OLS). 2018-12-07 19:54:33 +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) 6b113273d3
Added integration tests (Iterative OLS and NLS for PAC equations). 2018-11-21 16:26:38 +01:00
Sébastien Villemot 6995e24863
The testsuite can now be run from Windows 2018-11-21 16:21:59 +01:00
Sébastien Villemot c407b63e84
Update preprocessor submodule + add test
Ref Dynare/preprocessor#13
2018-11-16 18:34:37 +01:00
Stéphane Adjemia (Scylla) 460dba40d7
Added integration test (estimated_params_init). 2018-10-25 10:33:31 +02:00
Stéphane Adjemia (Scylla) dcea7514d9
Merge branch 'master' into ecb-master 2018-10-24 18:31:31 +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) d96740c2ef
Added integration tests (var and pac expectations). 2018-10-14 17:01:02 +02:00
Stéphane Adjemia (Scylla) 9a84129707 Added integration for the bayesian estimation of a single equation.
Uses a Gibbs sampling algorithm.
2018-10-06 16:59:00 +02:00
Sébastien Villemot c6a17abc72 Testsuite: suppress MATLAB splash screen when generating .m.tls file 2018-10-01 16:40:26 +02:00
Stéphane Adjemian(Charybdis) a680cea095
Fixed integration test for trend component model (equation ordering). 2018-09-28 17:39:14 +02:00
Stéphane Adjemian(Charybdis) 76c4df129c
Added integration tests. 2018-09-27 18:58:52 +02:00
Houtan Bastani bd36a0c109 Merge branch 'master' into ecb-master-targets 2018-09-25 15:51:18 +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) c588544b13
Fixed rm argument list too long issue. 2018-09-19 12:10:30 +02:00
Sébastien Villemot a03fab76c2 Ensure that test summary is displayed even if there is a test failure 2018-09-14 15:21:39 +02:00
Stéphane Adjemian(Charybdis) 9adad552be Fixed rm argument list too long issue.
(cherry picked from commit d005def67f5d0afb2a99a40a6cd84766ca7dfd9f)
2018-09-13 17:31:24 +02:00
Sébastien Villemot a4c46a8121 tests/Makefile.am: replace PWD by CURDIR, fixes recursive make invocation 2018-09-13 16:43:30 +02:00
Sébastien Villemot 763b0a2392 make check-{matlab,octave} now return a non-zero exit code if there is a failed test 2018-09-13 16:18:41 +02:00
Houtan Bastani 2e547edd26 add test files for preprocessor AR/EC matrices 2018-09-12 19:00:28 +02:00
Houtan Bastani 5ca31c8245 fix spacing in makefile 2018-09-12 19:00:28 +02:00
Stéphane Adjemian(Charybdis) 52b6618bae Fixed paths. 2018-09-12 07:48:49 +02:00
Stéphane Adjemian(Charybdis) 09945cae8f Added integration tests for PAC model. 2018-09-06 23:42:30 +02:00
Stéphane Adjemian(Charybdis) 5ea0c8098b Ensure that the ordering of the trend variables is consistent...
... With the ordering of the EC variables.
2018-09-03 17:35:59 +02:00
Stéphane Adjemia (Scylla) 0080055469 Activate integratiion test on VAR_MODEL and TREND_COMPONENT_MODEL. 2018-08-30 12:07:58 +02:00
Stéphane Adjemian(Charybdis) 349cd25b8a Added an integration test for VAR_EXPECTATION_MODEL.
+ small cosmetic changes.
2018-08-09 09:05:39 +02:00
Stéphane Adjemian(Charybdis) f8f8ce5120 Added integration tests for VAR_EXPECTATION_MODEL. 2018-08-08 22:58:27 +02:00
Stéphane Adjemian(Charybdis) c9a38c4de7 Merge branch 'master' into ecb-master
Fixed conflicts:
 - tests/run_block_byte_tests_octave.m
2018-08-04 21:08:08 +02:00
Sébastien Villemot fda021855c Fix forecast command with deterministic exogenous and linear option
Closes #1608
2018-08-02 14:20:51 +02:00
Stéphane Adjemian(Charybdis) a144aad150 Merge branch 'master' into ecb-master 2018-07-27 09:47:22 +02:00
Sébastien Villemot 0da4aefd99 Update preprocessor submodule with macroprocessor refactoring
By the way, add new tests for the macroprocessor.
2018-07-25 18:51:38 +02:00
Stéphane Adjemian(Charybdis) 7d7449c775 Merge branch 'master' into ecb-master
Fixed conflicts:
	matlab/modules/dseries
2018-07-23 17:05:30 +02:00
Stéphane Adjemian(Charybdis) 3dcd8fc9f5 Added preprocessor unit tests (on the fly declarations of types). 2018-07-19 23:51:37 +02:00
Sébastien Villemot ff676f5505 Gracefully fail when Octave crashes in a *.m test 2018-07-13 17:22:27 +02:00
Stéphane Adjemian(Charybdis) 85a585c73e Merge branch 'master' into ecb-master+folder
Fixed conflicts in:
	tests/block_bytecode/run_ls2003.m
2018-07-10 10:18:55 +02:00
Sébastien Villemot a1b8bd39b2 Move the location of various generated files on the filesystem
- M and MEX files are now under +${MODELNAME}/
- bytecode, C source and JSON now under ${MODELNAME}/model/
2018-06-27 17:03:39 +02:00
Houtan Bastani c7fe3770df Merge branch 'master' into ecb-master 2018-06-11 15:35:24 +02:00
Sébastien Villemot 1e5fab3881 Fix tests for stack_solve_algo=7
Completes commit db0cf1b8ea from PR #1616.
2018-06-08 10:29:53 +02:00
Johannes Pfeifer db0cf1b8ea Add unit tests for perfect foresight simulations with exogenous leads and lags
Closes #1616
2018-06-07 20:46:30 +02:00
Houtan Bastani 6f6ef8fb30 Merge branch 'master' into ecb-master 2018-06-05 18:47:55 +02:00
Sébastien Villemot fec0947c7b Testsuite: clean files generated by move to temporary terms array 2018-06-04 18:08:28 +02:00
Stéphane Adjemian(Charybdis) e62c2272b4 Merge remote-tracking branch 'github/master' into ecb-master
Fixed conflicts:
	matlab/modules/dates
2018-05-16 17:32:39 +02:00
Stéphane Adjemian(Charybdis) f53be721c1 Added new option mh_tune_jscale.
Works only with the Random Walk Metropolis Hastings algorithm.

Closes #1598
2018-05-16 16:37:22 +02:00
Houtan Bastani 7f3120eb2e preprocessor: submodule update; introduction of on-the-fly variable declaration 2018-03-20 16:43:06 +01:00
Stéphane Adjemian(Charybdis) ac09cb3ee2 Merge branch 'master' into ecb-master
Fixed conflicts in:
	matlab/backward/backward_model_irf.m
	matlab/modules/dseries
	matlab/utilities/general/isint.m
	preprocessor/DynareBison.yy
	preprocessor/DynareFlex.ll
	preprocessor/ModFile.cc
	preprocessor/ParsingDriver.hh
2017-10-14 17:12:57 +02:00
Stéphane Adjemian (Scylla) f284169248 Fixed integration tests related to simulation of backward models. 2017-09-30 16:44:23 +02:00
Houtan Bastani 97743cbb3f Merge branch 'master' into ecb-master 2017-09-13 18:27:15 +02:00
Johannes Pfeifer 79e510a99e Add integration tests for #1193 and #1510 2017-09-13 10:20:09 +02:00
Stéphane Adjemian (Scylla) eb3f33df00 Merge branch 'master' into ecb-master
Fixed conflicts:
	matlab/backward/backward_model_forecast.m
	preprocessor/DynareBison.yy
	preprocessor/ParsingDriver.hh
	tests/practicing/datasaver.m
2017-08-30 11:51:56 +02:00
Stéphane Adjemian (Scylla) 32c3beb27d Fixed bug introduced in 7d180e2fcb. 2017-08-16 22:17:20 +02:00
Johannes Pfeifer fdb24d6a1d Add unit test for sim1_linear.m 2017-08-01 11:36:07 +02:00
Stéphane Adjemian (Scylla) 75d3964a63 Fixed tests/Makefile.am (removed entry in MODFILES causing build failure). 2017-07-29 21:11:17 +02:00
Stéphane Adjemian (Scylla) c5fb6dfe57 Merge branch 'master' into ecb-master
Fixed conflict in preprocessor/ModFile.cc
2017-07-27 22:48:29 +02:00
Houtan Bastani 7a4658323f update makefile for change in .mod file name 2017-07-26 15:07:46 -04:00
Stéphane Adjemian (Scylla) 45864f414f Added integration test.
Trend + posterior filtered variables in a model with only one observed variable.
2017-07-23 23:34:49 +02:00
Stéphane Adjemian (Charybdis) c9ea44002a Added integration test. 2017-06-30 11:02:31 +02:00
Stéphane Adjemian (Charybdis) cf4579fc61 Merge branch 'master' into ecb-master 2017-06-30 10:55:31 +02:00
Stéphane Adjemian (Charybdis) 63d6dfccf4 Added the possibility to dynare the dynare command options in the mod file. 2017-06-30 10:16:26 +02:00
Stéphane Adjemian (Charybdis) a59a2fae2d Merge branch 'master' into ecb-master 2017-06-29 13:33:29 +02:00
Stéphane Adjemian (Charybdis) b81e0cd91e Added json file in the clean rule. 2017-06-28 16:03:52 +02:00
Houtan Bastani d8ffd5e83c Merge branch 'master' into ecb-master 2017-06-19 18:02:57 +02:00
Stéphane Adjemian (Charybdis) 119b5a62f2 Merge branch 'master' into json 2017-06-16 20:03:36 +02:00
Sébastien Villemot 7eaea0c772 Include tests/load_octave_packages.m in the distributed tarball. 2017-06-13 15:50:34 +02:00
Johannes Pfeifer d75e7278c2 Make sure that reverting to order=1 if Hessian is 0 does not crash other functions
Closes #1453
2017-05-27 19:26:12 +02:00
Stéphane Adjemian (Charybdis) c2556cc80e Merge branch 'master' into ecb-master
Model inversion of backward looking models.
2017-05-02 23:15:42 +02:00
Houtan Bastani 5bae0a8cb1 build system: add clean rule for test suite 2017-04-25 12:24:03 +02:00
Houtan Bastani db535236b2 Merge branch 'master' into ecb-master 2017-04-14 11:35:43 +02:00
Stéphane Adjemian (Charybdis) 19b206338d Fixed tests/dates/fs2000.mod and added in testsuite.
Provides an example showing how to directly pass a dseries object to the data
command for estimation.
2017-04-05 11:44:27 +02:00
Stéphane Adjemian (Charybdis) d43af0e4d7 Fixed wrong spaces/tab in tests/Makefile.am. 2017-04-05 11:44:27 +02:00
Johannes Pfeifer 00299a92c1 Make sure options_.first_obs is properly set 2017-04-05 11:44:27 +02:00
Stéphane Adjemian (Charybdis) c1434118bd Added integration test for nonlinear filters with unit roots. 2017-04-03 11:25:05 +02:00
Stéphane Adjemian (Charybdis) e1033c76b9 Added declaration of observed exogenous variables.
With integration test.
2017-03-22 09:41:09 +01:00
Stéphane Adjemian (Charybdis) 9633f3ab77 Fixed bug introduced in 68b18b04f4.
Update of EXTRA_DIST was missing.
2017-03-20 22:17:54 +01:00
Johannes Pfeifer 828df26d71 Makefile.am: Add loglinear as test group
(cherry picked from commit a4c28306097f75b5dae2ded92628b26530f5dd20)
2017-03-20 09:43:23 +01:00
Stéphane Adjemian (Charybdis) c7926e250a Fixed spaces in 750f1d9ff4728216db0df8da69ef59f4d7dc254b. 2017-03-20 09:42:15 +01:00
Johannes Pfeifer 9adc2e9ca9 makefile: Replace 8 spaces by correct tab
(cherry picked from commit 750f1d9ff4728216db0df8da69ef59f4d7dc254b)
2017-03-20 09:40:57 +01:00