Commit Graph

64 Commits (7dd2dd5e24a343fbeaf3522ea5e535c27d8b9f95)

Author SHA1 Message Date
Sébastien Villemot 06f665e231
Perfect foresight: LBJ now available under stack_solve_algo=1 (with/without block/bytecode)
Previously, LBJ was available:

– under stack_solve_algo=6 when neither block nor bytecode were present
– under stack_solve_algo=1 with either block or bytecode (but the documentation
  was not making it clear that it was LBJ)

This commit merges the two values for the option, and makes them
interchangeable. LBJ should now be invoked with stack_solve_algo=1 (but
stack_solve_algo=6 is kept for compatibility, and is a synonymous).
2022-06-15 15:06:33 +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 b4ce69db3a
Remove options_.slowc field
There was no user interface, and the feature that it provides has lost
relevance over time.

Note that algorithms for block and/or bytecode still internally use some
equivalent of this parameter, but its initial value will no longer be
modifiable (which could lead to bugs, see commit
e49e7e906f).
2022-03-31 17:39:43 +02:00
Sébastien Villemot 4da9d1e718
Block (without bytecode): avoid silent failures in some corner cases
Either ensure that oo_.determinstic_simulation.status is set, or really error out.
2022-03-23 17:33:37 +01:00
Sébastien Villemot e5f4d96c71
Fix typo 2022-03-23 16:58:59 +01:00
Sébastien Villemot bef8d80ba8
More conversions to logical values 2022-03-23 16:52:40 +01:00
Sébastien Villemot 07978affa5
Block decomposition: simplify MATLAB implementation of stack_solve_algo=3 (BiCGStab)
This commit makes it closer to the implementation in bytecode. In practice,
this change fixes convergence problems on some models.
2022-03-16 15:00:09 +01:00
Sébastien Villemot db5e04107f
solve_one_boundary.m: fix crash in verbose mode 2022-03-16 15:00:09 +01:00
Sébastien Villemot 3734762af7
For stack_solve_algo={2,3} and solve_algo={7,8}, rather use a “crout” ILU decomposition for the preconditioner
In 3025a14ed9, the call to the deprecated “luinc”
has been replaced by a call to “ilu”.

However, the type of “ilu” decomposition had not been specified. The default,
“nofill”, does not make use of the “droptol” option which was used with
“luinc”. Also, under Octave, it does not work when there is a zero on the
diagonal of the input matrix.

Rather use the “crout” type, which addresses these two issues.
2022-02-14 12:34:50 +01:00
Sébastien Villemot fa7b331cf4
Fix crash in simulation of “Solve forward/backward complete” blocks with stack_solve_algo=4 (without bytecode) 2022-02-11 18:11:42 +01:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Sébastien Villemot e576dc8c81
Block decomposition: fix evaluation of recursive variables in solved blocks
Ref. #1726
2020-10-06 18:31:13 +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 0305b427a6
Block decomposition: use same orientation convention as oo_.endo_simul for matrix of simulated paths
Improves consistency, but also efficiency (less transpose needed).
2020-06-17 18:19:35 +02:00
Sébastien Villemot 20431ed312
Block decomposition: in the dynamic file, y and T are now vectors as in non-block mode 2020-06-17 18:19:21 +02:00
Sébastien Villemot adbb9c9117
Block decomposition, stack_solve_algo=4: fix set of variables over which line search is done 2020-06-16 18:46:40 +02:00
Sébastien Villemot e72bce1a67
Block decomposition: remove useless “y” output for static/dynamic files of solved blocks 2020-06-16 18:46:40 +02:00
Sébastien Villemot 2ec5e4075a
Block decomposition: remove unused 2nd and 3rd derivatives in output of dynamic functions 2020-06-03 17:00:17 +02:00
Sébastien Villemot 0d11f8182a
Block decomposition: no longer compute deterministic simulation from dynamic.m file
By the way, fix bug where oo_ was not modified by solve_one_boundary.

