Commit Graph

253 Commits (943db6fb24d9e4b01f31d084696bb8aec9010ff4)

Author SHA1 Message Date
Houtan Bastani 3ca0fcfb31 Merge branch 'master' into rmExtraExo 2015-04-01 15:22:10 +02:00
Michel Juillard 4f1725455a fixing bug in treatment of temporary terms for blocks with *.m files 2015-03-31 15:50:35 +02:00
Houtan Bastani eb23adfb76 remove extra exo’s for shocks statement, nonstationary, and trend vars; fix bugs 2015-03-10 17:57:30 +01:00
Houtan Bastani 6c937b1554 preprocessor: remove extraneous varexo, update model and statements, #841 2015-03-06 16:44:17 +01:00
Stéphane Adjemian (Charybdis) d19592f761 Fixed homotopy for perfect foresight models with block option, cosmetic changes. 2015-02-20 14:48:25 +01:00
Stéphane Adjemian (Charybdis) 1c8e1ab913 Merge branch 'remove-globals-from-blocks' 2015-02-17 13:01:17 +01:00
Stéphane Adjemian (Charybdis) a894357655 Removed options_ and oo_ globals from *all* generated dynamic model
routines (with block option) and adapted some routines to reflect this change.
2015-02-17 12:57:30 +01:00
Stéphane Adjemian (Charybdis) d3275db830 Removed options_ and oo_ globals from generated dynamic model
routines (with block option).
2015-02-16 16:56:17 +01:00
Houtan Bastani dcabcb6b01 preprocessor: new command write_latex_original_model. closes #657 2015-02-16 08:31:30 +01:00
ferhat 6529fe60b0 Bug correction in splitting the jacobian into blocks: the vector variable_2_block is valid only for endogenous variables. 2015-01-21 13:33:29 +01:00
Houtan Bastani 707702a447 Revert "preprocessor: replace oo_.exo_steady_state with steady_state_x, #825"
This reverts commit 2bb97a90d6.
2015-01-14 15:14:57 +01:00
Houtan Bastani 2bb97a90d6 preprocessor: replace oo_.exo_steady_state with steady_state_x, #825 2015-01-14 15:13:48 +01:00
Houtan Bastani 1b869b26a7 fix dates for changes in 86c3c0fb1b and a40323d2fb 2015-01-08 18:39:04 +01:00
ferhat a40323d2fb Bug correction on the way to collect information about the other endogenous variables in a block 2015-01-06 12:45:34 +01:00
Houtan Bastani 12d6113d8a preprocessor: remove unused variables 2014-12-30 21:55:43 +01:00
ferhat 24b2993f50 Solves issues in deterministic simulation:
- replaces maximum_endo_(lead|lag) by maximum_(lead|lag) to determine the maximum number of lead and lag in deterministic simulation
- allows to use bytecode in solve_perfect_foresight_model.m
- Adds model information in bytecode
2014-12-17 09:37:43 +01:00
ferhat eecf154cc1 Correction of a bug when "block" option is used without "bytecode" option in the "model" statement: for consecutive blocks that are evaluated, only the first one is in fact evaluated but not the following ones 2014-10-04 12:19:52 +02:00
Houtan Bastani f4e40dcf83 more explicit warning when dividing by zero in conversion to static model and when reading model #730 2014-10-03 17:04:07 +02:00
Johannes Pfeifer 7ead968240 Add info to dynamic and static file headers that auxiliary equations may be present 2014-07-17 20:39:59 +02:00
Johannes Pfeifer 54d353e255 Fix typo in header of DynamicModel.cc 2014-06-02 13:58:29 +02:00
Michel Juillard 15b44eda25 Merge branch 'master' into ep 2014-05-09 10:02:05 +02:00
Michel Juillard 75291659ec putting functions related to extended preprocessor in ExternalFiles.cc 2014-04-24 20:54:38 +02:00
Michel Juillard ad42818606 fixing extended-preprocessor C++ API and test case 2014-04-24 14:33:04 +02:00
Sébastien Villemot 184b810b65 Fix compilation error introduced in 0983ca78. 2014-04-07 14:21:28 +02:00
Michel Juillard 0983ca78f7 extended-preprocessor: starting a C interface (not finished) 2014-04-05 15:46:35 +02:00
Sébastien Villemot 9c556f709b Merge pull request #636 from JohannesPfeifer/preprocessor
Fix comments in header of dynamic and static files
2014-03-17 15:10:31 +01:00
Michel Juillard fd323a8217 extended-preprocessor: starting a C interface (not finished) 2014-03-16 18:49:54 +01:00
Johannes Pfeifer 370df16cfc Fix comments in header of dynamic and static files
Columns and rows were confused
2014-03-14 10:21:42 +01:00
Sébastien Villemot b4c3d004ad Introduce a new abstract class for external function nodes.
This fixes the following bugs:

