Commit Graph

64 Commits (7dd2dd5e24a343fbeaf3522ea5e535c27d8b9f95)

Author SHA1 Message Date
Johannes Pfeifer 3fbab4cbe0 Provisions for solving steady state with MCP-tag 2022-09-12 17:18:16 +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
Johannes Pfeifer a5fe22bd1c resid: Fix display of name tags with Ramsey equations 2022-04-04 22:50:16 +02:00
Sébastien Villemot ae1e31b7e0
Restore the possibility of calling the “resid” function without argument
Can be useful when writing “z = resid;” in a .mod file (i.e. not using the
preprocessor syntax).
2022-03-01 16:40:51 +01:00
Sébastien Villemot 3d7299c1e4
New option “non_zero” to the “resid” command
When this option is given, the “resid” command only displays non-zero residuals
2022-03-01 14:26:16 +01:00
Sébastien Villemot 4b76d76175
evaluate_static_model.m: fix the block without bytecode case
The routine would not put elements at the right place in the residuals
vector (it would use variable indices instead of equation indices).

Also change the routine so that it computes a residual on evaluated
equations (instead of systematically returning zero for those).

Finally, simplify resid.m by calling this routine instead of embedding a
similar code.

Ref. #1823
2021-11-23 17:40:02 +01:00
Johannes Pfeifer 37fbf5b665 resid.m: fix display when used together with optimal policy 2021-10-11 18:04:47 +02:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Johannes Pfeifer 607a273bb0 Correctly distinguish tolerance between steady and perfect foresight
steady uses options_.solve_tolf as a termination criterion, so subsequent checks should do the same. Similarly, solve_tolx was never used.
2020-07-06 13:11:23 +02:00
Sébastien Villemot 41fe087106
Block decomposition: static and dynamic files are now pure wrappers around the per-block files
Systematically call top-level static/dynamic files, instead of per-block ones.
2020-06-19 18:46:56 +02:00
Sébastien Villemot 50209dc56e
Block decomposition: no longer use global variables for temporary terms in the dynamic M-file
Rather use a single vector as in non-block mode.

By the way, change the order of output arguments in static functions, to be
closer to the dynamic ones.
2020-05-26 16:23:46 +02:00
Sébastien Villemot 2c6807a66b
Block decomposition: no longer use global variables for temporary terms in the static M-file
Rather use a single vector as in non-block mode.
2020-05-25 18:36:55 +02:00
Sébastien Villemot 7e770f69e7
Remove workaround for errors in MEX files
Because at some point throwing exceptions from MEX files (with mexErrMsgTxt())
was not working under Windows 64-bit, we had designed a workaround to avoid
using exceptions.

Most MEX files were returning an error code as their first (or sometimes last)
argument, and that code would have to be checked from the MATLAB code.

Since this workaround is no longer needed, this commit removes it. As a
consequence, the interface of many MEX files is modified.

