Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
preprocessor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Normann Rion
preprocessor
Commits
489b7780
Commit
489b7780
authored
Mar 14, 2016
by
MichelJuillard
Browse files
Options
Downloads
Patches
Plain Diff
put orig_eq_nbr and ramsey_eq_nbr in mod_file_struct
parent
4419b9e9
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
ModFile.cc
+8
-9
8 additions, 9 deletions
ModFile.cc
ModFile.hh
+0
-6
0 additions, 6 deletions
ModFile.hh
Statement.hh
+6
-1
6 additions, 1 deletion
Statement.hh
with
14 additions
and
16 deletions
ModFile.cc
+
8
−
9
View file @
489b7780
...
@@ -39,8 +39,7 @@ ModFile::ModFile(WarningConsolidation &warnings_arg)
...
@@ -39,8 +39,7 @@ ModFile::ModFile(WarningConsolidation &warnings_arg)
static_model
(
symbol_table
,
num_constants
,
external_functions_table
),
static_model
(
symbol_table
,
num_constants
,
external_functions_table
),
steady_state_model
(
symbol_table
,
num_constants
,
external_functions_table
,
static_model
),
steady_state_model
(
symbol_table
,
num_constants
,
external_functions_table
,
static_model
),
linear
(
false
),
block
(
false
),
byte_code
(
false
),
use_dll
(
false
),
no_static
(
false
),
linear
(
false
),
block
(
false
),
byte_code
(
false
),
use_dll
(
false
),
no_static
(
false
),
differentiate_forward_vars
(
false
),
differentiate_forward_vars
(
false
),
nonstationary_variables
(
false
),
nonstationary_variables
(
false
),
orig_eqn_nbr
(
0
),
ramsey_eqn_nbr
(
0
),
param_used_with_lead_lag
(
false
),
warnings
(
warnings_arg
)
param_used_with_lead_lag
(
false
),
warnings
(
warnings_arg
)
{
{
}
}
...
@@ -345,7 +344,7 @@ ModFile::transformPass(bool nostrict)
...
@@ -345,7 +344,7 @@ ModFile::transformPass(bool nostrict)
dynamic_model
.
removeTrendVariableFromEquations
();
dynamic_model
.
removeTrendVariableFromEquations
();
}
}
orig_eq
n
_nbr
=
dynamic_model
.
equation_number
();
mod_file_struct
.
orig_eq_nbr
=
dynamic_model
.
equation_number
();
if
(
mod_file_struct
.
ramsey_model_present
)
if
(
mod_file_struct
.
ramsey_model_present
)
{
{
StaticModel
*
planner_objective
=
NULL
;
StaticModel
*
planner_objective
=
NULL
;
...
@@ -364,7 +363,7 @@ ModFile::transformPass(bool nostrict)
...
@@ -364,7 +363,7 @@ ModFile::transformPass(bool nostrict)
dynamic_model
.
cloneDynamic
(
ramsey_FOC_equations_dynamic_model
);
dynamic_model
.
cloneDynamic
(
ramsey_FOC_equations_dynamic_model
);
ramsey_FOC_equations_dynamic_model
.
computeRamseyPolicyFOCs
(
*
planner_objective
);
ramsey_FOC_equations_dynamic_model
.
computeRamseyPolicyFOCs
(
*
planner_objective
);
ramsey_FOC_equations_dynamic_model
.
replaceMyEquations
(
dynamic_model
);
ramsey_FOC_equations_dynamic_model
.
replaceMyEquations
(
dynamic_model
);
ramsey_eq
n
_nbr
=
dynamic_model
.
equation_number
()
-
orig_eq
n
_nbr
;
mod_file_struct
.
ramsey_eq_nbr
=
dynamic_model
.
equation_number
()
-
mod_file_struct
.
orig_eq_nbr
;
}
}
if
(
mod_file_struct
.
stoch_simul_present
if
(
mod_file_struct
.
stoch_simul_present
...
@@ -446,7 +445,7 @@ ModFile::transformPass(bool nostrict)
...
@@ -446,7 +445,7 @@ ModFile::transformPass(bool nostrict)
cout
<<
"Found "
<<
dynamic_model
.
equation_number
()
<<
" equation(s)."
<<
endl
;
cout
<<
"Found "
<<
dynamic_model
.
equation_number
()
<<
" equation(s)."
<<
endl
;
else
else
{
{
cout
<<
"Found "
<<
orig_eq
n
_nbr
<<
" equation(s)."
<<
endl
;
cout
<<
"Found "
<<
mod_file_struct
.
orig_eq_nbr
<<
" equation(s)."
<<
endl
;
cout
<<
"Found "
<<
dynamic_model
.
equation_number
()
<<
" FOC equation(s) for Ramsey Problem."
<<
endl
;
cout
<<
"Found "
<<
dynamic_model
.
equation_number
()
<<
" FOC equation(s) for Ramsey Problem."
<<
endl
;
}
}
...
@@ -748,9 +747,9 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
...
@@ -748,9 +747,9 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
if
(
block
&&
!
byte_code
)
if
(
block
&&
!
byte_code
)
mOutputFile
<<
"addpath "
<<
basename
<<
";"
<<
endl
;
mOutputFile
<<
"addpath "
<<
basename
<<
";"
<<
endl
;
mOutputFile
<<
"M_.orig_eq_nbr = "
<<
orig_eq
n
_nbr
<<
";"
<<
endl
mOutputFile
<<
"M_.orig_eq_nbr = "
<<
mod_file_struct
.
orig_eq_nbr
<<
";"
<<
endl
<<
"M_.eq_nbr = "
<<
dynamic_model
.
equation_number
()
<<
";"
<<
endl
<<
"M_.eq_nbr = "
<<
dynamic_model
.
equation_number
()
<<
";"
<<
endl
<<
"M_.ramsey_eq_nbr = "
<<
ramsey_eq
n
_nbr
<<
";"
<<
endl
;
<<
"M_.ramsey_eq_nbr = "
<<
mod_file_struct
.
ramsey_eq_nbr
<<
";"
<<
endl
;
if
(
dynamic_model
.
equation_number
()
>
0
)
if
(
dynamic_model
.
equation_number
()
>
0
)
{
{
...
@@ -1133,9 +1132,9 @@ ModFile::writeExternalFilesJulia(const string &basename, FileOutputType output)
...
@@ -1133,9 +1132,9 @@ ModFile::writeExternalFilesJulia(const string &basename, FileOutputType output)
<<
symbol_table
.
exo_nbr
()
<<
")"
<<
endl
<<
symbol_table
.
exo_nbr
()
<<
")"
<<
endl
<<
"model.correlation_matrix = ones(Float64, "
<<
symbol_table
.
exo_nbr
()
<<
", "
<<
"model.correlation_matrix = ones(Float64, "
<<
symbol_table
.
exo_nbr
()
<<
", "
<<
symbol_table
.
exo_nbr
()
<<
")"
<<
endl
<<
symbol_table
.
exo_nbr
()
<<
")"
<<
endl
<<
"model.orig_eq_nbr = "
<<
orig_eq
n
_nbr
<<
endl
<<
"model.orig_eq_nbr = "
<<
mod_file_struct
.
orig_eq_nbr
<<
endl
<<
"model.eq_nbr = "
<<
dynamic_model
.
equation_number
()
<<
endl
<<
"model.eq_nbr = "
<<
dynamic_model
.
equation_number
()
<<
endl
<<
"model.ramsey_eq_nbr = "
<<
ramsey_eq
n
_nbr
<<
endl
;
<<
"model.ramsey_eq_nbr = "
<<
mod_file_struct
.
ramsey_eq_nbr
<<
endl
;
if
(
mod_file_struct
.
calibrated_measurement_errors
)
if
(
mod_file_struct
.
calibrated_measurement_errors
)
jlOutputFile
<<
"model.h = zeros(Float64,"
jlOutputFile
<<
"model.h = zeros(Float64,"
...
...
This diff is collapsed.
Click to expand it.
ModFile.hh
+
0
−
6
View file @
489b7780
...
@@ -101,12 +101,6 @@ public:
...
@@ -101,12 +101,6 @@ public:
/*! Filled using initval blocks and parameters initializations */
/*! Filled using initval blocks and parameters initializations */
eval_context_t
global_eval_context
;
eval_context_t
global_eval_context
;
//! Stores the original number of equations in the model_block
int
orig_eqn_nbr
;
//! Stores the number of equations added to the Ramsey model
int
ramsey_eqn_nbr
;
//! Parameter used with lead/lag
//! Parameter used with lead/lag
bool
param_used_with_lead_lag
;
bool
param_used_with_lead_lag
;
...
...
This diff is collapsed.
Click to expand it.
Statement.hh
+
6
−
1
View file @
489b7780
...
@@ -91,7 +91,7 @@ public:
...
@@ -91,7 +91,7 @@ public:
bool
bayesian_irf_present
;
bool
bayesian_irf_present
;
//! Whether there is a data statement present
//! Whether there is a data statement present
bool
estimation_data_statement_present
;
bool
estimation_data_statement_present
;
//! Last chain number for Markov Switching statement
//! Last chain number for Markov Switching statement
2
int
last_markov_switching_chain
;
int
last_markov_switching_chain
;
//! Whether a calib_smoother statement is present
//! Whether a calib_smoother statement is present
bool
calib_smoother_present
;
bool
calib_smoother_present
;
...
@@ -118,6 +118,11 @@ public:
...
@@ -118,6 +118,11 @@ public:
bool
ms_dsge_present
;
bool
ms_dsge_present
;
//! Whether occbin is present
//! Whether occbin is present
bool
occbin_option
;
bool
occbin_option
;
//! Stores the original number of equations in the model_block
int
orig_eq_nbr
;
//! Stores the number of equations added to the Ramsey model
int
ramsey_eq_nbr
;
};
};
class
Statement
class
Statement
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment