Commit Graph

79 Commits (237aa465d23fb3113a27cf2d8f9932bd3c2e2e8f)

Author SHA1 Message Date
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
Stéphane Adjemian(Charybdis) 055ffb0b9e Added second input argument to missing/nanmean routine.
This additional argument is optional and can be used to specify along which
dimension the mean has to be computed.

Fixes the bug introduced in b4204f8b9e for those
who do not have the statistics toolbox.
2018-01-13 00:10:50 +01:00
Johannes Pfeifer fa26ab10e0 Make isfile.m command work with Matlab versions before 9.1 2017-10-17 09:14:15 +02:00
Stéphane Adjemian (Charybdis) d4e3dbe370 Fixes #1541. 2017-10-16 23:23:58 +02:00
Stéphane Adjemian (Scylla) 560a047a53 Moved isfile routine in missing.
This routine has been introduced in R2017b. Closes #1523.
2017-10-10 13:33:32 +02: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
Stéphane Adjemian (Charybdis) 88e1701289 Removed useless commas and semicolons. 2017-05-16 13:24:46 +02:00
Stéphane Adjemian (Charybdis) 76097a799f Added missing struct2array routine. 2017-03-22 15:20:13 +01:00
Johannes Pfeifer ce4ab7f7d8 Unit test wblinv.m under Octave: adjust tolerance 2017-01-18 10:59:53 +01:00
Johannes Pfeifer fccd164926 Provide lower tolerance to Octave's quadv function as integration otherwise stops prematurely 2016-11-10 17:33:18 +01:00
Stéphane Adjemian (Lupi) 33d35bc3c5 Added quantile routine in missing.
This is missing if the stats toolbox is not available. Integration test
TeX/fs2000_corr_ME.mod was failing because of its absence.
2016-06-16 14:33:57 +02:00
Stéphane Adjemian(Charybdis) 7c53ea1e96 Fixed unit tests.
(cherry picked from commit 2cdfc0518350e4f26dd406b1730f2cf20ce29e07)
2016-04-14 17:21:37 +02:00
Johannes Pfeifer 6dddd7a8d4 Add corr.m to missing/stats 2016-04-09 15:22:40 +02:00