Commit Graph

37 Commits (7e770f69e791e705ab535126e0157130dc9d40c6)

Author SHA1 Message Date
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 e281f35213
Lift upper restriction on approximation order
Ref #217
2019-04-15 17:34:01 +02:00
Sébastien Villemot b556290d60
k-order DLL: simplify and better document correspondence between Dynare and Dynare++ variable orderings 2019-04-10 09:23:32 +02:00
Sébastien Villemot efa1f39e71
k-order DLL: finally adapt for M_.{endo,exo}_names as cell arrays 2019-04-08 18:47:49 +02:00
Sébastien Villemot 86a607a4fc
k-order DLL: make the output arguments ready for arbitrary order 2019-04-08 18:47:49 +02:00
Sébastien Villemot dd09264b03
k-order DLL: return unfolded matrices in 5th output argument
Thus we can remove unfolding code from k_order_pert.m.
2019-04-02 19:16:13 +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 (Scylla) 8359b90cdf Cosmetic changes. 2014-01-30 13:00:25 +01:00
Johannes Pfeifer 2eb43cf2f6 Add check for purely backwards model to k_order_pert
The k_order_solver does not solve purely backwards models (as is the case in stochastic_solvers.m). But in contrast to stochastic_solvers, there is no check and no warning. Entering the mex-file then results in a crash of Matlab
2013-06-23 12:24:06 +02:00
Sébastien Villemot e30cbef217 Better fix for the issue raised in cc5527c commit message 2013-05-17 10:39:05 +02:00
Sébastien Villemot 4f8af445f7 Revert "Move filling of decision rules to respective orders"
This reverts commit cc5527c843.

This commit had the negative consequence that dr.ghx, dr.ghu… were no longer
set at order 3.
2013-05-17 10:32:27 +02:00
Johannes Pfeifer cc5527c843 Move filling of decision rules to respective orders
Previously, with pruning set to 1 and the option k_order_solver, the
fields like dr.ghu were not set in k_order_pert, even at order=1. But
stoch_simul tries to use them to display the decision rules. Similarly
for order 2. The respective setting of the decision rule fields is now
moved to the respective cases and always conducted at order 1 and
conducted at order 2. This avoids crashes if decision rules of
theoretical moments are requested.
2013-05-13 19:23:38 +02:00
Johannes Pfeifer 42081aec88 Filter out stale loglinear option
With a previously set loglinear option, both k_order_pert and
stochastic_solvers at order>1 transformed the first order solution, but
kept the higher order terms untransformed. Now, both functions output an
error.
2013-05-08 18:18:34 +02:00
Johannes Pfeifer 996ff3bfd3 Remove mexErrCheck from k_order_pert to make it obey the noprint-option
Currently, all stochastic solvers put the error code to info(1) and use
print_info to output the error. The only exception was k_order_pert,
which immediately created an error. Thus, the use of k_order_pert did
not allow for continuing after encountering errors, because only
print_info obeys the noprint-option. Replacing mexErrCheck by setting
info should deliver the correct behavior.
2013-05-02 14:38:47 +02:00
Johannes Pfeifer c55d0a3ae4 Remove pruning_forecast_approximation introduced in cdb7b01879 2013-04-25 12:04:44 +02:00
Johannes Pfeifer cdb7b01879 Implement Andreasen et al. 2013 pruning at order
Implements and documents the Andreasen et al. 2013 pruning at order=3
and sets it as the default at this order. Michel's pruning based on the
approximation of the forecast function has been assigned the option
pruning_forecast_approximation. The preprocessor-interface still needs
to be added for this option. Moreover, more documentation/a reference
what this option does is needed. At a later point, we might change the
default to Michel's approach.
2013-04-24 23:07:01 +02:00
Johannes Pfeifer 5cb9b02863 Fix unfold for third order pruning 2013-04-24 13:09:40 +02:00
Michel Juillard d97e036868 fixing missing increment of index in unfold3, unfold21, unfold12 2013-04-21 20:48:26 +02:00
Sébastien Villemot c121aa14b1 Remove oo_.dr.{nstatic,npred,nboth,nfwrd,nspred,nsfwrd}
Replace them by equivalents in M_ (and an extra one: M_.dynamic).

IMPORTANT POINT: oo_.dr.npred used to count both purely backward and mixed/both
variables. This was the cause of lots of confusion. The new M_.npred only
counts purely backward variables.

We now have the following indentities:

M_.npred + M_.nboth + M_.nfwrd + M_.nstatic = M_.endo_nbr
M_.nspred = M_.npred + M_.nboth
M_.nsfwrd = M_.nfwrd + M_.nboth
M_.ndynamic = M_.npred + M_.nboth + M_.nfwrd
2012-11-16 20:05:13 +01:00
Michel Juillard 9e6c58572e fixing bug in pruning at order=3 2012-08-02 10:09:44 +02:00
Michel Juillard 2244af9c62 adding pruning option for 3rd order 2012-07-31 21:50:59 +02:00
Sébastien Villemot a66594caed Add MEXEXT define to build system, adapt relevant DLL and Windows packaging
Closes: #235
2012-01-09 12:39:09 +01:00
Houtan Bastani b63590712c fixed bug in argument number check and removed unused variable 2010-12-14 18:42:29 +01:00
Houtan Bastani e32c8b1b76 k_order_perturbation: remove instances of mexErrMsgTxt and mexErrMsgIdAndTxt 2010-09-23 10:44:39 +02:00
Sébastien Villemot 8589be3d4b K-order DLL: cosmetic changes
- remove unused argument of the DLL
- fix documentation inside source file
2010-08-30 17:11:58 +02:00
Sébastien Villemot 3d2a698ab9 Minor fix: replace operator & by && in MATLAB conditionals (for better compatibility with Octave) 2010-08-23 17:39:46 +02:00
Sébastien Villemot b842251c2c Added missing copyright notice 2010-08-20 16:01:43 +02:00
michel f06b4e180a 4.2: fixed bug in k_order_pert.m for order == 1
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3376 ac1d8469-bf42-47a9-8791-bf33cf982152
2010-01-25 14:52:48 +00: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
george a5dad180ca opt taken out
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3193 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-12-03 09:58:58 +00:00
george 95f36d5d68 yss error taken out
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3192 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-12-03 09:37:06 +00:00
george aa6cf78250 Adding loglinear correction and the 2nd output argument for the 1st order as there must be 1+order output variables
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3191 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-12-03 08:14:10 +00:00
michel 48dad3e37a 4.1: add preprocessor interface for k_order_solver
rename use_k_order to k_order_solver in Matlab procedures
     fix tests


git-svn-id: https://www.dynare.org/svn/dynare/trunk@3179 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-11-30 19:54:45 +00:00
michel a715408698 v4.1: Matlab routines for k_order_perturbation
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3171 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-11-29 21:01:40 +00:00