

Syntax
 Arguments and performed function



$[$W
=$]$
diagnostics(
$[$"model"=m$]$
);
 Calculates and prints MCMC diagnostics for the model with id value m. If m is not
provided then the function operates on the ﬁrst model (in alphabetical
order) in the current workspace. The reported diagnostics currently include:
 the header printed on top of every model estimated (number of observations,
Gibbs parameters, logmarginal likelihood, etc.)
 an estimate of the Monte Carlo standard error for every model parameter
 an estimate of the relative numerical eﬃciency and the ineﬃciency factor
(Chib, 2001) for every model parameter
If a lefthandside id value, W, is provided then the contents of the diagnostics table
are stored in W.



$[$W
=$]$
plotdraws( p
$[$,"model"=m$]$
);
 Creates a new ﬁgure window and plots four types of plots using the draws of
paramater p from model m. These plots are:
 the history of the draws per chain
 the correlogram of the draws
 the histogram of the draws
 the kernel desnity of the draws per chain
If m is not provided then the function operates on the ﬁrst model (in alphabetical
order) in the current workspace. If a lefthandside id value, W, is provided then the title of the ﬁgure window on
which the function is plotting is stored in W.
 p must be the name of a parameter estimated by model m
 m must be a model currently in memory



$[$W
=$]$
test(
<condition1> $[$,
<condition2>,
...$]$
);
 Calculates and prints the number of times and percentage that conditions
<condition1>, <condition2>, …, are satisﬁed, ﬁrst individually and then
jointly. These conditions can be expressed using general vectors. For example,
<condition1> could be: v1>=v2, where v1 and v2 are vectors of equal length, say
$N$.
In this case the test function would count the number of times the
$n$^{th}
element of v1 is greater than or equal to the
$n$^{th}
element of v2, for $n=1,2,\dots ,N$.
The test statement is most frequently used to test restrictions that involve the
parameters of a model m. In this case <condition1> could be: m.x1<3, where test
counts the number of times the parameter associated with variable x1 is smaller
than 3 (note that scalar values are expanded to match the size of m.x1).
If a lefthandside id value, W, is provided then the contents of the printed table are
stored in W.



pmp( { m1, m2
$[$,
m3, m4
...$]$
}
$[$,
"priors"=p$]$
$[$,
"logML_CJ"=truefalse$]$
);
 Calculates and prints the posterior model probabilities of models m1, m2, …,
assuming that the list of models provided is exhaustive. The posterior model
probabilities are calculated using Bayes factors and the model prior probabilities
provided in vector p. If the optional argument "logML_CJ" is set to true then
Bayes factors are calculated using the Chib (1995)/Chib & Jeliazkov (2001)
approximation of the marginal likelihood for the models this is available;
otherwise, the Lewis & Raftery (1997) approximation is used for all models.
 m1, m2 $[$,
m3, m4 ...$]$
must be models currently in memory
 p must be a vector of nonnegative values that sum to unity, the length of
which is equal to the number of models to be compared. The default value for
p is set such that every model to be compared is given equal prior probability.
 "logML_CJ" must be either true or false. The default value for "logML_CJ" is
false.



$[$W
=$]$
mfx(
$[$"point"=p$]$
$[$,"model"=m$]$
$[$,"type"=i$]$
$[$,"opt"=z$]$ );
 Calculates and prints marginal eﬀects of the type indicated by i, for model m, at the
point indicated by p, while using z to pass any additional numerical input
(modelspeciﬁc). All arguments are optional and, therefore, the order in which they
are provided does not matter. If m is not provided then the function operates on the ﬁrst model (in alphabetical
order) in the current workspace. If a lefthandside id value, W, is provided then the contents of the marginal eﬀects
table are stored in W.



$[$[p1, p2, ...]
=$]$
predict(
$[$"point"=p$]$
$[$,"model"=m$]$
$[$,"stats"=truefalse$]$
$[$,"type"=i$]$
$[$,"opt"=z$]$
$[$,"prefix"=f$]$ );
 Generates predictions of the type indicated by i, for model m, at the point(s)
indicated by p, while using z to pass any additional numerical input (modelspeciﬁc).
If "stats" is set to true, summary statistics for each prediction are also generated. All
arguments are optional and, therefore, the order in which they are provided does not
matter. If m is not provided then the function operates on the ﬁrst model (in alphabetical
order) in the current workspace. If lefthandside id values, [p1, p2, ...], are provided then the predictions and,
possibly, their summary statistics, are stored in p1, p2, etc.
 p must be either a matrix of values indicating the points at which the
