/usr/share/doc/dynare/dynare.html/Variable-declarations.html is in dynare-doc 4.5.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1996-2017, Dynare Team.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license can be found at http://www.gnu.org/licenses/fdl.txt. -->
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Variable declarations (Dynare Reference Manual)</title>
<meta name="description" content="Variable declarations (Dynare Reference Manual)">
<meta name="keywords" content="Variable declarations (Dynare Reference Manual)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2any">
<link href="index.html#Top" rel="start" title="Top">
<link href="Command-and-Function-Index.html#Command-and-Function-Index" rel="index" title="Command and Function Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="The-Model-file.html#The-Model-file" rel="up" title="The Model file">
<link href="Expressions.html#Expressions" rel="next" title="Expressions">
<link href="Conventions.html#Conventions" rel="prev" title="Conventions">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<a name="Variable-declarations"></a>
<div class="header">
<p>
Next: <a href="Expressions.html#Expressions" accesskey="n" rel="next">Expressions</a>, Previous: <a href="Conventions.html#Conventions" accesskey="p" rel="prev">Conventions</a>, Up: <a href="The-Model-file.html#The-Model-file" accesskey="u" rel="up">The Model file</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Function-Index.html#Command-and-Function-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Variable-declarations-1"></a>
<h3 class="section">4.2 Variable declarations</h3>
<p>While Dynare allows the user to choose their own variable names, there are some restrictions
to be kept in mind. First, variables and parameters must not have the same name as Dynare commands or
built-in functions. In this respect, Dynare is not case-sensitive. For example, do not use <var>Ln</var>
or <var>Sigma_e</var> to name your variable. Not conforming to this rule might yield hard-to-debug
error messages or crashes. Second, to minimize interference with MATLAB or Octave functions that
may be called by Dynare or user-defined steady state files, it is recommended to avoid using the name
of MATLAB functions. In particular when working with steady state files, do not use correctly-spelled greek
names like <var>alpha</var>, because there are Matlab functions of the same name. Rather go for <var>alppha</var> or <var>alph</var>.
Lastly, please do not name a variable or parameter <var>i</var>. This may interfere with the imaginary
number <var>i</var> and the index in many loops. Rather, name investment <var>invest</var>. Using <var>inv</var> is also not recommended
as it alread denotes the inverse operator.
</p>
<p>Declarations of variables and parameters are made with the following commands:
</p>
<dl>
<dt><a name="index-var"></a>Command: <strong>var</strong> <em><var>VARIABLE_NAME</var> [$<var>LATEX_NAME</var>$] [(long_name=<var>QUOTED_STRING</var>|NAME=<var>QUOTED_STRING</var>…)]…;</em></dt>
<dt><a name="index-var-1"></a>Command: <strong>var</strong> <em>(deflator = <var>MODEL_EXPRESSION</var>) <var>VARIABLE_NAME</var> [$<var>LATEX_NAME</var>$] [(long_name=<var>QUOTED_STRING</var>|NAME=<var>QUOTED_STRING</var>…)]…;</em></dt>
<dt><a name="index-var-2"></a>Command: <strong>var</strong> <em>(log_deflator = <var>MODEL_EXPRESSION</var>) <var>VARIABLE_NAME</var> [$<var>LATEX_NAME</var>$] [(long_name=<var>QUOTED_STRING</var>|NAME=<var>QUOTED_STRING</var>…)]…;</em></dt>
<dd>
<p><em>Description</em>
</p>
<p>This required command declares the endogenous variables in the
model. See <a href="Conventions.html#Conventions">Conventions</a>, for the syntax of <var>VARIABLE_NAME</var> and
<var>MODEL_EXPRESSION</var>. Optionally it is possible to give a LaTeX
name to the variable or, if it is nonstationary, provide information
regarding its deflator.
</p>
<p><code>var</code> commands can appear several times in the file and Dynare will
concatenate them.
</p>
<p><em>Options</em>
</p>
<p>If the model is nonstationary and is to be written as such in the
<code>model</code> block, Dynare will need the trend deflator for the
appropriate endogenous variables in order to stationarize the model. The
trend deflator must be provided alongside the variables that follow this
trend.
</p>
<dl compact="compact">
<dt><code>deflator = <var>MODEL_EXPRESSION</var></code></dt>
<dd><p>The expression used to detrend an endogenous variable. All trend
variables, endogenous variables and parameters referenced in
<var>MODEL_EXPRESSION</var> must already have been declared by the
<code>trend_var</code>, <code>log_trend_var</code>, <code>var</code> and
<code>parameters</code> commands. The deflator is assumed to be
multiplicative; for an additive deflator, use <code>log_deflator</code>.
</p>
</dd>
<dt><code>log_deflator = <var>MODEL_EXPRESSION</var></code></dt>
<dd><p>Same as <code>deflator</code>, except that the deflator is assumed to be
additive instead of multiplicative (or, to put it otherwise, the
declared variable is equal to the log of a variable with a
multiplicative trend).
</p>
<a name="long_005fname"></a></dd>
<dt><code>long_name = <var>QUOTED_STRING</var></code></dt>
<dd><p>This is the long version of the variable name. Its value is stored in
<code>M_.endo_names_long</code>. In case multiple <code>long_name</code> options are
provided, the last one will be used. Default: <var>VARIABLE_NAME</var>
</p>
<a name="partitioning"></a></dd>
<dt><code>NAME = <var>QUOTED_STRING</var></code></dt>
<dd><p>This is used to create a partitioning of variables. It results in the direct
output in the <samp>.m</samp> file analogous to:
<code>M_.endo_partitions.</code><var>NAME</var><code> = </code><var>QUOTED_STRING</var><code>;</code>.
</p></dd>
</dl>
<p><em>Example</em>
</p>
<div class="example">
<pre class="example">var c gnp cva (country=`US', state=`VA')
cca (country=`US', state=`CA', long_name=`Consumption CA');
var(deflator=A) i b;
var c $C$ (long_name=`Consumption');
</pre></div>
</dd></dl>
<dl>
<dt><a name="index-varexo"></a>Command: <strong>varexo</strong> <em><var>VARIABLE_NAME</var> [$<var>LATEX_NAME</var>$] [(long_name=<var>QUOTED_STRING</var>|NAME=<var>QUOTED_STRING</var>…)]…;</em></dt>
<dd>
<p><em>Description</em>
</p>
<p>This optional command declares the exogenous variables in the model.
See <a href="Conventions.html#Conventions">Conventions</a>, for the syntax of <var>VARIABLE_NAME</var>. Optionally it
is possible to give a LaTeX name to the variable.
</p>
<p>Exogenous variables are required if the user wants to be able to apply
shocks to her model.
</p>
<p><code>varexo</code> commands can appear several times in the file and Dynare
will concatenate them.
</p>
<p><em>Options</em>
</p><dl compact="compact">
<dt><code>long_name = <var>QUOTED_STRING</var></code></dt>
<dd><p>Like <a href="#long_005fname">long_name</a> but value stored in <code>M_.exo_names_long</code>.
</p>
</dd>
<dt><code>NAME = <var>QUOTED_STRING</var></code></dt>
<dd><p>Like <a href="#partitioning">partitioning</a> but <var>QUOTED_STRING</var> stored in
<code>M_.exo_partitions.</code><var>NAME</var>.
</p></dd>
</dl>
<p><em>Example</em>
</p>
<div class="example">
<pre class="example">varexo m gov;
</pre></div>
</dd></dl>
<dl>
<dt><a name="index-varexo_005fdet"></a>Command: <strong>varexo_det</strong> <em><var>VARIABLE_NAME</var> [$<var>LATEX_NAME</var>$] [(long_name=<var>QUOTED_STRING</var>|NAME=<var>QUOTED_STRING</var>…)]…;</em></dt>
<dd>
<p><em>Description</em>
</p>
<p>This optional command declares exogenous deterministic variables in a
stochastic model. See <a href="Conventions.html#Conventions">Conventions</a>, for the syntax of
<var>VARIABLE_NAME</var>. Optionally it is possible to give a LaTeX name
to the variable.
</p>
<p>It is possible to mix deterministic and stochastic shocks to build
models where agents know from the start of the simulation about future
exogenous changes. In that case <code>stoch_simul</code> will compute the
rational expectation solution adding future information to the state
space (nothing is shown in the output of <code>stoch_simul</code>) and
<code>forecast</code> will compute a simulation conditional on initial
conditions and future information.
</p>
<p><code>varexo_det</code> commands can appear several times in the file and
Dynare will concatenate them.
</p>
<p><em>Options</em>
</p><dl compact="compact">
<dt><code>long_name = <var>QUOTED_STRING</var></code></dt>
<dd><p>Like <a href="#long_005fname">long_name</a> but value stored in <code>M_.exo_det_names_long</code>.
</p>
</dd>
<dt><code>NAME = <var>QUOTED_STRING</var></code></dt>
<dd><p>Like <a href="#partitioning">partitioning</a> but <var>QUOTED_STRING</var> stored in
<code>M_.exo_det_partitions.</code><var>NAME</var>.
</p></dd>
</dl>
<p><em>Example</em>
</p>
<div class="example">
<pre class="example">
varexo m gov;
varexo_det tau;
</pre></div>
</dd></dl>
<dl>
<dt><a name="index-parameters"></a>Command: <strong>parameters</strong> <em><var>PARAMETER_NAME</var> [$<var>LATEX_NAME</var>$] [(long_name=<var>QUOTED_STRING</var>|NAME=<var>QUOTED_STRING</var>…)]…;</em></dt>
<dd>
<p><em>Description</em>
</p>
<p>This command declares parameters used in the model, in variable
initialization or in shocks declarations. See <a href="Conventions.html#Conventions">Conventions</a>, for the
syntax of <var>PARAMETER_NAME</var>. Optionally it is possible to give a
LaTeX name to the parameter.
</p>
<p>The parameters must subsequently be assigned values (see <a href="Parameter-initialization.html#Parameter-initialization">Parameter initialization</a>).
</p>
<p><code>parameters</code> commands can appear several times in the file and
Dynare will concatenate them.
</p>
<p><em>Options</em>
</p><dl compact="compact">
<dt><code>long_name = <var>QUOTED_STRING</var></code></dt>
<dd><p>Like <a href="#long_005fname">long_name</a> but value stored in <code>M_.param_names_long</code>.
</p>
</dd>
<dt><code>NAME = <var>QUOTED_STRING</var></code></dt>
<dd><p>Like <a href="#partitioning">partitioning</a> but <var>QUOTED_STRING</var> stored in
<code>M_.param_partitions.</code><var>NAME</var>.
</p></dd>
</dl>
<p><em>Example</em>
</p>
<div class="example">
<pre class="example">parameters alpha, bet;
</pre></div>
</dd></dl>
<dl>
<dt><a name="index-change_005ftype"></a>Command: <strong>change_type</strong> <em>(var | varexo | varexo_det | parameters) <var>VARIABLE_NAME</var> | <var>PARAMETER_NAME</var>…;</em></dt>
<dd>
<p><em>Description</em>
</p>
<p>Changes the types of the specified variables/parameters to another type:
endogenous, exogenous, exogenous deterministic or parameter.
</p>
<p>It is important to understand that this command has a global effect on
the <samp>.mod</samp> file: the type change is effective after, but also
before, the <code>change_type</code> command. This command is typically used
when flipping some variables for steady state calibration: typically a
separate model file is used for calibration, which includes the list of
variable declarations with the macro-processor, and flips some variable.
</p>
<p><em>Example</em>
</p>
<div class="example">
<pre class="example">var y, w;
parameters alpha, bet;
…
change_type(var) alpha, bet;
change_type(parameters) y, w;
</pre></div>
<p>Here, in the whole model file, <code>alpha</code> and <code>beta</code> will be
endogenous and <code>y</code> and <code>w</code> will be parameters.
</p>
</dd></dl>
<a name="predetermined_005fvariables"></a><dl>
<dt><a name="index-predetermined_005fvariables"></a>Command: <strong>predetermined_variables</strong> <em><var>VARIABLE_NAME</var>…;</em></dt>
<dd>
<p><em>Description</em>
</p>
<p>In Dynare, the default convention is that the timing of a variable
reflects when this variable is decided. The typical example is for
capital stock: since the capital stock used at current period is
actually decided at the previous period, then the capital stock entering
the production function is <code>k(-1)</code>, and the law of motion of
capital must be written:
</p>
<div class="example">
<pre class="example">k = i + (1-delta)*k(-1)
</pre></div>
<p>Put another way, for stock variables, the default in Dynare is to use a
“stock at the end of the period” concept, instead of a “stock at the
beginning of the period” convention.
</p>
<p>The <code>predetermined_variables</code> is used to change that
convention. The endogenous variables declared as predetermined variables
are supposed to be decided one period ahead of all other endogenous
variables. For stock variables, they are supposed to follow a “stock at
the beginning of the period” convention.
</p>
<p>Note that Dynare internally always uses the “stock at the end of the period”
concept, even when the model has been entered using the
<code>predetermined_variables</code>-command. Thus, when plotting,
computing or simulating variables, Dynare will follow the convention to
use variables that are decided in the current period. For example,
when generating impulse response functions for capital, Dynare
will plot <code>k</code>, which is the capital stock decided upon by
investment today (and which will be used in tomorrow’s production function).
This is the reason that capital is shown to be moving on impact, because
it is <code>k</code> and not the predetermined <code>k(-1)</code> that is displayed.
It is important to remember that this also affects simulated time
series and output from smoother routines for predetermined variables.
Compared to non-predetermined variables they might otherwise appear
to be falsely shifted to the future by one period.
<em>Example</em>
</p>
<p>The following two program snippets are strictly equivalent.
</p>
<p><em>Using default Dynare timing convention:</em>
</p>
<div class="example">
<pre class="example">var y, k, i;
…
model;
y = k(-1)^alpha;
k = i + (1-delta)*k(-1);
…
end;
</pre></div>
<p><em>Using the alternative timing convention:</em>
</p>
<div class="example">
<pre class="example">var y, k, i;
predetermined_variables k;
…
model;
y = k^alpha;
k(+1) = i + (1-delta)*k;
…
end;
</pre></div>
</dd></dl>
<dl>
<dt><a name="index-trend_005fvar"></a>Command: <strong>trend_var</strong> <em>(growth_factor = <var>MODEL_EXPRESSION</var>) <var>VARIABLE_NAME</var> [$<var>LATEX_NAME</var>$]…;</em></dt>
<dd>
<p><em>Description</em>
</p>
<p>This optional command declares the trend variables in the
model. See <a href="Conventions.html#Conventions">Conventions</a>, for the syntax of <var>MODEL_EXPRESSION</var>
and <var>VARIABLE_NAME</var>. Optionally it is possible to give a LaTeX
name to the variable.
</p>
<p>The variable is assumed to have a multiplicative growth trend. For an
additive growth trend, use <code>log_trend_var</code> instead.
</p>
<p>Trend variables are required if the user wants to be able to write a
nonstationary model in the <code>model</code> block. The <code>trend_var</code>
command must appear before the <code>var</code> command that references the
trend variable.
</p>
<p><code>trend_var</code> commands can appear several times in the file and
Dynare will concatenate them.
</p>
<p>If the model is nonstationary and is to be written as such in the
<code>model</code> block, Dynare will need the growth factor of every trend
variable in order to stationarize the model. The growth factor must be
provided within the declaration of the trend variable, using the
<code>growth_factor</code> keyword. All endogenous variables and
parameters referenced in <var>MODEL_EXPRESSION</var> must already have been
declared by the <code>var</code> and <code>parameters</code> commands.
</p>
<p><em>Example</em>
</p>
<div class="example">
<pre class="example">trend_var (growth_factor=gA) A;
</pre></div>
</dd></dl>
<dl>
<dt><a name="index-log_005ftrend_005fvar"></a>Command: <strong>log_trend_var</strong> <em>(log_growth_factor = <var>MODEL_EXPRESSION</var>) <var>VARIABLE_NAME</var> [$<var>LATEX_NAME</var>$]…;</em></dt>
<dd>
<p><em>Description</em>
</p>
<p>Same as <code>trend_var</code>, except that the variable is supposed to have
an additive trend (or, to put it otherwise, to be equal to the log of
a variable with a multiplicative trend).
</p>
</dd></dl>
<hr>
<div class="header">
<p>
Next: <a href="Expressions.html#Expressions" accesskey="n" rel="next">Expressions</a>, Previous: <a href="Conventions.html#Conventions" accesskey="p" rel="prev">Conventions</a>, Up: <a href="The-Model-file.html#The-Model-file" accesskey="u" rel="up">The Model file</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Function-Index.html#Command-and-Function-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|