Commit Graph

93 Commits (7dd2dd5e24a343fbeaf3522ea5e535c27d8b9f95)

Author SHA1 Message Date
Stéphane Adjemian (Ryûk) 45c0e82f3b
Fix bug introduced in fdb1daad. 2022-05-20 10:29:44 +02:00
Stéphane Adjemian (Ryûk) fdb1daadc9
Deactivate third unit test (local_state_space_iteration_2). 2022-05-20 08:44:28 +02:00
Stéphane Adjemian (Ryûk) c033a08cec
Remove third unit test in local_state_space_iteration_2. 2022-05-13 22:14:07 +02:00
Stéphane Adjemian (Ryûk) 2ff705f15c
Change second unit test for local_state_space_iteration_2...
To something closer to what we actually do when we estimate a model.
2022-05-13 22:12:09 +02:00
Stéphane Adjemian (Ryûk) cd76bdff9e
Fix and update unit tests for local_state_space_iteration_2.
Add mat file with git lfs.
2022-05-13 12:13:46 +02:00
Stéphane Adjemian (Ryûk) c17728da83
Make sure matlab routine is used in first unit test. 2022-05-12 13:02:41 +02:00
Stéphane Adjemian (Ryûk) 49727cf7a0
Remove %$ in unit tests. 2022-05-12 13:00:44 +02:00
Stéphane Adjemian (Ryûk) 68887b36e6
Cosmetic change. 2022-05-12 13:00:02 +02:00
Stéphane Adjemian (Ryûk) 8edc6538bf
Rewrite header doc. 2022-05-12 12:58:32 +02:00
Sébastien Villemot 971a89fb73
Octave 7 now has ordqz (and ordeig was implemented in Octave 5) 2022-04-15 14:33:02 +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 e8c3758fc7 disclyap_fast.m: fix check for convergence with NaN
[skip CI]
2021-06-11 14:22:10 +02:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Stéphane Adjemian (Charybdis) 6fe97182da
Deactivate unit tests for gamrnd if statistical toolbox is available. 2021-04-09 12:44:59 +02:00
Sébastien Villemot 47477e152a
Bump minimal Octave version to 6.2.0 2021-03-12 16:21:57 +01:00
Sébastien Villemot dcfd45bd25
missing/unique_stable.m: also support cell arrays and 2nd output argument
Needed by aggregate.m.
2021-01-29 14:06:40 +01:00
Sébastien Villemot e26a5e2805
NLS: compatibility fix for Octave and MATLAB < R2014b 2021-01-15 17:42:00 +01:00
Sébastien Villemot 8f07a134a3
OLS + aggregate: compatibility fix for Octave < 6
unique(…, 'stable') does not exist in Octave 5.
2021-01-15 17:19:38 +01:00
Johannes Pfeifer eb52fd1eaa Add num_procs.m function in missing
Preserves ability to run Dynare with m-replacements

[skip CI]
2020-11-23 15:51:55 +01:00
Johannes Pfeifer c4c8a0256d Add mjdgges.m unit test
Closes https://git.dynare.org/Dynare/dynare/-/issues/1438
2020-11-13 15:55:20 +01:00
Sébastien Villemot f6c2471eef
New MEX for solving discrete Lyapunov equations with doubling algorithm
This is a Fortran 2008 rewrite of disclyap_fast.m.

Closes: #1737
2020-07-30 16:34:35 +02:00
Sébastien Villemot 6e0f104d7e
Bump minimal MATLAB version to R2014a
Ref. #1713
2020-04-07 16:32:32 +02:00
Sébastien Villemot 1912f67778
MATLAB compatibility fix: automatic broadcasting was introduced in R2016b
For earlier versions, either use bsxfun or handle special cases differently.
2020-01-13 18:30:28 +01: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 4e314a529b
Bump minimal required Octave version to 4.4 2020-01-06 18:29:47 +01:00
Sébastien Villemot 49dc997073
Global reindentation of MATLAB code (excluding submodules)
Also convert to Unix end-of-lines, and remove trailing whitespaces.
2019-12-20 16:30:27 +01:00
Sébastien Villemot 98bdf76581
MATLAB R2009b compatibility fixes
— use XLS instead of XLSX in testsuite datafiles
— use optimset instead of optimoptions
— use quadv/quadl/quadgk instead of integral
— fix race condition in load_m_file_data_legacy.m tests
— use fallback implementation for intersect(…, 'stable')
2019-11-15 18:27:37 +01:00
Dóra Kocsis 4c49eddb97 Add fallback implementation for contains and splitlines functions. 2019-11-13 13:05:28 +01:00
Houtan Bastani 53ce6222c2
remove unused variable in dynare_config 2019-09-05 11:48:19 +02:00
Sébastien Villemot 82cef48eb4
A_times_B_kronecker_C MEX: remove the OpenMP codepath
Testing shows that it is slower than the BLAS path.
2019-06-25 17:26:14 +02:00
Sébastien Villemot e79c618f38
No longer automatically add M-file substitutes for missing MEX files
However, keep the substitutes under matlab/missing/mex/, so that they can be
manually added should the need arise.
2019-05-21 12:37:35 +02:00
Sébastien Villemot c8e8f04a56
Add a replacement for strjoin (missing in MATLAB < R2013a)
As a consequence, revert commits 2e1f189724 and
5d05adeab6.
2019-05-20 12:47:41 +02:00
Sébastien Villemot e48177543b
intersect(…, 'stable') was introduced in MATLAB R2013a
Re-use the existing Octave replacement by making it MATLAB-compatible.
2019-03-26 18:53:51 +01:00
Sébastien Villemot d6c449ea70
narginchk was introduced in MATLAB R2011b 2019-03-26 18:53:51 +01:00
Sébastien Villemot 04323301a5
isdiag was introduced in MATLAB R2014a
Provide a replacement by reusing a similar function that was under
matlab/general/utilities/.
2019-03-26 16:50:06 +01:00
Sébastien Villemot 870d75857c
Simplification for missing nanmean
Handle it as other functions from the Statistics toolbox
2019-02-25 15:28:23 +01:00
Sébastien Villemot 1f84bc051d
Under Octave, the "statistics" Forge package is now a requirement
The gamrnd fallback under matlab/missing/stats/ does not work under Octave
because the +gamrnd/ folder is not accessible (it has the same name as the
function, which does not work under Octave).

Instead of fixing this, rather make the statistics toolbox a requirement, since
anyways it is very easy to obtain under Octave.

Accordingly:
- do not try to run the unit tests of matlab/missing/stats/ under Octave
- merge the matlab/missing/stats-matlab/ into matlab/missing/stats/, since this
  directory is now MATLAB-only.

Also:
- move matlab/distributions/+gamrnd/ under matlab/missing/stats/ for
  consistency
- in the manual: remove obsolete link to Octave downloads on the Dynare
  website; update URL of Octave Forge

Closes #1638
2019-02-18 17:41:10 +01:00
Sébastien Villemot 0b1c465b38
Octave compatibility fix: intersect(..., 'stable')
The 'stable' option of intersect(), which keeps the element order of the first
argument, is not available on Octave. Provide a fallback implementation, and
adapt the code.
2019-02-15 18:43:19 +01:00
Sébastien Villemot fc74dded42
Increase tolerance in quantile.m unit test
The failure appeared because of (seemingly unrelated) changes in gamrnd, which
have modified the random seed when entering this test.
2018-12-17 12:38:41 +01:00
Stéphane Adjemia (Scylla) d5bdc19e19
Added unit tests for gamrnd algorithms.
Only tests first order moemnt, second order moment and Cumulative Distribution
Function (should also add some tests for independance).
2018-12-15 16:48:25 +01:00
Stéphane Adjemia (Scylla) e32b87d4b3
Streamlined gamrnd routine.
Give access to all the implemented algorithms through the third argument. The
last argument is a structure with two fields `large` and `small`. The first
field specifies the algorithm to be used for α>1 while the second field defines
the algorithm to be used for α ∈ (0,1).

Default algorithms are:

 - Cheng (1977) for α>1,
 - Johnk (1964)  α ∈ (0,1).
2018-12-15 16:48:24 +01:00
Stéphane Adjemia (Scylla) 162c8ab7d0
Set default value for the second hyperparameter. 2018-12-15 16:48:24 +01:00
Stéphane Adjemia (Scylla) 426c63a735
Created namespace for gamrnd routines.
Also fixed implementation of Jonk's algorithm.
2018-12-15 16:48:23 +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
Stéphane Adjemian(Charybdis) ac3af2052a Remove test from Octave testsuite.
The function is only called by Matlab if the statistics toolbox is not available.
2018-07-18 11:14:47 +02:00
Stéphane Adjemian(Charybdis) 9d01b17e03 Removed one unit test from Octave testsuite. 2018-07-17 11:30:20 +02:00
Sébastien Villemot 57f6183d2f Move some functions out of missing/stats/, since they are only needed for MATLAB 2018-06-06 13:02:42 +02:00
Sébastien Villemot 7b546ba696 Compatibility fix for MATLAB < R2010b (7.11) 2018-05-30 17:44:46 +02:00
Stéphane Adjemian(Charybdis) afbac2e8eb Added strsplit routine in missing. 2018-05-16 16:41:43 +02:00
Sébastien Villemot e2c2f2d966 Remove fallbacks for ilu, linsolve and ordschur under Octave
These functions are all included in Octave 4.2.
2018-05-16 10:48:44 +02:00