Commit Graph

261 Commits (f6f4ea70fbce9fd584c72c15a2932fa02a854d0b)

Author SHA1 Message Date
Houtan Bastani c03f89eb8d preprocessor: simplify if statement 2013-11-18 12:16:37 +01:00
Houtan Bastani 6d6701aa50 revert change that breaks gcc build 2013-11-05 18:21:12 +01:00
Houtan Bastani 1ae5832e13 preprocessor and matlab mex fixes for clang compilation 2013-11-05 18:04:57 +01:00
Sébastien Villemot 1634c7c50f Always initialize M_.maximum_{endo,exo}_{lead,lag} and M_.params
Closes #515
2013-11-04 16:02:28 +01:00
Houtan Bastani 114cb8bc25 missing semicolon 2013-10-29 12:38:28 +01:00
Sébastien Villemot 46c7622f1c Reactivate and fix the test for the balanced growth path.
If the homogeneized equation evaluates to zero, then we skip the
test (otherwise the 2nd derivative of the log is infinite, and the test fails
while it should not necessarily).

Closes #506
2013-10-29 18:46:54 +08:00
Stéphane Adjemian (Charybdis) 7063e2d8be Changed name of options_.maxit as options_.simul.maxit. 2013-10-09 13:06:06 +02:00
Houtan Bastani 76714b34df new nostrict command-line option does not exit when there are more endogenous than equations (closes #2) 2013-09-13 14:44:01 -04:00
Johannes Pfeifer 9d3722fdcb Add full function header to static and dynamic model files 2013-07-28 11:32:14 +02:00
Sébastien Villemot bbc422cf5a Fix copyright notices 2013-06-12 17:04:46 +02:00
Sébastien Villemot 55a548282c Possibility of restricting differentiate_forward_vars to some variables
Closes #351
2013-05-17 16:53:15 +02:00
Sébastien Villemot 94e6f569b8 Add new model option 'differentiate_forward_vars' (ref. #351) 2013-04-25 18:09:31 +02:00
Sébastien Villemot 75f8467803 Implement tags [static] and [dynamic] for equations
Closes #307
2013-04-11 17:11:35 +02:00
Michel Juillard 24cac29cdf removed changes linked with transforming variables to avoid log or
power of negative numbers
2013-04-09 16:35:57 +02:00
Sébastien Villemot 08c2b6e1c6 Automatic detrending engine can now handle models written in logs (ref. #309)
- new command `log_trend_var'
 - new option `log_deflator' to `var' command
2013-03-26 16:51:17 +01:00
Sébastien Villemot 69a5271db7 Revert spurious preprocessor changes introduced in dfa744f 2013-03-26 16:51:10 +01:00
Ferhat Mihoubi 832c9d37ef - adds new files: Evaluate.cc and Evaluate.hh to bytecode 2013-03-22 16:34:50 +01:00
Sébastien Villemot dc1be70d82 Add derivatives of static model w.r.t. parameters
The new file is <FILENAME>_static_params_derives.m

Closes: #160
2012-11-29 18:07:48 +01:00
Sébastien Villemot 6fc8deed49 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
Sébastien Villemot f878d8a644 Isolate block decomposition code
This should fix some random crashes of the preprocessor
2012-09-28 18:41:18 +02:00
Sébastien Villemot 67a1737f00 Update copyright notices 2012-06-08 18:22:34 +02:00
Houtan Bastani cf49fd3b99 preprocessor: handle compilation warnings 2012-06-06 16:30:36 +02:00
Sébastien Villemot 2ac4f59489 Fix bug introduced in 4b86df05 2012-06-05 09:48:03 +02:00
Sébastien Villemot 3175a25663 Preprocessor: remove MATLAB short-circuit operators
They emit a warning under Octave
2012-06-04 17:18:13 +02:00
Michel Juillard 73b4052f2b first implementation of transform_logpow. It creates too many auxilary
variables and probably violates Jensen inequality in some cases.
2012-05-23 15:09:33 +02:00
Michel Juillard 2098528f9e starting implementation of transformed variables to replace arguments
of log and pow functions so as to insure non-negative arguments
2012-05-21 22:05:19 +02:00
Ferhat 255d64e6d1 Corrects the number of lead and lags of a block 2012-02-17 10:48:28 +01:00
Sébastien Villemot a32043c2a5 Preprocessor: compute temp. terms for 2nd deriv of residuals and jacobian wrt
params and 1st deriv of hessian wrt to params
2012-01-20 12:07:36 -05:00
Houtan Bastani 67f3a0ecc0 preprocessor: separate dynamic and static functions from their mexfiles 2011-12-23 18:22:41 +01:00
Sébastien Villemot 03fbe74c70 Fix compilation error in preprocessor
Error introduced in ca10372607d71bf2b5d99d2a9fe6c2b3bd352ff4
2011-10-29 12:22:14 +02:00
Ferhat Mihoubi 287c0647fa * Correction of a bug appearing in a block decomposed model when an observable variable are also a state variable 2011-10-28 22:25:05 +02:00
Houtan Bastani b75d0e733f Remove unused expectation syntax 2011-10-26 14:30:47 +02:00
Sébastien Villemot 0298a70faa aux vars: update C++ comment to reflect last changes 2011-10-21 16:56:13 +02:00
Michel Juillard 17c8ae5c9d code simplification after commit 9425b36358b9b1a6dcfb82cbf0cd423c64748bff 2011-10-20 20:40:15 +02:00
Michel Juillard 7d44671996 fixing problems related to auxiliary variables 2011-10-19 12:47:15 +02:00
Ferhat Mihoubi fd923d428d Displays an error message when the model contains pound expressions and 'bytecode' or 'block' options are present 2011-10-14 14:35:32 +02:00
Ferhat Mihoubi 37d438dd5c Cleans the messages displayed 2011-10-12 14:45:53 +02:00
Michel Juillard 16f550a986 preprocessor, auxiliary variables: fixes ordering issue introduced in
347ab4d0c0c79ae9a42898c1d5409d78708bb8a8 and corrects the earlier
ordering problem.
2011-09-28 22:11:44 +02:00
Ferhat Mihoubi c4e0158e44 block-Kalman filter is now available when block option is used 2011-09-20 14:18:31 +02:00
Houtan Bastani 5dc9092723 cosmetic: simplify jacobianHelper, hessianHelper and sparseHelper functions and fix spacing in dynamic file 2011-08-19 16:59:18 +02:00
Ferhat Mihoubi 94e113b7a5 correct a bug during the state variables detection 2011-08-11 14:15:51 +02:00
Houtan Bastani c6a33a96f1 remove writing of getPowerDeriv M function from block code functions 2011-07-25 10:21:02 +02:00
Houtan Bastani 1e4c0852f6 bug fix: getPowerDeriv not accessible from modfile.m 2011-07-19 14:35:35 +02:00
Sébastien Villemot d2696ca2f0 Preprocessor: factorize code common between StaticModel and DynamicModel, and put it in ModelTree 2011-06-22 11:56:07 +02:00
Sébastien Villemot 06f7d23e90 Preprocessor: fix crash when no computational task is required 2011-06-22 11:34:38 +02:00
Ferhat Mihoubi 53fe3fe8ed - Compute :
+ the number of static, lag, lead and both variables,
  + the lead_lag_incidence matrix for variables related to previous blocks
  + the index of reordered policy rule
for each block during the preprocessing step
- correct a bug in the comment related to first order derivatives in _dynamic.m file for a block decomposed model without bytcode
- avoid simplification of the Jacobian matrix (setting to zero all elements below the cutoff) for  estimated or stochastically simulated models: the cutoff option is set to 0.
2011-06-18 17:53:50 +02:00
Houtan Bastani 7eade47160 external_function: bug fix in writeParamsDerivativesFile, writeDynamicModel and writeStaticMFile 2011-06-10 11:09:43 +02:00
Michel Juillard 007b37f19b updating one comment 2011-05-27 22:09:54 +02:00
Michel Juillard f9287ac796 renamed ramsey_policy_discount_factor by optimal_policy_discount_factor because it is also used by discretionary_policy 2011-05-24 16:02:42 +02:00
Sébastien Villemot 6c37f6def8 Preprocessor: use NaN() for initializing vector of parameters 2011-04-27 12:07:13 +02:00
Houtan Bastani d0d9fde6af bug fix: allow use of external functions with model local variables 2011-04-12 16:42:56 +02:00
Houtan Bastani be4c5c92ef ramsey_policy: allow discount factor to be an expression 2011-03-29 18:18:32 +02:00
Houtan Bastani be236c6402 code cleanup 2011-03-28 11:34:42 +02:00
Houtan Bastani d2a6f0f42c Implement explicit writing of first order conditions of Ramsey problem (ticket #5) 2011-03-24 17:17:15 +01:00
Ferhat Mihoubi 316b935cc0 Correct a bug when the model contains deterministic exogenous variables and bytecode option is used.
Note that stochastic simulations do not work for the moment with block option.
2011-03-18 01:09:20 +01:00
Michel Juillard 8c9b6e44af put *_params_derivs.m and identification code in conformity with additional steady state argument in *_dynamics.m 2011-03-14 11:40:40 +01:00
Michel Juillard cb1e8a55b1 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
Sébastien Villemot cb64ade507 Preprocessor: added model local variable definitions to parameter derivative file 2011-03-07 11:59:12 +01:00
Sébastien Villemot 72fca072f0 Preprocessor: fix bug in parameter derivatives file 2011-02-21 12:43:11 +01:00
Sébastien Villemot d264b7b2e3 Reindentation of the preprocessor 2011-02-04 16:25:38 +01:00
Ferhat Mihoubi 483b430e54 The derivatives with respect to endogenous variables of the previous blocks are corrected for a block-decomposed model without bytecode option 2011-02-03 17:29:26 +01:00
Ferhat Mihoubi d999d15ff6 - Adds a "lead_lag_incidence" matrix in each block for the endogenous variables belonging to previous blocks (other_endo) 2011-01-31 17:47:22 +01:00
Sébastien Villemot 30a2b2b650 Fix derivatives of STEADY_STATE operator w.r.t. parameters (ticket #128) 2011-01-13 18:08:26 +01:00
Houtan Bastani 448553fe8e fixed bug: end _dynamic and _static and getPowerDeriv functions with "end" tags to comply with commit d8dbc68e841a93b40d2a5005bd69bdd1cbb1778a 2010-12-22 09:48:05 +01:00
Ferhat Mihoubi 7a6776197d - The function getPowerDeriv must end with an "end" instruction 2010-12-17 18:54:02 +01:00
Houtan Bastani 7a26fe2ebd extend domain of derivative of x^p to x=0 under certain conditions (see ticket 78) 2010-12-13 17:03:57 +01:00
Ferhat Mihoubi 751c0da2a1 - external functions are compatible with block decomposition and/or bytecode 2010-12-10 12:06:50 +01:00
Sébastien Villemot 2984f61fe0 Bugfix at order 3 (hopefully was not affecting final results, thanks to Pablo Winant for spotting this):
- in the 3rd derivatives matrix, among symmetric elements, the first one had
the right values but the following ones were set to zero
- moreover, the k-order DLL was trying to add all the symmetric elements in the
folded tensor, instead of only keeping one value among all the symmetric ones
- hopefully, Ondra's tensor library was (silently) refusing to add symmetric
elements after the first (and right) value had been added
- so the final result was correct
2010-12-06 17:00:46 +01:00
Ferhat Mihoubi 3f6ddd1c3f - Adds the derivatives with respect to deterministic exogenous variables
and corrects the computation of the number of column in the jacobian matrices in a block decomposed model without bytecode
- Identical corrections for models using bytecode without block decomposition
2010-11-25 16:11:12 +01:00
Sébastien Villemot 0269c5766c Preprocessor: max lead/lags in the model are no longer affected by lead/lags on parameters (closes #153) 2010-11-18 11:21:20 +01:00
Ferhat Mihoubi b781c44e5a Check command is now compatible with block and bytecode options 2010-10-27 15:34:48 +02:00
Ferhat Mihoubi ab311cc0fd - Store the incidence matrix containing reordered equations and variable in block_structure 2010-10-27 15:30:01 +02:00
Ferhat Mihoubi f7f83d6973 - Correction of several bugs with Octave
- Add wrapper needed to compute the steady-state using bytecode and solve_algo = 0, ..., 4
2010-10-22 10:09:07 +02:00
Houtan Bastani a7fc3361ac trend_var, growth_factor, deflator: stationarize a nonstationary model and test 2010-10-18 16:07:42 +02:00
Sébastien Villemot 3218d3c72f Preprocessor: don't create auxiliary variables for expressions appearing only
in unused model local variables
2010-10-11 12:58:38 +02:00
Sébastien Villemot 63d0fb3f04 Preprocessor: implement STEADY_STATE operator with "use_dll" and "block"
options (closes #98)
2010-09-20 17:04:38 +02:00
Ferhat Mihoubi f026137fa9 - Adding the relaxation method for block and/or bytecode options
- Changing the the stack_solve_algo option :
Previous version             New version
1 : Sparse LU                0 : Sparse LU
2 : GMRES                    1 : Relaxation
3 : BiCGStab                 2 : GMRES
4 : Sparse LU & Optimal Path 3 : BiCGStab
5 : bytecode own solver      4 : Sparse LU & Optimal Path
                             5 : bytecode own solver
2010-09-17 12:18:25 +02:00
Ferhat Mihoubi 3e1a2ad450 - Substitutes lead for exogenous and endogenous variables in the deterministic case: direct substitution of the variables even in non-linear expressions 2010-09-17 12:17:09 +02:00
Ferhat Mihoubi 2da9d5adda Bug correction in the deterministic simulation: to solve a purely backward or forward looking block requires contemporaneous derivatives only. 2010-09-17 12:17:00 +02:00
Ferhat Mihoubi f68e4fd455 - compute the jacobian matrix for exogenous, det_exogenous and previous blocks endogenous
- preprocessor provides informations about the dynamic structure of each block
- extends the algorithms available with bytecode: stack_solve_algo = 1, 2, 3 and 4 is compatible the bytecode. Speed and memory requirement are improved with stack_solve_algo = 1 or 4 for large scale models.
- bytecode can be used to evaluate a model
2010-09-17 12:16:47 +02:00
Sébastien Villemot 2c10d03368 Preprocessor: rename "NodeID" in "expr_t" 2010-09-17 12:13:26 +02:00
Sébastien Villemot c8fdd5d9d1 Preprocessor: uniformize typedef names (with a "_t" suffix) 2010-09-16 19:00:48 +02:00
Sébastien Villemot c3c8fa5cca Preprocessor: clean prototypes of ModelTree methods (removed arguments
redundant with data members, added const keywords, use passing-by-reference)
2010-09-16 17:51:50 +02:00
Sébastien Villemot ae3e741cb8 Preprocessor:
- remove useless output type oMatlabDynamicModelSparseLocalTemporaryTerms
(indistinguishable from oMatlabDynamicModelSparseLocal)
- fix bug in output type of sparse static model
2010-09-16 16:57:35 +02:00
Sébastien Villemot e44c41334e Preprocessor: in the parameter derivatives file, add the global "oo_" when the STEADY_STATE operator is used 2010-08-12 18:16:24 +02:00
Michel Juillard 6c0a0969f6 make sure that 2nd and 3rd order derivatives that haven't been computed are not taken to be zero. 2010-07-17 10:14:22 +02:00
Sébastien Villemot 2356ef7460 Preprocessor: cosmetic changes related to 'size_t' 2010-06-18 15:48:46 +02:00
Sébastien Villemot 1dde6f2ee5 Preprocessor: use a sparse representation for the 2nd derivatives of residual and jacobian w.r.t. parameters and the derivative of hessian w.r.t. parameters 2010-06-07 18:46:57 +02:00
Sébastien Villemot 09bb06b516 Preprocessor: only compute on demand the 2nd derivatives of residual and jacobian w.r.t. parameters and the derivative of hessian w.r.t. parameters 2010-06-07 16:42:27 +02:00
Sébastien Villemot a47a639330 Preprocessor: changing return order of parameter derivatives to match Marco's code 2010-06-04 09:57:56 +03:00
Michel Juillard 188ec4932d preprocessor: corrected missing initialization of v3 in <fname>_dynamic.c 2010-05-21 11:38:23 +02:00
Sébastien Villemot 6f9e0ca1e9 Preprocessor: replace non-standard operators 'and'/'or' by '&&'/'||' 2010-04-28 16:03:32 +02:00
Sébastien Villemot 2cf5c3808d Preprocessor: add a check to DynamicModel::toStatic() 2010-04-23 18:32:30 +02:00
Sébastien Villemot d8dcfa131e Preprocessor: changed the prototype of DataTree::AddLocalVariable() 2010-04-23 18:32:14 +02:00
Houtan Bastani 042a3ced7c second derivatives of model equations w.r.t. parameters. 2010-03-16 10:15:19 +01:00
Houtan Bastani 49e4bc89ae small fix to implementation of second derivatives of jacobian w.r.t. parameters 2010-03-15 17:23:55 +01:00
Houtan Bastani c7093a8385 second derivatives of jacobian w.r.t. parameters 2010-03-15 16:02:07 +01:00
Houtan Bastani 673bf79a5e derivative of hessian w.r.t. params. 2010-03-11 16:51:07 +01:00
Houtan Bastani 9abc7563c1 Add support for external functions 2010-02-23 18:15:18 +01:00
Sébastien Villemot e70d899c66 Preprocessor:
* in DataTree, new functions for testing if some opcode (unary, binary or trinary) is used somewhere in the tree
* removed DataTree::containsSteadyState(), rather use a call to the new utility function
2010-02-23 16:45:56 +01:00
ferhat bce6509773 Adds location indications in error message of "bytecode" + minor correction (string passed as &string).
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3374 ac1d8469-bf42-47a9-8791-bf33cf982152
2010-01-22 16:42:08 +00:00
ferhat f13b95cb87 "bytecode" option can be used without "block" option
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3373 ac1d8469-bf42-47a9-8791-bf33cf982152
2010-01-22 10:03:29 +00:00
houtanb e616667f75 expectation conditional on a restricted information set
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3367 ac1d8469-bf42-47a9-8791-bf33cf982152
2010-01-18 22:08:44 +00:00
sebastien 22000da5ea Changes by Ferhat:
* fix options stack_solve_algo={2,3,4} (closes #68)
* fix crashes for singular normalizations (closes #44) and implement decreasing cutoff
* fail for stack_solve_algo=2 under Octave (because there is no gmres function in Octave)


git-svn-id: https://www.dynare.org/svn/dynare/trunk@3279 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-12-21 10:29:21 +00:00
sebastien 3aa8876538 Beautified preprocessor code (uncrustify + emacs + manual adjustments, in particular with templates in MacroValue)
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3249 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-12-16 17:13:23 +00:00
sebastien 160ec5d7ca preprocessor + bytecode DLL: various enhancements to block and bytecode options (changes by Ferhat)
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3244 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-12-16 13:21:31 +00:00
sebastien 5568e622b8 preprocessor:
* fixed a bug with EXPECTATION operator: now handle model local variables
* substitute EXPECTATION operator even in deterministic models (for avoiding crashes, even if use of this operator doesn't make sense there)
* forbid the use of EXPECTATION and STEADY_STEATE outside model block
* minor implementation changes in EXPECTATION and STEADY_STATE operators

reference manual:
* documented EXPECTATION and STEADY_STATE operators
* added a note in write_latex_{static,dynamic}_model commands documentation about auxiliary variables and other model transformations


git-svn-id: https://www.dynare.org/svn/dynare/trunk@3145 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-11-09 15:13:47 +00:00
sebastien 6bd2cb04de predetermined_variables:
* reworked a little bit the implementation
* documented the command in the reference manual
* added a test


git-svn-id: https://www.dynare.org/svn/dynare/trunk@3143 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-11-09 11:03:18 +00:00
houtanb 07ba8ebdee implements predetermined_variables operator
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3137 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-11-07 18:37:11 +00:00
houtanb 97d65a0096 added default cases to remove gcc warnings
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3116 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-11-02 18:31:50 +00:00
stepan 4784538a62 Removed changes introduced in revision 3108.
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3111 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-10-31 10:54:58 +00:00
stepan a966f0e917 Merge branch 'master' of git@vandrezanne.net:/home/git/repositories/dynare
Conflicts:
	preprocessor/DynamicModel.cc

git-svn-id: https://www.dynare.org/svn/dynare/trunk@3108 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-10-31 07:55:10 +00:00
houtanb e45d3a4cb2 changed expectation operator from BinaryOpNode to UnaryOpNode
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3102 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-10-30 05:21:54 +00:00
sebastien 760085d6fe 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
ferhat c752ca6122 - use of classes to describe the bytecode tags
- use static option for bytecode instead of steady_state option

git-svn-id: https://www.dynare.org/svn/dynare/trunk@3048 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-10-16 16:34:27 +00:00
sebastien 66684bbb9a preprocessor: implement third-order derivatives in USE_DLL mode
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3036 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-10-12 16:09:16 +00:00
sebastien 7bfeef5d7f preprocessor:
* fixed substitution of endogenous with leads >= 2: take into account exogenous with leads in non-linear terms
* fixed substitution of exogenous with leads: take into account other variables with leads in non-linear terms


git-svn-id: https://www.dynare.org/svn/dynare/trunk@3027 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-10-07 16:34:42 +00:00
sebastien 021e0ebb2e preprocessor: in stochastic mode, create auxiliary variables for exogenous with non-zero lead/lag
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3026 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-10-07 14:07:13 +00:00
houtanb 0973dd9fa4 fixes global oo_ declaration for steady state operator as discussed on 14 Sep
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3020 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-10-02 18:36:07 +00:00
sebastien 7c7a59e1b8 preprocessor: reverted useless changes from last commit
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3016 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-10-02 17:02:35 +00:00
ferhat e8d9cbc94a The local variables are implemented with byte code
git-svn-id: https://www.dynare.org/svn/dynare/trunk@3015 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-10-02 16:47:43 +00:00
sebastien 2f1382fab5 preprocessor:
* In stochastic mode, now transforms the model by removing leads and lags greater or equal to 2 (creating auxiliary variables and equations in the process)
* Information about these variables is in structure M_.aux_vars
* Automatically add the necessary initialization for auxiliary vars after the initval block or load_params_and_steady_state


git-svn-id: https://www.dynare.org/svn/dynare/trunk@3002 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-09-30 15:10:31 +00:00
ferhat 0c7fea9e5f - the "steady_state" function is implemented with the "bytecode" option
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2952 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-09-18 16:34:11 +00:00
sebastien 5fb759e486 Don't create model subdirectory in block+bytecode mode
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2904 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-09-08 08:07:07 +00:00
sebastien 155828bc48 Added derivatives of dynamic model residuals with respect to parameters
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2902 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-09-08 08:06:06 +00:00
sebastien d26ff57671 Cleanup "cutoff" and "mfs" options (the former is no longer in options_)
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2888 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-09-03 10:10:06 +00:00
sebastien 743041ecc4 Remove useless "markowitz" data member in DynamicModel and StaticDllModel
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2886 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-09-03 09:57:17 +00:00
sebastien 5dc82b4eed * Added new option stack_solve_algo to simul
* Added solve_algo=5 for steady
* Remove obsolete method option of simul
* Added various checks to avoid unimplemented combinations of bytecode/block/solve_algo/stack_solve_algo


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2882 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-09-02 16:34:48 +00:00
sebastien 53f4320809 Added support for equation tags (thanks to Pablo for providing a patch)
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2880 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-09-02 14:37:59 +00:00
sebastien 00d887f984 Various cleanups related to new options "bytecode" and "block"
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2879 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-09-02 13:36:56 +00:00
ferhat 0a816a4e74 New options for block decomposition and bytecode (see http://www.dynare.org/DynareWiki/ByteCode):
- the options "sparse_dll" and "sparse" are no more available. They are replaced by combinations of block (for block decomposition) and bytecode (for model stored in a binary file)
- markowitz is now an option of simul and steady commands


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2873 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-08-29 15:04:11 +00:00
ferhat 4897b602c6 - extension of normalization of equations to nonlinear equations
- mfs: new option for 'steady' and 'model' commands. Determines the equation belonging to the set of feedback variables.
  mfs = 0 => all variables are considered as feedback variables (default value)
  mfs = 1 => using only naturally normalized equation as potential recursive equations (all variables assigned to unnormalized equations are considered as feedback variable)
  mfs = 2 => adding to the set of potential recursive equation with mfs = 1 the linear equation in endogenous variable normalized (all variables assigned to nonlinear unnormalized equations are considered as feedback variable)
  mfs = 3 => adding to the set of potential recursive equation with mfs = 2 the non linear equation in endogenous variable normalized
- correction of few buggs in simulate.dll
- block_mfs_dll: new option for 'steady' command. Use simulate.dll to solve the steady state model (speedup the computation of the steady-state and the homotopy)

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2866 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-08-25 09:43:01 +00:00
ferhat 56bb43ce4e - sparse_dll option works fine with feedback variables
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2851 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-07-21 15:50:12 +00:00
ferhat 97f73257f6 - minor modifications in Reorder_the_recursive_variables prototype
- no function comment in MinimumFeedbackSet.cc
- writeChaineRuleDerivative in DynamicModel.cc instead of ModelTree.cc


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2836 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-07-10 15:37:51 +00:00
ferhat 8421712f80 - Complete implementation of feedback variables in dynamic model with sparse option
- Normalization of linear in endogenous variable equations 

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2834 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-07-10 15:05:09 +00:00
sebastien 77590c8577 Some restructurings in the preprocessor:
* StaticModel: dropped creation of C file in USE_DLL mode
* StaticModel: added computation of derivatives for block MFS mode
* DynamicModel: catch error codes of mkdir()
* ModelTree: moved "mode" member variable to DynamicModel
* ModFile::writeOutput(): moved manipulations relative to dynamic model file to DynamicModel


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2818 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-07-07 14:20:48 +00:00
sebastien 9595358690 Preprocessor: various minor changes, including
* moved some declarations from ExprNode.hh to BlockTriangular.hh to which they conceptually belong
* replaced non standard boolean operators (and, or, not) by standard ones (&&, ||, !)


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2812 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-07-06 10:36:36 +00:00
sebastien a8c2baa936 Preprocessor: changes to code for chain rule derivation
* fixed a bug in the handling of VariableNode: we now make a copy of the recursive_variables map, instead of modifying that of the caller
* factorized code shared with standard derivation
* various minor cleanups


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2811 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-07-06 09:34:21 +00:00
sebastien 0e665123e7 trunk preprocessor: M_.NNZDerivatives is now a column vector instead of a matrix
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2794 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-06-29 10:52:57 +00:00
sebastien 3041db17c6 trunk preprocessor: fixed bug with sparse Hessian and USE_DLL
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2793 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-06-29 09:27:09 +00:00
sebastien e749a3f979 trunk preprocessor: output the number of non-zero derivatives in main M-file
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2792 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-06-26 13:57:07 +00:00
sebastien 421b8d4f65 trunk preprocessor:
* for 2nd and 3rd derivatives of static and dynamic model, create the sparse matrices in a more efficient way (thanks to Pablo Winant for suggesting this and providing a patch)
* this breaks USE_DLL option at order 2
* fixed bug when hessian or 3rd deriv. matrix was all zero: the matrix was not constructed at all, leading to crashes in Matlab code


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2787 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-06-25 09:56:41 +00:00
sebastien b9d42ca614 trunk preprocessor: fixed logical and operator (thanks to Pablo Winant for pointing this out)
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2785 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-06-25 07:35:08 +00:00
ferhat 4a54f3f538 - References to ModelNormalization erased
- Use derivatives w.r. to lead and lag endogenous in BlockTriangular.cc

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2728 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-06-05 15:30:32 +00:00
ferhat 3737c1aa2e - Correction of several bugs
- normalize an equation linear in its endogenous variable
- Chained rule derivatives (necessary to reduce a block to the feedback equations and variables)

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2726 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-06-05 14:45:23 +00:00
ferhat 78eb785d55 - Bugs correction in the new block decomposition (incorporating the feedback variables)
- First draft of DynamicModel.cc files with feedback variables. 
TODO : 
- reduction of the Jacobian matrix 
- symbolic normalization of equations
- application to the binary code evaluation (simulate.dll).

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2678 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-05-15 22:41:51 +00:00
ferhat 71f3364e05 Correction of few bugs in DynamicModel and BlockTriangular
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2674 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-05-13 22:16:51 +00:00
ferhat 916e950df9 New implementation of block decomposition & feedback variables using Boost for DynamicModel
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2671 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-05-12 23:03:40 +00:00
michel f01306a29b v4.1: added to preprocessor int NNZDerivatives[3] with number of non-zeros derivatives at order 1, 2, and 3
used it to initialize sparse g2 and g3 in Matlab <modfile>_dynamic.m


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2668 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-05-12 20:32:27 +00:00
sebastien 181bda4853 trunk preprocessor: added new statements "write_latex_dynamic_model" and "write_latex_static_model" which list model equations in LaTeX code
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2654 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-30 13:14:33 +00:00