predictions are to be made or string "x_i". In the latter case predictions are
made at each data point in the dataset used by estimation and the results
(point estimates and, possibly, summary statistics) are stored in the dataset
with variable names preﬁxed by f.
 m must be a model currently in memory
 i must be a positive integer that controls the type of predictions to be
generated; the type of predictions available is modelspeciﬁc (some models do
not provide a procedure for generating predictions at all) and the semantics
of this argument are documented under each model
 z must be a matrix and its meaning varies by model
 f must be a valid id value and indicates the preﬁx in the variable names to
be stored in the dataset if the "point"\ option is set to "x_i"; the default value
for f is p_



store( e, varname
$[$,"model"=m$]$
);
 Stores element e from model m to the dataset associated with m in variable varname. If
a variable with the same name already exists in the dataset then its values are
replaced by the values in e. If m is not provided then the function operates on the
ﬁrst model (in alphabetical order) in the current workspace. This function is used to store observationspeciﬁc estimates to the datasets used for
estimating the parameters of a model. Due to possible missing values in the original
dataset, there is no guarantee that the observationspeciﬁc estimates in e will
have an onetoone relationship to the data contained in the dataset. store
is, therefore, used to associate the values in e with speciﬁc observations.
Modelspeciﬁc documentation of the store function is provided in the section where
the model is deﬁned. Not all models provide a store function.
 e must be an element of model m
 varname must be an id value
 m must be a model currently in memory



[f1, f2, ...] = forecast(
$[$"horizon"=h$]$
$[$,
"W"=M$]$
$[$,
"model"=m$]$ );
 Calculates and stores h period ahead forecasts for the endogenous variables in model
m, using the values in matrix M for the exogenous variables (if any). This function is
available only for dynamic models, such as ARIMA, VAR, etc. All three arguments
are optional and, therefore, the order in which they are provided does not
matter. f1, f2, ... are $h\phantom{\rule{0.3em}{0ex}}\times \phantom{\rule{0.3em}{0ex}}4$
matrices whose columns contain the expected values and standard deviations of the
forecasts per endogenous variable, as well as the upper and lower bounds of
the respective 90% credible intervals. Upon completion of the forecast
function, these matrices are also made available as elements of model m, with id
values constructed by prepending “f_" to the respective endogenous variable
name. If m is not provided then the function operates on the ﬁrst model (in alphabetical
order) in the current workspace.
 h must be a positive integer. The default value for h is 1.
 M must be a $h\phantom{\rule{0.3em}{0ex}}\times \phantom{\rule{0.3em}{0ex}}K$
matrix, where $K$
is the number of exogenous variables in the model. If the model contains
exogenous variables but "W" is not provided, then the sample means of the
exogenous variables are used.
 If both "horizon" and "W" are provided then the number of rows of M must
be equal to h. If only "W" is provided then the number of forecast periods is
inferred from the rows of M.
 m must be a model currently in memory



stabtest(
$[$"model"=m$]$
);
 Performs a stability test for model m. This function is available only for models that
contain autoregressive terms (ARIMA and VAR, although not yet implemented for
the VAR model). It works by treating the dynamic model as a diﬀerence equation
and calculating the proportion of draws from the posterior for which the root of the
characteristic polynomial with the maximum modulus lies within the unit
circle. If m is not provided then the function operates on the ﬁrst model (in alphabetical
order) in the current workspace.
 m must be a model currently in memory



irf(
$[$"horizon"=h$]$
$[$,
"orthogonal"=truefalse$]$
$[$,
"scaled"=truefalse$]$
$[$,
"model"=m$]$ );
 Calculates and plots h period impluse responses to a shock in the variables in model
m. This function is available only for the VAR model. All four arguments
are optional and, therefore, the order in which they are provided does not
matter. If m is not provided then the function operates on the ﬁrst model (in alphabetical
order) in the current workspace.
 h must be a positive integer. The default value for h is 10.
 "orthogonal" must be set to either true or false, indicating whether a shock
on the orthogonalized or raw errors should be considered, respectively.
The default value for "orthogonal" is true, in which case the shocks are
orthogonalized using the Cholesky decomposition of the variance matrix,
prior to calculating responses.
 "scaled" must be set to either true or false, indicating whether a shock of size
equal to the standard deviation of the error or to a unit of the respective
variable should be considered, respectively. The default value for "scaled" is
true, in which case the shock is equal to the one standard deviation of the
error.
 m must be a model currently in memory



