Commit Graph

113 Commits (f6f4ea70fbce9fd584c72c15a2932fa02a854d0b)

Author SHA1 Message Date
Houtan Bastani 31ff8da853 remove unused variables from preprocessor 2011-08-19 16:59:12 +02:00
Houtan Bastani 5c48733f55 output mex file for static model (closes #183) 2011-08-19 16:57:27 +02:00
Houtan Bastani c6a33a96f1 remove writing of getPowerDeriv M function from block code functions 2011-07-25 10:21:02 +02:00
Michel Juillard 4d4456b8d6 adding creation of <fname>_set_auxiliary_variables.m containing recursive definition of auxiliary variables 2011-07-24 20:56:30 +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 912b22d0e9 correcting bug in forcing real values for complex elements of Jacobian in static model 2011-05-11 07:32:00 +02:00
Houtan Bastani d0d9fde6af bug fix: allow use of external functions with model local variables 2011-04-12 16:42:56 +02:00
Sébastien Villemot 60b70df4c1 Updated copyright notices 2011-02-04 17:27:33 +01:00
Sébastien Villemot d264b7b2e3 Reindentation of the preprocessor 2011-02-04 16:25:38 +01:00
Ferhat Mihoubi 1b5418a882 - For static model considers two different management cases for temporary terms: one for an evaluated model and another for a simulated model 2010-12-31 16:46:09 +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
Ferhat Mihoubi cf3967d19d - Correction of a bug in the Jacobian Matrix computation for a non block-decomposed model using bytecode 2010-11-25 16:11:22 +01:00
Ferhat Mihoubi c89682670d - The Jacobian matrix in the block decomposed model without bytecode option is now sparse 2010-10-22 16:20:28 +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
Ferhat Mihoubi 810416ebe6 - Extends the algorithms compatible with bytecode to compute the steady-state (ticket #11). The new values for solve_algo are:
* 0: fsolve
   * 1: solve1
   * 2, 4: solve1 + block decomposition
   * 3: csolve
   * 5: LU decomposition with UMFPack (method handling sparse matrix in Matlab)
   * 6: GMRES
   * 7: BiCGStab
   * 8: bytecode own solver (use Gaussian elimination + sparse matrix)

- Bytecode can now evaluate a specific block instead of the overall blocks (new bytecode's option 'Block = block_number')
2010-10-11 19:21:32 +02:00
Ferhat Mihoubi 5490f1bb09 RESID command is compatible now with block option and without bytecode option (closes ticket #45) 2010-09-17 16:54:43 +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 6f9e0ca1e9 Preprocessor: replace non-standard operators 'and'/'or' by '&&'/'||' 2010-04-28 16:03:32 +02:00
Sébastien Villemot 5546658b4d Preprocessor: with 'steady_state_model' command, write auxiliary equations in the steady state file 2010-04-27 17:04:52 +02:00
Houtan Bastani 9abc7563c1 Add support for external functions 2010-02-23 18:15:18 +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
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 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
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
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 0b986771a4 - bug fix: block not set to 1 in StaticModel
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2877 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-08-31 18:56:29 +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
sebastien 4b48b5efc0 Preprocessor: handle model local variables in blocks_mfs mode of steady command
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2841 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-07-13 13:44:46 +00:00
sebastien 165ede20b4 Preprocessor: refactor usage of GNU g++ specific features
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2840 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-07-13 09:13:42 +00:00
sebastien daae864666 Preprocessor:
* new ExprNode method for computing set of ModelLocalVariables of an expression
* factorized code with collectEndogenous() and collectExogenous() methods


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2839 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-07-10 16:42:08 +00:00
sebastien 81b6823bb3 Preprocessor: bugfixes to block_mfs option of steady
* sort recursive variables in topological order in the _static.m file
* collectEndogenous() returs type specific IDs, not symb_id!


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2833 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-07-10 14:22:40 +00:00
sebastien 8a6d750c51 Implemented MATLAB part of the block_mfs option to steady.
(Still need to fix a bug)


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2829 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-07-09 16:35:07 +00:00
sebastien 84f3993088 Preprocessor, static model handling: added code to output M-file when in block+MFS mode
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2820 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-07-07 15:58:17 +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 aedc60cbc1 trunk preprocessor: added new option "block_mfs" to "steady"
* normalizes the static model
* computes its block decomposition, using topological order
* for each block, computes minimum feedback set of variables
* at this stage, only produces text output (no change in the computation of steady state)


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2798 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-06-30 15:07:09 +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 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 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
sebastien 63c018a64f trunk preprocessor:
* finished normalization algorithm
* added routine for computing the equations which are already in normalized form


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2645 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-28 17:11:48 +00:00
sebastien 261f08dce3 trunk StaticModel.cc: added model normalization (still need to force normalization of equations of the form a = f(b,c))
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2638 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-27 17:15:14 +00:00
sebastien 331edd8d92 trunk preprocessor: cosmetic changes
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2614 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-20 15:54:19 +00:00
sebastien 34ee60fbe7 trunk preprocessor:
* added support for derivatives of Hessian w.r. to parameters
* added "identification" command which does nothing for the moment, except triggering those derivatives w.r. to params


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2613 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-20 13:58:15 +00:00
sebastien a0af8f7ea0 trunk preprocessor: restructuring the way we decide which derivatives to compute
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2610 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-20 10:48:54 +00:00
sebastien d99229ca24 trunk preprocessor:
* fixed bug with planner_objective
* fixed another bug due to unitialized max_{lead,lags} values


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2604 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-18 18:07:28 +00:00
sebastien 90e8fbda8b trunk preprocessor: restructuration of the code before adding derivatives w.r. to parameters (in particular, removed VariableTable, and replaced it by a system of derivation IDs)
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2597 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-17 16:26:23 +00:00
sebastien a2da8397f8 trunk preprocessor: added missing headers for recent versions of GCC
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2594 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-14 14:47:57 +00:00
sebastien 7fa0d9722d trunk preprocessor:
* created a distinct expression tree for the static model (thus giving better sharing of sub-expressions and better computation of temporary terms for the static model)
* for that purpose, created StaticModel and DynamicModel classes (ModelTree still persists, but only contains code shared between StaticModel and DynamicModel)
* removed sparse static file (to be later replaced by new algorithm for steady state computation on large models)


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2592 ac1d8469-bf42-47a9-8791-bf33cf982152
2009-04-14 14:39:53 +00:00