For some background, see https://www.dynare.org/pipermail/dev/2010-September/000895.html
2020-01-10 18:33:11 +01: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
Stéphane Adjemian (Scylla) 7be8f10e0e Use cells of strings instead of char arrays. 2018-01-09 22:30:01 +01:00
Stéphane Adjemian (Charybdis) 1bf81c9f5a Fixed copyright notices. 2017-05-18 18:36:38 +02: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
Johannes Pfeifer 578fb04590 Check for complexity of steady state in resid.m
Residuals might be 0, but steady state might be complex, resulting in hard-to-diagnose problems when calling steady.m
2016-07-14 15:04:27 +02:00
Johannes Pfeifer cb3804ab51 Remove automatic error from resid.m when steady state does not solve.
Closes #573
2015-10-13 13:45:54 +02:00
Johannes Pfeifer 23bd54ce72 Fixed typo that prevented correct updating of parameters when using resid together with the steady_state_model block 2013-11-21 19:39:50 +01:00
Stéphane Adjemian (Charybdis) 4052d4ccaf Cosmetic changes. Use skipline() instead of disp(' '). 2013-07-10 17:12:34 +02:00
Stéphane Adjemian (Charybdis) 8574dfd053 Adapted print_info routine. 2013-06-12 10:54:33 +02:00
Sébastien Villemot 31a13db66a Remove duplicate information in M_.blocksMFS 2012-11-16 17:39:03 +01:00
Sébastien Villemot bf19ab801f Remove duplicate information in M_.blocksEQU 2012-11-16 17:16:40 +01:00
Sébastien Villemot 1f9cea669a Update copyright notices 2012-06-08 18:22:34 +02:00
Stéphane Adjemian (Charybdis) a341a4f8a3 Fixed bug in steady state check (issue with mean preserving spread corrections). 2012-06-06 18:25:07 +02:00
Michel Juillard 57861e22d9 resid: print residuals even if a *_steadystate.m file reports an error 2012-05-20 21:35:34 +02:00
Ferhat Mihoubi dfbd6c8f2a Adds the index of equations (M_.blocksEQU) for a block decomposed model without bytecode option and use this index in resid.m to retrieve the residuals 2012-03-08 15:29:56 +01:00
Stéphane Adjemian (Charybdis) a36cf30118 Make options_.dynatol specific to x/f by adding dynatol.x and dynatol.f. By default dynatol.x=dynatol.f= old default value of dynatol. 2011-12-12 14:20:14 +01:00
Stéphane Adjemian (Charybdis) 7aeb881e3a Temporarily set the variance of the shocks to zero when computing or checking the deterministic steady
state. This is necessary if the model contains mean preverving spread terms.
2011-12-04 23:57:46 +01:00
Michel Juillard d1cb9fd0a8 fixed recent bug in resid when there is no steadystate file 2011-10-27 22:08:10 +02:00
Michel Juillard 9425b36358 fixing problems related to auxiliary variables 2011-10-19 12:47:15 +02:00
Sébastien Villemot 02652f6eb8 Updated copyright notices 2011-02-04 17:27:33 +01:00
Sébastien Villemot 757a9067c0 Global reindentation of MATLAB files 2011-02-04 17:17:48 +01:00
Ferhat Mihoubi ac9415a943 - The bytecode.mex file has to be called when bytecode option is specified independently of the block option. 2011-01-14 10:39:34 +01:00
Sébastien Villemot 3af62c4ac9 Fixed bug in resid.m (order matters in "or" statement, because of short-circuit: "ind" is not defined if "istag" is false) 2010-12-06 18:24:08 +01:00
Stéphane Adjemian (Charybdis) 618f72bc91 resid displays the name of the equations if they are specified in equations tags. 2010-11-25 17:31:11 +01:00
Ferhat Mihoubi b356c5e58e add_auxiliary_variables_to_steadystate is compatible with bytecode option
+ minor corrections in steady_.m
2010-11-25 16:00:54 +01:00
Stéphane Adjemian (Charybdis) 31b734e9b3 Do not print residuals of the static equations for the equations of the auxiliary variables. 2010-11-04 14:19:28 +01:00
Ferhat Mihoubi df1b1e4ed0 - In bytecode, the MATLAB function "mexErrMsgTxt" has been replaced by an exception handling see ticket #137 2010-09-24 12:52:58 +02:00
Ferhat Mihoubi 25b3c84b40 RESID command is compatible now with block option and without bytecode option (closes ticket #45) 2010-09-17 16:54:43 +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
sebastien a2cef7009d Fixes for ticket #57
preprocessor:
* add a field "M_.orig_endo_nbr" containing the nbr of endogenous before adding aux vars
* always provide "M_.aux_vars" (define it to "[]" when there is no aux var)
* rename "M_.aux_vars().orig_endo_index" to "M_.aux_vars().orig_index"

M-files:
* for commands which accept a list of variables (stoch_simul, osr, estimation, dynasave, dynatype, datatomfile), when no variable is given, use only the set of original endogenous (without aux vars) as the default
* when displaying the decision rule, when there is aux vars in the state variables, replace them by their original name (with the right lag)
* in "steady", don't display aux vars
* special exception for ramsey policy: all vars (including aux vars) are displayed, because the system of aux vars from ramsey policy is not compatible with the aux vars from the preprocessor


git-svn-id: https://www.dynare.org/svn/dynare/trunk@3166 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-11-25 10:22:39 +00:00
sebastien ffd9b2d405 preprocessor: clean-up workaround for acosh(), asinh(), atanh() on Win 64 platforms
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3101 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-10-29 17:16:10 +00:00
stepan bc83fbd808 * Allow the use of a *_steadystate.m file with options block and bytecode.
* Added the possibility to use resid when the the options block *and* bytecode
are used.

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2986 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-09-25 16:20:19 +00:00
ferhat beade4bea1 References to model_mod option are ruled out of M-files
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2878 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-09-02 13:07:59 +00:00
ferhat d32dd99210 - extension of normalization of equations to nonlinear equations
- mfs: new option for 'steady' and 'model' commands. Determines the equation belonging to the set of feedback variables.
  mfs = 0 => all variables are considered as feedback variables (default value)
  mfs = 1 => using only naturally normalized equation as potential recursive equations (all variables assigned to unnormalized equations are considered as feedback variable)
  mfs = 2 => adding to the set of potential recursive equation with mfs = 1 the linear equation in endogenous variable normalized (all variables assigned to nonlinear unnormalized equations are considered as feedback variable)
  mfs = 3 => adding to the set of potential recursive equation with mfs = 2 the non linear equation in endogenous variable normalized
- correction of few buggs in simulate.dll
- block_mfs_dll: new option for 'steady' command. Use simulate.dll to solve the steady state model (speedup the computation of the steady-state and the homotopy)

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2866 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-08-25 09:43:01 +00:00
sebastien 695a638f09 trunk: fixed bug with USE_DLL (stoch_simul was calling stoch_simul_sparse, because of wrong handling of options_.model_mode)
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2571 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-09 10:02:45 +00:00
stepan 5c18a68ac3 v4.1:: The reported residuals are rounded to zero if inferior to options_.dynatol/100.
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2383 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-01-29 22:25:01 +00:00