Commit Graph

47 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
Houtan Bastani e043c60903
pass M_, options_, oo_ as arguments to stoch_simul, simult_, discretionary_policy. closes dynare#1197 2019-09-12 11:57:01 +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 1e92e308b9
Pruning is not available for order > 3
Ref #217
2019-04-15 18:50:16 +02:00
Sébastien Villemot b1ba53ce05
dynare_simul_ DLL: adapt for an arbitrary approximation order
The last input argument is now a struct containing matrices g_0, g_1,…
Typically one can pass oo_.dr for this argument.

Ref #217
2019-04-15 17:34:01 +02:00
Sébastien Villemot 03ac8c8182
simult_: fix bug in error message 2019-04-12 18:26:30 +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
Johannes Pfeifer f3d7e946e3 Make simult_.m account for logged steady state 2016-03-23 10:36:00 +01:00
Houtan Bastani bdb6a2602e preprocessor: ensure that options_.k_order_solver = 1 when order >= 3, closes #844 2015-02-10 03:39:18 +01:00
Johannes Pfeifer 3e2a75d33a Fix bug in simult_ for purely forward looking models
simult_ simulated one period too much, thinking there was a lag. This resulted in a crash trying to plot irfs.
2013-07-24 23:36:46 +02:00
Sébastien Villemot 61485ab809 Fix copyright notices 2013-06-12 17:04:46 +02:00
Johannes Pfeifer 44a6641782 Bugfix for simult_.m when used with k_order_pert and pruning at order=1
In the rare combination of k_order_solver, pruning, and order=1 the steady state was not subtracted from the starting values when doing simulations
2013-05-11 12:14:11 +02:00
Sébastien Villemot e783084126 Fix comment blocks 2013-04-26 09:50:56 +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
Michel Juillard 9b3c83554a adding the constant (steady state + effect of future uncertainty) to
the simulated series with 3rd order approximation
2013-04-21 21:27:52 +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 2244af9c62 adding pruning option for 3rd order 2012-07-31 21:50:59 +02:00
Sébastien Villemot 38827443f9 Fix simult_.m when order=3 but k_order_solver has not been specified 2011-10-27 16:45:17 +02:00
Stéphane Adjemian (Charybdis) 560800bcc5 Changed the order of the output arguments in kronecker product related mex routines. 2011-09-05 18:57:42 +02:00
Ferhat Mihoubi 3459b08c53 - Corrects the first order approximation of block-decomposed models
- The block-decomposed models can now be estimated
2011-06-18 17:43:45 +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 92d44e4414 correction of the index of the state variables 2011-01-31 10:05:27 +01:00
Stéphane Adjemian (Charybdis) 73fb71b9c8 Removed references to options_.simul_seed. 2010-11-27 00:19:22 +01:00
Ferhat Mihoubi ffaec7ba89 - First elements needed for stochastic simulation of a block decomposed model 2010-11-25 16:11:27 +01:00
Stéphane Adjemian (Charybdis) 1626b0aa76 Added specialized code for purely forward models. 2010-11-25 14:32:33 +01:00
Stéphane Adjemian (Charybdis) 9d4385da5d Put back M_.maximum_lag. 2010-11-19 16:30:55 +01:00
Stéphane Adjemian (Charybdis) ccf778e63a Efficiency improvements in first order stochastic simulations (Simulate data in deviation to the steady state and then,
after the loop, add the steady state using bsxfun routine, which is parallelized in recent version of matlab). Removed
use of M_.maximum_lag.
2010-11-18 14:55:07 +01:00
Stéphane Adjemian (Charybdis) 5c709e4733 Changed set_dynare_threads.m. The number of threads in parallelized mex files to be used if dynare is built with the openmp flag
(--with-openmp) is not passed by an environment variable anymore. The function set_dynare_threads changes the default value of the
number of threads (default is 1) in the options_.threads structure. Changed calls to sparse_hessian_times_B_kronecker_C and
A_times_B_kronecker_C dlls accordingly.
2010-11-15 13:06:39 +01:00
Houtan Bastani 92cb073f3a dynare_simul_: remove instances of mexErrMsgTxt 2010-09-23 10:45:35 +02:00
Houtan Bastani ca24c92ed7 A_times_B_kronecker_C: remove instances of mexErrMsgTxt 2010-09-23 10:45:08 +02:00
Stéphane Adjemian (Charybdis) 945c434afe (1) Added pruning algorithm for second order simulations (matlab code).
(2) Speed improvement in second order simulations (replaced call to matlab's kron function by call to
A_times_B_kronecker_C).

(3) Removed useless globals.

(4) Cosmetic changes and corrections on headers.
2010-05-25 14:00:08 +02:00
Stéphane Adjemian (Scylla) 0889df6161 Completed the reversed extended path routines. 2010-05-12 16:52:26 +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
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 d2b1765c48 v4.1: changing Matlab routines for results display and simulation at order = 3
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3173 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-11-29 21:05:16 +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
sebastien 8d21e0f882 trunk: updated header of simult_.m
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2335 ac1d8469-bf42-47a9-8791-bf33cf982152
2008-12-19 16:49:52 +00:00
sebastien db50368418 v4 matlab: fixed some existing copyright headers (and some other minor header issues)
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1974 ac1d8469-bf42-47a9-8791-bf33cf982152
2008-08-01 12:40:33 +00:00
adjemian 48f23191fb For deterministic simulations of a path between an arbitrary initial condition and the steady state, the path is initialized with the solution obtained from a first order approximation of the model => The number of iterations required for the convergence of the Newton is less important, and on a simple growth model with CES technology I observe also a reduction of the error size.
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1703 ac1d8469-bf42-47a9-8791-bf33cf982152
2008-02-11 14:42:46 +00:00
assia b3bdbb0f22 header updated
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1515 ac1d8469-bf42-47a9-8791-bf33cf982152
2007-12-21 17:13:52 +00:00
michel 475372a52f v4 irf.m, simult_.m: corrected problems with lags > 1
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@721 ac1d8469-bf42-47a9-8791-bf33cf982152
2006-04-29 09:43:21 +00:00
adjemian 0393e5e187 Corrections related to the impulse response functions.
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@473 ac1d8469-bf42-47a9-8791-bf33cf982152
2005-10-01 12:59:40 +00:00
michel 9a9872fd33 dynare_v4 from CVS
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@8 ac1d8469-bf42-47a9-8791-bf33cf982152
2005-02-18 19:54:39 +00:00