Verified Commit 8fbb7730 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

dynare manual: cleanup whitespace

- remove trailing whitespace
- replace tabs with spaces as per PEP guidelines
parent ca99db58
...@@ -68,6 +68,3 @@ Bibliography ...@@ -68,6 +68,3 @@ Bibliography
* Stock, James H. and Mark W. Watson (1999). “Forecasting Inflation,”, *Journal of Monetary Economics*, 44(2), 293–335. * Stock, James H. and Mark W. Watson (1999). “Forecasting Inflation,”, *Journal of Monetary Economics*, 44(2), 293–335.
* Uhlig, Harald (2001): “A Toolkit for Analysing Nonlinear Dynamic Stochastic Models Easily,” in *Computational Methods for the Study of Dynamic Economies*, Eds. Ramon Marimon and Andrew Scott, Oxford University Press, 30–61. * Uhlig, Harald (2001): “A Toolkit for Analysing Nonlinear Dynamic Stochastic Models Easily,” in *Computational Methods for the Study of Dynamic Economies*, Eds. Ramon Marimon and Andrew Scott, Oxford University Press, 30–61.
* Villemot, Sébastien (2011): “Solving rational expectations models at first order: what Dynare does,” *Dynare Working Papers*, 2, CEPREMAP. * Villemot, Sébastien (2011): “Solving rational expectations models at first order: what Dynare does,” *Dynare Working Papers*, 2, CEPREMAP.
...@@ -23,7 +23,7 @@ import sys ...@@ -23,7 +23,7 @@ import sys
sys.path.insert(0, os.path.abspath('../utils')) sys.path.insert(0, os.path.abspath('../utils'))
extensions = ['sphinx.ext.autodoc', extensions = ['sphinx.ext.autodoc',
'sphinx.ext.mathjax'] 'sphinx.ext.mathjax']
source_suffix = '.rst' source_suffix = '.rst'
......
...@@ -34,7 +34,7 @@ A copy of the license can be found at `http://www.gnu.org/licenses/fdl.txt <http ...@@ -34,7 +34,7 @@ A copy of the license can be found at `http://www.gnu.org/licenses/fdl.txt <http
.. toctree:: .. toctree::
:numbered: :numbered:
:maxdepth: 4 :maxdepth: 4
introduction introduction
installation-and-configuration installation-and-configuration
running-dynare running-dynare
...@@ -51,4 +51,4 @@ A copy of the license can be found at `http://www.gnu.org/licenses/fdl.txt <http ...@@ -51,4 +51,4 @@ A copy of the license can be found at `http://www.gnu.org/licenses/fdl.txt <http
Indices and tables Indices and tables
================== ==================
* :ref:`genindex` * :ref:`genindex`
...@@ -104,10 +104,10 @@ For convenience, you can copy and paste the following into your BibTeX file: ...@@ -104,10 +104,10 @@ For convenience, you can copy and paste the following into your BibTeX file:
.. code-block:: bibtex .. code-block:: bibtex
@TechReport{Adjemianetal2011, @TechReport{Adjemianetal2011,
author = {Adjemian, St\'ephane and Bastani, Houtan and author = {Adjemian, St\'ephane and Bastani, Houtan and
Juillard, Michel and Karam\'e, Fr\'ederic and Juillard, Michel and Karam\'e, Fr\'ederic and
Maih, Junior and Mihoubi, Ferhat and Maih, Junior and Mihoubi, Ferhat and
Perendia, George and Pfeifer, Johannes and Perendia, George and Pfeifer, Johannes and
Ratto, Marco and Villemot, S\'ebastien}, Ratto, Marco and Villemot, S\'ebastien},
title = {Dynare: Reference Manual Version 4}, title = {Dynare: Reference Manual Version 4},
year = {2011}, year = {2011},
......
...@@ -3740,7 +3740,7 @@ lag. We therefore have the following identity: ...@@ -3740,7 +3740,7 @@ lag. We therefore have the following identity:
Vector of numerical indices identifying the state variables in the Vector of numerical indices identifying the state variables in the
vector of declared variables. ``M_.endo_names(M_.state_var)`` vector of declared variables. ``M_.endo_names(M_.state_var)``
therefore yields the name of all variables that are states in therefore yields the name of all variables that are states in
the model declaration, i.e. that show up with a lag. the model declaration, i.e. that show up with a lag.
Internally, Dynare uses two orderings of the endogenous variables: the Internally, Dynare uses two orderings of the endogenous variables: the
...@@ -3758,10 +3758,10 @@ according to the declaration order. ...@@ -3758,10 +3758,10 @@ according to the declaration order.
.. matvar:: oo_.dr.order_var .. matvar:: oo_.dr.order_var
This variables maps DR-order to declaration order. This variables maps DR-order to declaration order.
.. matvar:: oo_.dr.inv_order_var .. matvar:: oo_.dr.inv_order_var
This variable contains the inverse map. This variable contains the inverse map.
In other words, the k-th variable in the DR-order corresponds to the endogenous In other words, the k-th variable in the DR-order corresponds to the endogenous
variable numbered ``oo_.dr.order_var(k)`` in declaration variable numbered ``oo_.dr.order_var(k)`` in declaration
...@@ -3791,7 +3791,7 @@ where :math:`y^s` is the steady state value of :math:`y` and ...@@ -3791,7 +3791,7 @@ where :math:`y^s` is the steady state value of :math:`y` and
.. matvar:: oo.dr.state_var .. matvar:: oo.dr.state_var
Vector of numerical indices identifying the state variables in the Vector of numerical indices identifying the state variables in the
vector of declared variables, *given the current parameter values* vector of declared variables, *given the current parameter values*
for which the decision rules have been computed. It may differ from for which the decision rules have been computed. It may differ from
``M_.state_var`` in case a state variable drops from the model given ``M_.state_var`` in case a state variable drops from the model given
the current parameterization, because it only gets 0 coefficients in the current parameterization, because it only gets 0 coefficients in
...@@ -7371,14 +7371,14 @@ Shock Decomposition ...@@ -7371,14 +7371,14 @@ Shock Decomposition
.. option:: diff .. option:: diff
If passed, plot the decomposition of the first difference of the list of variables. If passed, plot the decomposition of the first difference of the list of variables.
If used in combination with :opt:`flip`, the ``diff`` operator is first applied. If used in combination with :opt:`flip`, the ``diff`` operator is first applied.
Default: not activated Default: not activated
.. option:: flip .. option:: flip
If passed, plot the decomposition of the opposite of the list of variables. If passed, plot the decomposition of the opposite of the list of variables.
If used in combination with :opt:`diff`, the ``diff`` operator is first applied. If used in combination with :opt:`diff`, the ``diff`` operator is first applied.
Default: not activated Default: not activated
.. option:: max_nrows .. option:: max_nrows
...@@ -7467,14 +7467,14 @@ Shock Decomposition ...@@ -7467,14 +7467,14 @@ Shock Decomposition
.. option:: diff .. option:: diff
If passed, plot the decomposition of the first difference of the list of variables. If passed, plot the decomposition of the first difference of the list of variables.
If used in combination with :opt:`flip`, the ``diff`` operator is first applied. If used in combination with :opt:`flip`, the ``diff`` operator is first applied.
Default: not activated Default: not activated
.. option:: flip .. option:: flip
If passed, plot the decomposition of the opposite of the list of variables. If passed, plot the decomposition of the opposite of the list of variables.
If used in combination with :opt:`diff`, the ``diff`` operator is first applied. If used in combination with :opt:`diff`, the ``diff`` operator is first applied.
Default: not activated Default: not activated
.. command:: squeeze_shock_decomposition [VARIABLE_NAME]...; .. command:: squeeze_shock_decomposition [VARIABLE_NAME]...;
...@@ -9057,7 +9057,7 @@ Performing identification analysis ...@@ -9057,7 +9057,7 @@ Performing identification analysis
triggers gsa prior sample. If equal to ``2``, triggers gsa triggers gsa prior sample. If equal to ``2``, triggers gsa
Monte-Carlo sample (i.e. loads a sample corresponding to Monte-Carlo sample (i.e. loads a sample corresponding to
``pprior=0`` and ``ppost=0`` in the ``dynare_sensitivity`` ``pprior=0`` and ``ppost=0`` in the ``dynare_sensitivity``
options). If equal to ``FILENAME`` uses the provided path to options). If equal to ``FILENAME`` uses the provided path to
a specific user defined sample file. a specific user defined sample file.
Default: ``0``. Default: ``0``.
...@@ -9213,8 +9213,8 @@ Performing identification analysis ...@@ -9213,8 +9213,8 @@ Performing identification analysis
If equal to ``1``: finds problematic parameters in a bruteforce If equal to ``1``: finds problematic parameters in a bruteforce
fashion: It computes the rank of the Jacobians for all possible fashion: It computes the rank of the Jacobians for all possible
parameter combinations. If the rank condition is not fullfilled, parameter combinations. If the rank condition is not fullfilled,
these parameter sets are flagged as non-identifiable. these parameter sets are flagged as non-identifiable.
The maximum dimension of the group searched is triggered by The maximum dimension of the group searched is triggered by
``max_dim_subsets_groups``. ``max_dim_subsets_groups``.
Default: ``0``. Default: ``0``.
...@@ -10477,7 +10477,7 @@ Dynare has comments to plot the results of a simulation and to save the results. ...@@ -10477,7 +10477,7 @@ Dynare has comments to plot the results of a simulation and to save the results.
In MATLAB or Octave, variables saved with the ``dynasave`` command In MATLAB or Octave, variables saved with the ``dynasave`` command
can be retrieved by the command:: can be retrieved by the command::
load(FILENAME,'-mat') load(FILENAME,'-mat')
.. _macro-proc-lang: .. _macro-proc-lang:
......
...@@ -45,7 +45,7 @@ from sphinx.util.docfields import Field, GroupedField, TypedField ...@@ -45,7 +45,7 @@ from sphinx.util.docfields import Field, GroupedField, TypedField
class DynObject(ObjectDescription): class DynObject(ObjectDescription):
has_arguments = True has_arguments = True
display_prefix = None display_prefix = None
allow_nesting = False allow_nesting = False
def handle_signature(self, sig, signode): def handle_signature(self, sig, signode):
sig = sig.strip() sig = sig.strip()
...@@ -76,9 +76,9 @@ class DynObject(ObjectDescription): ...@@ -76,9 +76,9 @@ class DynObject(ObjectDescription):
if self.display_prefix: if self.display_prefix:
signode += addnodes.desc_annotation(self.display_prefix, self.display_prefix) signode += addnodes.desc_annotation(self.display_prefix, self.display_prefix)
signode += addnodes.desc_name(name, name) signode += addnodes.desc_name(name, name)
if self.has_arguments: if self.has_arguments:
if not arglist: if not arglist:
signode += addnodes.desc_parameterlist() signode += addnodes.desc_parameterlist()
...@@ -94,7 +94,7 @@ class DynObject(ObjectDescription): ...@@ -94,7 +94,7 @@ class DynObject(ObjectDescription):
signode['first'] = not self.names signode['first'] = not self.names
self.state.document.note_explicit_target(signode) self.state.document.note_explicit_target(signode)
objects = self.env.domaindata['dynare']['objects'] objects = self.env.domaindata['dynare']['objects']
if fullname in objects: if fullname in objects:
self.state_machine.reporter.warning( self.state_machine.reporter.warning(
'duplicate object description of %s, ' % fullname + 'duplicate object description of %s, ' % fullname +
...@@ -222,9 +222,9 @@ class DynSimpleObject(ObjectDescription): ...@@ -222,9 +222,9 @@ class DynSimpleObject(ObjectDescription):
if self.display_prefix: if self.display_prefix:
signode += addnodes.desc_annotation(self.display_prefix, self.display_prefix) signode += addnodes.desc_annotation(self.display_prefix, self.display_prefix)
signode += addnodes.desc_name(name, name) signode += addnodes.desc_name(name, name)
return fullname, prefix return fullname, prefix
def add_target_and_index(self, name_obj, sig, signode): def add_target_and_index(self, name_obj, sig, signode):
fullname = name_obj[0] fullname = name_obj[0]
...@@ -291,40 +291,40 @@ class DynareDomain(Domain): ...@@ -291,40 +291,40 @@ class DynareDomain(Domain):
name = 'dynare' name = 'dynare'
label = 'Dynare' label = 'Dynare'
object_types = { object_types = {
'function': ObjType(l_('function'), 'func'), 'function': ObjType(l_('function'), 'func'),
'datesmethod': ObjType(l_('method'), 'datmeth'), 'datesmethod': ObjType(l_('method'), 'datmeth'),
'dseriesmethod': ObjType(l_('method'), 'dsermeth'), 'dseriesmethod': ObjType(l_('method'), 'dsermeth'),
'reportingmethod': ObjType(l_('method'), 'repmeth'), 'reportingmethod': ObjType(l_('method'), 'repmeth'),
'matcomm': ObjType(l_('matlab command'), 'mcomm'), 'matcomm': ObjType(l_('matlab command'), 'mcomm'),
'command': ObjType(l_('command'), 'comm'), 'command': ObjType(l_('command'), 'comm'),
'class': ObjType(l_('class'), 'class'), 'class': ObjType(l_('class'), 'class'),
'block': ObjType(l_('block'), 'bck'), 'block': ObjType(l_('block'), 'bck'),
'confblock': ObjType(l_('config block'), 'cbck'), 'confblock': ObjType(l_('config block'), 'cbck'),
'macrodir': ObjType(l_('macro directive'), 'mdir'), 'macrodir': ObjType(l_('macro directive'), 'mdir'),
'construct': ObjType(l_('constructor'), 'cstr'), 'construct': ObjType(l_('constructor'), 'cstr'),
'matvar': ObjType(l_('matlab variable'), 'mvar'), 'matvar': ObjType(l_('matlab variable'), 'mvar'),
'specvar': ObjType(l_('special variable'), 'svar'), 'specvar': ObjType(l_('special variable'), 'svar'),
'operator': ObjType(l_('operator'), 'op'), 'operator': ObjType(l_('operator'), 'op'),
'constant': ObjType(l_('constant'), 'const'), 'constant': ObjType(l_('constant'), 'const'),
'option': ObjType(l_('option'), 'opt'), 'option': ObjType(l_('option'), 'opt'),
} }
directives = { directives = {
'function': DynFunction, 'function': DynFunction,
'datesmethod': DatesMethod, 'datesmethod': DatesMethod,
'dseriesmethod': DseriesMethod, 'dseriesmethod': DseriesMethod,
'reportingmethod': ReportingMethod, 'reportingmethod': ReportingMethod,
'matcomm': MatComm, 'matcomm': MatComm,
'command': DynComm, 'command': DynComm,
'class': DynClass, 'class': DynClass,
'block': DynBlock, 'block': DynBlock,
'confblock': DynConfBlock, 'confblock': DynConfBlock,
'macrodir': DynMacroDir, 'macrodir': DynMacroDir,
'construct': Constructor, 'construct': Constructor,
'matvar': MatlabVar, 'matvar': MatlabVar,
'specvar': SpecialVar, 'specvar': SpecialVar,
'operator': Operator, 'operator': Operator,
'constant': Constant, 'constant': Constant,
'option': Option, 'option': Option,
} }
roles = { roles = {
'func': DynareXRefRole(), 'func': DynareXRefRole(),
...@@ -334,19 +334,19 @@ class DynareDomain(Domain): ...@@ -334,19 +334,19 @@ class DynareDomain(Domain):
'mcomm': DynareXRefRole(), 'mcomm': DynareXRefRole(),
'comm': DynareXRefRole(), 'comm': DynareXRefRole(),
'class': DynareXRefRole(), 'class': DynareXRefRole(),
'bck': DynareXRefRole(), 'bck': DynareXRefRole(),
'cbck': DynareXRefRole(), 'cbck': DynareXRefRole(),
'mdir': DynareXRefRole(), 'mdir': DynareXRefRole(),
'cstr': DynareXRefRole(), 'cstr': DynareXRefRole(),
'mvar': DynareXRefRole(), 'mvar': DynareXRefRole(),
'svar': DynareXRefRole(), 'svar': DynareXRefRole(),
'op': DynareXRefRole(), 'op': DynareXRefRole(),
'const': DynareXRefRole(), 'const': DynareXRefRole(),
'opt': DynareXRefRole(), 'opt': DynareXRefRole(),
} }
initial_data = { initial_data = {
'objects': {}, 'objects': {},
} }
def clear_doc(self, docname): def clear_doc(self, docname):
for fullname, (fn, _l) in list(self.data['objects'].items()): for fullname, (fn, _l) in list(self.data['objects'].items()):
......
...@@ -33,40 +33,40 @@ class DynareLexer(RegexLexer): ...@@ -33,40 +33,40 @@ class DynareLexer(RegexLexer):
filenames = ['*.mod'] filenames = ['*.mod']
commands = ( commands = (
"dynare","var","varexo","varexo_det","parameters","change_type","model_local_variable", "dynare","var","varexo","varexo_det","parameters","change_type","model_local_variable",
"predetermined_variables","trend_var","log_trend_var","external_function", "predetermined_variables","trend_var","log_trend_var","external_function",
"write_latex_original_model","write_latex_dynamic_model", "write_latex_original_model","write_latex_dynamic_model",
"write_latex_static_model","resid","initval_file","histval_file","dsample", "write_latex_static_model","resid","initval_file","histval_file","dsample",
"periods","values","corr","steady","check","model_diagnostics","model_info", "periods","values","corr","steady","check","model_diagnostics","model_info",
"print_bytecode_dynamic_model"," print_bytecode_static_model", "print_bytecode_dynamic_model"," print_bytecode_static_model",
"perfect_foresight_setup","perfect_foresight_solver","simul","stoch_simul", "perfect_foresight_setup","perfect_foresight_solver","simul","stoch_simul",
"extended_path","varobs","estimation","unit_root_vars","bvar_density", "extended_path","varobs","estimation","unit_root_vars","bvar_density",
"model_comparison","shock_decomposition","realtime_shock_decomposition", "model_comparison","shock_decomposition","realtime_shock_decomposition",
"plot_shock_decomposition","calib_smoother","forecast", "plot_shock_decomposition","calib_smoother","forecast",
"conditional_forecast","plot_conditional_forecast","bvar_forecast", "conditional_forecast","plot_conditional_forecast","bvar_forecast",
"smoother2histval","osr","osr_params","ramsey_model","ramsey_policy", "smoother2histval","osr","osr_params","ramsey_model","ramsey_policy",
"discretionary_policy","planner_objective","dynare_sensitivity", "discretionary_policy","planner_objective","dynare_sensitivity",
"markov_switching","svar","sbvar","ms_estimation","ms_simulation", "markov_switching","svar","sbvar","ms_estimation","ms_simulation",
"ms_compute_mdd","ms_compute_probabilities","ms_irf","ms_forecast", "ms_compute_mdd","ms_compute_probabilities","ms_irf","ms_forecast",
"ms_variance_decomposition","rplot","dynatype","dynasave","set_dynare_seed", "ms_variance_decomposition","rplot","dynatype","dynasave","set_dynare_seed",
"save_params_and_steady_state","load_params_and_steady_state", "save_params_and_steady_state","load_params_and_steady_state",
"dynare_version","write_latex_definitions","write_latex_parameter_table", "dynare_version","write_latex_definitions","write_latex_parameter_table",
"write_latex_prior_table","collect_latex_files","prior_function", "write_latex_prior_table","collect_latex_files","prior_function",
"posterior_function","generate_trace_plots") "posterior_function","generate_trace_plots")
report_commands = ("report","addPage","addSection","addGraph","addTable", report_commands = ("report","addPage","addSection","addGraph","addTable",
"addSeries","addParagraph","addVspace","write","compile") "addSeries","addParagraph","addVspace","write","compile")
operators = ( operators = (
"STEADY_STATE","EXPECTATION") "STEADY_STATE","EXPECTATION")
macro_dirs = ( macro_dirs = (
"@#includepath", "@#include", "@#define", "@#if", "@#includepath", "@#include", "@#define", "@#if",
"@#ifdef", "@#ifndef", "@#else","@#endif", "@#ifdef", "@#ifndef", "@#else","@#endif",
"@#for", "@#endfor", "@#echo", "@#error") "@#for", "@#endfor", "@#echo", "@#error")
builtin_constants = ( builtin_constants = (
"inf", "nan") "inf", "nan")
tokens = { tokens = {
'root': [ 'root': [
...@@ -74,12 +74,12 @@ class DynareLexer(RegexLexer): ...@@ -74,12 +74,12 @@ class DynareLexer(RegexLexer):
(words(( (words((
'model','steady_state_model','initval','endval','histval', 'model','steady_state_model','initval','endval','histval',
'shocks','mshocks','homotopy_setup','observation_trends', 'shocks','mshocks','homotopy_setup','observation_trends',
'estimated_params','estimated_params_init','estimated_params_bounds', 'estimated_params','estimated_params_init','estimated_params_bounds',
'shock_groups','conditional_forecast_paths','optim_weights', 'shock_groups','conditional_forecast_paths','optim_weights',
'osr_params_bounds','ramsey_constraints','irf_calibration', 'osr_params_bounds','ramsey_constraints','irf_calibration',
'moment_calibration','identification','svar_identification', 'moment_calibration','identification','svar_identification',
'verbatim','end','node','cluster','paths','hooks'), prefix=r'\b', suffix=r'\s*\b'),Keyword.Reserved), 'verbatim','end','node','cluster','paths','hooks'), prefix=r'\b', suffix=r'\s*\b'),Keyword.Reserved),
(words(commands + report_commands, (words(commands + report_commands,
prefix=r'\b', suffix=r'\s*\b'), Name.Entity), prefix=r'\b', suffix=r'\s*\b'), Name.Entity),
...@@ -92,20 +92,19 @@ class DynareLexer(RegexLexer): ...@@ -92,20 +92,19 @@ class DynareLexer(RegexLexer):
(r'\s*[a-zA-Z_]\s*', Name), (r'\s*[a-zA-Z_]\s*', Name),
(r'\s*(\d+\.\d+|\d*\.\d+)([eEf][+-]?[0-9]+)?\s*', Number.Float), (r'\s*(\d+\.\d+|\d*\.\d+)([eEf][+-]?[0-9]+)?\s*', Number.Float),
(r'\s*\d+[eEf][+-]?[0-9]+\s*', Number.Float), (r'\s*\d+[eEf][+-]?[0-9]+\s*', Number.Float),
(r'\s*\d+\s*', Number.Integer), (r'\s*\d+\s*', Number.Integer),
(r'"[^"]*"', String), (r'"[^"]*"', String),
(r"`[^`]*'", String), (r"`[^`]*'", String),
(r"'[^']*'", String), (r"'[^']*'", String),
(r'\s*(-|\+|\*|\/|\^)\s*', Operator), (r'\s*(-|\+|\*|\/|\^)\s*', Operator),
(r'\s*(==|<=|>=|~=|<|>|&&|!)\s*', Operator), (r'\s*(==|<=|>=|~=|<|>|&&|!)\s*', Operator),
(r'\s*[\[\](){}:@.,\|]\s*', Punctuation), (r'\s*[\[\](){}:@.,\|]\s*', Punctuation),
(r'\s*(=|:|;|>>|#|\$)\s*', Punctuation), (r'\s*(=|:|;|>>|#|\$)\s*', Punctuation),
] ]
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment