Sébastien Villemot
bd2405e292
Fix crash when the model contains 1st or 2nd ext fcn deriv nodes.
...
In the case where the external function computes itself its derivatives, the
TEF terms were not always created before being used, hence leading to a
preprocessor crash. This problem could only happen with ramsey_policy, because
otherwise the model does not contain derivatives of external functions.
2014-03-13 12:27:13 +01:00
Sébastien Villemot
8882f809c3
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
Sébastien Villemot
ca7fe60252
Cosmetic renaming for consistency between DataTree method names.
2014-03-11 18:56:48 +01:00
Sébastien Villemot
140db861d5
Implement cloneDynamic() for {First,Second}DerivExternalFunction.
...
Since the method was not implement, the method of the parent class was used.
This was leading to wrong results in the context of Ramsey Policy (basically
derivative operators on external functions were dropped from FOCs).
2014-03-11 18:56:48 +01:00
Sébastien Villemot
0612bca00f
Remove spurious test.
2014-03-11 18:56:48 +01:00
Sébastien Villemot
380df90748
Fix output of external functions (and their derivatives) in LaTeX.
2014-03-11 15:31:08 +01:00
Sébastien Villemot
b1d7f8f223
Fix bug in external functions introduced in 711a4f62.
2014-02-25 16:45:55 +01:00
Sébastien Villemot
dab2dde8af
Small improvements to external functions code.
2014-02-24 17:27:34 +01:00
Michel Juillard
6e0ef026ac
write C++ version of model functions without temporary terms
2014-02-24 13:33:48 +01:00
Sébastien Villemot
1414f98cff
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
Sébastien Villemot
74ad93e0f4
Remove select1st (GNU extension), replace it by a call to boost::bind
2013-11-05 18:13:29 +01: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
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
6486e529d5
Improve error message for 3rd derivatives of external functions
2013-01-15 11:39:04 +01:00
Michel Juillard
34099da167
fixed bug in computation of derivative of erf() function
2012-12-07 21:46:50 +01:00
Sébastien Villemot
67a1737f00
Update copyright notices
2012-06-08 18:22:34 +02:00
Michel Juillard
78bd465294
finishing implementation of optional transformation of log and non
...
integer power arguments to insure that they are positive
2012-05-26 20:53:48 +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
Sébastien Villemot
fa1572e674
Fix bug where the nth derivative of 0^n evaluated to 0 instead of n!
...
(complement to commit cd0bc28e)
2012-05-21 18:34:10 +02:00
Houtan Bastani
1d68887387
preprocessor: add subsamples statement
2011-12-21 12:21:30 +01:00
Houtan Bastani
b75d0e733f
Remove unused expectation syntax
2011-10-26 14:30:47 +02:00
Michel Juillard
3b955481cb
factoring out steady-state computations; steady_state_model now
...
generates <fname>_steadystate2.m returning parameters as well in case
they have been modified by the user. Added several test cases.
2011-10-12 21:51:14 +02:00
Ferhat Mihoubi
780e7515d6
updates normalizeEquation() to deal with abs, sign (Ticket #200 ) and trigonometric functions.
2011-10-12 15:03:05 +02:00
Houtan Bastani
043de353fc
bugfix: sign operator for compiled static file
2011-08-30 16:12:00 +02:00
Houtan Bastani
5c48733f55
output mex file for static model ( closes #183 )
2011-08-19 16:57:27 +02:00
Houtan Bastani
973105ace3
preprocessor: add absolute value and signum
2011-08-16 14:52:35 +02:00
Houtan Bastani
d8c0162e26
bug fix: add parenthesis around STEADY_STATE output in case it contains an expression
2011-08-08 18:49:18 +02:00
Ferhat Mihoubi
af1e4837b8
- correction of the bug in normalization process for expressions of the form a^x (Ticket #186 )
...
- If a case is not handled, the equation is supposed to be impossible to normalize.
- comments added to describe the normalization process
2011-06-10 12:41:21 +02:00
Houtan Bastani
e95699ffeb
cosmetic change
2011-05-11 11:58:33 +02:00
Houtan Bastani
95a6ae6abb
fixed typo
2011-04-12 16:42:55 +02:00
Houtan Bastani
e5798c5946
bug fix: writeOutput calls from within writeOutput were losing tef_terms info
2011-04-12 16:42:55 +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
Houtan Bastani
891dd5e2f2
bug fix: in cloning binary op node, were losing the order of the power deriv
2011-03-23 11:36:46 +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
9e898f4eb6
Preprocessor: avoid name clashes with model local variables
2011-02-21 18:26:23 +01:00
Sébastien Villemot
d264b7b2e3
Reindentation of the preprocessor
2011-02-04 16:25:38 +01:00
Sébastien Villemot
9b3d611a0b
Preprocessor: in steady_state_model block, allow MATLAB functions which return several arguments ( closes #37 )
2011-01-26 13:55:01 -05: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
Sébastien Villemot
4143276fe4
Preprocessor: no longer use assert(false) as a way of marking impossible cases
2011-01-13 15:52:44 +01:00
Ferhat Mihoubi
c6febbccb1
Stores the first order derivatives in the TEFD matrix, when derivatives are computed with a different external function (useful only for printing the model equations)
2010-12-31 16:26:25 +01:00
Ferhat Mihoubi
d586280b1b
- The binary operator oDerivPower is implemented in bytecode
2010-12-17 18:54:03 +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
Houtan Bastani
d206217fef
fixed bug that would force node sharing when two or more expectation operators had the same expression but different information sets
2010-12-08 12:29:47 +01:00