Also convert oo_.deterministic_simulations.status to a boolean in the block
routines, for consistency with the non-block case.
2020-06-02 17:46:29 +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 caea047c2d
solve_one_boundary: remove unused codepaths for solve_algo={0,1,2,3}
Those cases are handled by dynare_solve.
2020-05-25 17:59:54 +02:00
Sébastien Villemot 2015b79279
solve_{one_boundary,two_boundaries}: convert some input arguments to logical type 2020-05-25 16:59:20 +02:00
Sébastien Villemot d03cc56587 solve_algo=7 and stack_solve_algo=2 are now allowed under Octave
The gmres() function has been implemented (actually since Octave 3.4.1!).
2018-08-02 15:20: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) 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
Stéphane Adjemian (Hermes) 837c812c17 Efficiency changes.
+ Use scalar product when possible, ie replace sum(x.*x) by x'*x,
+ Add parenthesis around scalar products, ie replace a*x'*x by a*(x'*x),
+ Removed global options_ in lnsrch1 (only used for solve_tolx).

Note that the scalar products could be replaced by a loop for small
problems. If the number of unknow is smaller than 70 the loop is
faster (10 times faster if the number of unknowns is less than 10).
2016-02-26 22:06:49 +01:00
Stéphane Adjemian (Charybdis) 38b548c4d0 Fixed licence header. 2015-02-20 14:48:25 +01:00
Stéphane Adjemian (Charybdis) d19592f761 Fixed homotopy for perfect foresight models with block option, cosmetic changes. 2015-02-20 14:48:25 +01:00
Stéphane Adjemian (Charybdis) ddd95361ba Cosmetic changes. Added isoctave function to replace exist('OCTAVE_VERSION'). 2013-11-04 10:54:45 +01:00
Stéphane Adjemian (Charybdis) cc0d9b42f0 Changed name of options_.maxit as options_.simul.maxit. 2013-10-09 13:06:06 +02:00
Sébastien Villemot 3025a14ed9 Adapt for removal of luinc in MATLAB R2013a 2013-03-25 12:05:56 +01:00
Houtan Bastani dcaed91f66 fix to license call (checkout only works for Matlab version >= 2011a) 2012-01-09 11:57:47 +01:00
Houtan Bastani 9be84bdf65 make check: fix bug in check for license 2011-12-23 18:22:41 +01:00
Ferhat Mihoubi 12187710e7 Get rid of global variables 2011-11-25 13:07:50 +01:00
Sébastien Villemot c111fc1847 solve_one_boundary: make the case solve_algo=0 work under Octave 2011-09-19 16:41:53 +02:00
Sébastien Villemot c07a915d6e Improve the way we test for existence of toolboxes (more reliable in the case where the toolbox is installed but not activated) 2011-09-19 16:41:53 +02:00
Ferhat Mihoubi 3c818378fe Corrects a bug related to the number of arguments passed to the static m-files 2011-09-16 17:48:23 +02:00
Ferhat Mihoubi 3f48c8723a Additional corrections related to the steady_state operator bug 2011-03-18 14:11:00 +01:00
Michel Juillard 55bb27c5f6 new correction for steady_state operator bug. Steady_state vector is passed as argument to *_dynamic model function. As a result, bytecode is currently broken. 2011-03-13 17:06:57 +01:00
Houtan Bastani 8a0dabd07d use || and && as opposed to | and & where appropriate 2011-02-16 15:14:38 +01: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 ce07223628 - The Temporary terms management with bytecode when the model is block decomposed and solve_algo<5 is now compatible with octave
- Gets rid of warning message during the compilation of bytecode
2011-01-14 19:24:18 +01:00
Ferhat Mihoubi 96b6f1bf05 - Corrects the following problem:
Octave BiCGStab algorithm involves a 0 division in case of a preconditioner equal to the LU decomposition of the A matrix (in a linear system of the form A.x = b).
- The solution:
Checks if the linear system is solved simply using: x_new = x_old + U \ (L \ x_old)
Ticket #11
2011-01-14 19:24:17 +01:00
Ferhat Mihoubi 129303430e The direction is not computed in same way in the dynamic case and in the static case 2010-12-31 16:20:35 +01:00
Ferhat Mihoubi 9cebf270e5 - correction of informations displayed in Solve_one_boundary 2010-10-27 15:30:00 +02:00
Ferhat Mihoubi 39718c8645 - extends steady algorithms to solve_algo=5, 6, 7 and 8 for a block decomposed model without bytcode
-  solve_algo is reordered =
   * 0: fsolve
   * 1: solve1
   * 2, 4: solve1 + block decomposition
   * 3: csolve
   * 5: bytecode own solver (use Gaussian elimination + sparse matrix)
   * 6: LU decomposition with UMFPack (method handling sparse matrix in Matlab)
   * 7: GMRES
   * 8: BiCGStab
2010-10-22 16:49:47 +02:00