databank.minusControl
(+databank)
Create simulation-minus-control database
Syntax
[outputDb, controlDb] = databank.minusControl(model, inputDb, ...)
[outputDb, controlDb] = databank.minusControl(model, inputDb, controlDb, ...)
Input arguments
__model
[ model ]
Model object on which the databases
inputDb
andcontrolDb
__ are based.
inputDb
[ struct ]
Simulation (or any other kind of) databank from which the
controlDb
will be subtracted.
^__controlDb
[ struct ]
Control database that will be subtracted form the
inputDb
; if omitted a steady-state databank for themodel
is created and used in the place of the control databank.
Output arguments
outputData
[ struct ]
Simulation-minus-control database, in which all log variables are
inputDb.x/controlDb.x
, and all other variables areinputDb.x-controlDb.x
.
controlDb
[ struct ]
Control database that has been subtracted from the
inputDb
database to createoutputDb
.
Options
Range=Inf
[ Dater | Inf
]
This range is used in two places:
if a
controlDb
is not supplied, themodel
steady-state databank is created with theRange=
input argument (meaning the control databank will exist on this range plus any necessary presample and postsample periods); ifopt.Range
refers to-Inf
orInf
, then the control databank is created on an all-encompassing range of theinputDb
.each
model
variable time series is clipped to theRange=
before being included in theoutputDb
.
Description
Example
Run a shock simulation in full levels using a steady-state (or balanced-growth-path) database as input, and then compute the deviations from the steady state:
d = steadydb(m, 1:40);
% Set up a shock or shocks here
s = simulate(m, d, 1:40, prependInput=true);
s = databank.minusControl(m, s, d);
or simply
s = databank.minusControl(m, s);
The above block of code is equivalent to this one:
d = zerodb(m, 1:40);
% Set up a shock or shocks here
s = simulate(m, d, 1:40, deviation=true, prependInput=true);