- 1st and 2nd ext fcn deriv nodes were incorrectly added to
  DataTree::external_function_node_map, because of the chaining of
  constructors.

- the following methods of FirstDerivExternalFunctionNode were not overloaded:
  toStatic(), buildSimilarExternalFunctionNode()

- the following methods of SecondDerivExternalFunctionNode were not overloaded:
  toStatic(), buildSimilarExternalFunctionNode(), compile(),
  compileExternalFunctionOutput()
2014-03-13 12:12:17 +01:00
Michel Juillard 96ac2c0fd6 extended-preprocessor: update test example1 2014-02-24 13:33:48 +01:00
Michel Juillard f20f2f610a extended-preprocessor: adding back writing of model local variables (#) 2014-02-24 13:33:48 +01:00
Michel Juillard c4846430d9 returning sparse matrix in compressed format 2014-02-24 13:33:48 +01:00
Michel Juillard 49b34d4c94 write C++ version of model functions without temporary terms 2014-02-24 13:33:48 +01:00
Houtan Bastani 0750bc707b ms-dsge: change types of output for better packaging 2014-02-24 12:41:02 +01:00
Houtan Bastani b426f7236c ms-dsge: create C driver file without statements
Conflicts:
	preprocessor/DynareMain2.cc
	preprocessor/ModFile.cc
	preprocessor/ModFile.hh
	preprocessor/Statement.hh
2014-02-24 12:41:02 +01:00
Sébastien Villemot 37742463bc Add line numbers of equations in preprocessor error messages.
Closes #584
2014-01-27 16:41:43 +01:00
Sébastien Villemot 839ae22b1f Add a warning when some exogenous are not used in the model 2013-11-29 16:03:45 +01:00
Sébastien Villemot ed2f6d62c1 Refactor code for collecting variables appearing in expressions
- rename ExprNode::collectVariables in ExprNode::collectDynamicVariables
- new ExprNode::collectVariables: same as above, but without lag information
- remove ExprNode::findUnusedEndogenous: essentially redundant with the above)
- remove ExprNode::collectModelLocalVariables: idem
2013-11-29 15:37:11 +01:00
Houtan Bastani f1a122a654 fix bug introduced by ee812f3881 2013-11-19 13:05:08 +01:00
Houtan Bastani 7abcd5bcb1 preprocessor: bug fix: return oo 2013-11-19 11:56:39 +01:00
Houtan Bastani aa0af5e556 proprocessor: block code bug fix: M and oo not being passed to solve_two_boundaries 2013-11-19 11:54:00 +01:00
Houtan Bastani ee812f3881 clang compilation: replace ostringstream array with vector of strings 2013-11-18 12:16:37 +01:00
Houtan Bastani 5dec309bbd preprocessor: simplify if statement 2013-11-18 12:16:37 +01:00
Houtan Bastani 13bc928b0c revert change that breaks gcc build 2013-11-05 18:21:12 +01:00
Houtan Bastani 5352fb4d16 preprocessor and matlab mex fixes for clang compilation 2013-11-05 18:04:57 +01:00
Sébastien Villemot 27f525e1e4 Always initialize M_.maximum_{endo,exo}_{lead,lag} and M_.params
Closes #515
2013-11-04 16:02:28 +01:00
Houtan Bastani 2d4a42c01f missing semicolon 2013-10-29 12:38:28 +01:00
Sébastien Villemot f889760f61 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) cc0d9b42f0 Changed name of options_.maxit as options_.simul.maxit. 2013-10-09 13:06:06 +02:00
Houtan Bastani 20dba7e623 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 a7eedef031 Add full function header to static and dynamic model files 2013-07-28 11:32:14 +02:00
Sébastien Villemot 61485ab809 Fix copyright notices 2013-06-12 17:04:46 +02:00
Sébastien Villemot 7bbe121769 Possibility of restricting differentiate_forward_vars to some variables
Closes #351
2013-05-17 16:53:15 +02:00
Sébastien Villemot 75b5f1d18a Add new model option 'differentiate_forward_vars' (ref. #351) 2013-04-25 18:09:31 +02:00
Sébastien Villemot 38824dc1e5 Implement tags [static] and [dynamic] for equations
Closes #307
2013-04-11 17:11:35 +02:00
Michel Juillard 39cc313964 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 a0b7178962 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 c681b5e4ed Revert spurious preprocessor changes introduced in dfa744f 2013-03-26 16:51:10 +01:00
Ferhat Mihoubi dfa744fcb3 - adds new files: Evaluate.cc and Evaluate.hh to bytecode 2013-03-22 16:34:50 +01:00
Sébastien Villemot 8c83135c0f 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 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
Sébastien Villemot dd0190bba9 Isolate block decomposition code
This should fix some random crashes of the preprocessor
2012-09-28 18:41:18 +02:00
Sébastien Villemot 1f9cea669a Update copyright notices 2012-06-08 18:22:34 +02:00
Houtan Bastani 72b25638e0 preprocessor: handle compilation warnings 2012-06-06 16:30:36 +02:00
Sébastien Villemot 008d95935c Fix bug introduced in 4b86df05 2012-06-05 09:48:03 +02:00
Sébastien Villemot 4b86df0581 Preprocessor: remove MATLAB short-circuit operators
They emit a warning under Octave
2012-06-04 17:18:13 +02:00
Michel Juillard c6495dfc9d 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 629673199e 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 28a1cf52cd Corrects the number of lead and lags of a block 2012-02-17 10:48:28 +01:00
Sébastien Villemot bcc091a58d 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 5c0a17e9f2 preprocessor: separate dynamic and static functions from their mexfiles 2011-12-23 18:22:41 +01:00
Sébastien Villemot 168f5589a4 Fix compilation error in preprocessor
Error introduced in ca10372607
2011-10-29 12:22:14 +02:00
Ferhat Mihoubi ca10372607 * 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 ce9fe30a7a Remove unused expectation syntax 2011-10-26 14:30:47 +02:00
Sébastien Villemot 0fbcc7378e aux vars: update C++ comment to reflect last changes 2011-10-21 16:56:13 +02:00
Michel Juillard 117996c881 code simplification after commit 9425b36358 2011-10-20 20:40:15 +02:00
Michel Juillard 9425b36358 fixing problems related to auxiliary variables 2011-10-19 12:47:15 +02:00
Ferhat Mihoubi 99c0508909 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 739f86945c Cleans the messages displayed 2011-10-12 14:45:53 +02:00
Michel Juillard 762f31bafd preprocessor, auxiliary variables: fixes ordering issue introduced in
347ab4d0c0 and corrects the earlier
ordering problem.
2011-09-28 22:11:44 +02:00
Ferhat Mihoubi 3d1a0c2652 block-Kalman filter is now available when block option is used 2011-09-20 14:18:31 +02:00
Houtan Bastani 426682d632 cosmetic: simplify jacobianHelper, hessianHelper and sparseHelper functions and fix spacing in dynamic file 2011-08-19 16:59:18 +02:00
Ferhat Mihoubi dfec70bcfd correct a bug during the state variables detection 2011-08-11 14:15:51 +02:00
Houtan Bastani 46e0873eef remove writing of getPowerDeriv M function from block code functions 2011-07-25 10:21:02 +02:00
Houtan Bastani 509cc15191 bug fix: getPowerDeriv not accessible from modfile.m 2011-07-19 14:35:35 +02:00
Sébastien Villemot 69ddfadde9 Preprocessor: factorize code common between StaticModel and DynamicModel, and put it in ModelTree 2011-06-22 11:56:07 +02:00
Sébastien Villemot ae76a8f842 Preprocessor: fix crash when no computational task is required 2011-06-22 11:34:38 +02:00
Ferhat Mihoubi 311102ff6f - 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 80dbd45ac8 external_function: bug fix in writeParamsDerivativesFile, writeDynamicModel and writeStaticMFile 2011-06-10 11:09:43 +02:00
Michel Juillard ef38fb951d updating one comment 2011-05-27 22:09:54 +02:00
Michel Juillard 075837b2f8 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 9ef3a2796c Preprocessor: use NaN() for initializing vector of parameters 2011-04-27 12:07:13 +02:00
Houtan Bastani 39e396fe12 bug fix: allow use of external functions with model local variables 2011-04-12 16:42:56 +02:00
Houtan Bastani 3e92f41079 ramsey_policy: allow discount factor to be an expression 2011-03-29 18:18:32 +02:00
Houtan Bastani 330b11ba48 code cleanup 2011-03-28 11:34:42 +02:00
Houtan Bastani 161647922c Implement explicit writing of first order conditions of Ramsey problem (ticket #5) 2011-03-24 17:17:15 +01:00
Ferhat Mihoubi 31b6c08347 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 87e4125fa4 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 55bb27c5f6 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 796af7ee59 Preprocessor: added model local variable definitions to parameter derivative file 2011-03-07 11:59:12 +01:00