10.1 Simple Seemingly Unrelated Regressions (SUR)
Mathematical representation
- the model consists of equations
- the model is estimated using observations ()
- is the value of equation ’s dependent variable for observation
- is a vector that stores the values of the independent variables for observation , as they appear in equation
- the same independent variable can appear in multiple equations, associated with different coefficients
- is a vector of parameters associated with equation ’s independent variables
- in total, there are slope parameters to be estimated
- the error terms jointly follow a multivariate Normal distribution with mean and precision matrix
An equivalent and more compact representation of the model is:
where:
Priors
Parameter | Probability density function | Default hyperparameters |
, | ||
, | ||
Syntax
y1 ~ x11 x12 … x1K,
y2 ~ x21 x22 … x2K,
…,
yM ~ xM1 xM2 … xMK }
, <options>
);
where:
- y1, y2, …, yM are the dependent variable names, as they appear in the dataset used for estimation
- xm1 xm2 xmK is a list of the independent variable names for equation , as they appear in the dataset used for estimation; when a constant term is to be included in an equation, this must be requested explicitly; such lists must be provided
The optional arguments for the Seemingly Unrelated Regressions model are:1
Gibbs parameters
| |
"chains" | number of chains to run in parallel (positive integer); the default value is 1 |
"burnin" | number of burn-in draws per chain (positive integer); the default value is 10000 |
"draws" | number of retained draws per chain (positive integer); the default value is 20000 |
"thin" | value of the thinning parameter (positive integer); the default value is 1 |
"seed" | value of the seed for the random-number generator (positive integer); the default value is 42 |
Hyperparameters
| |
"m" | mean vector of the prior for ( vector); the default value is |
"P" | precision matrix of the prior for ( symmetric and positive-definite matrix); the default value is |
"V" | scale matrix of the prior for ( symmetric and positive-definite matrix); the default value is |
"n" | degrees-of-freedom parameter of the prior for (real number greater than or equal to ); the default value is |
Dataset and log-marginal likelihood
| |
"dataset" | the id value of the dataset that will be used for estimation; the default value is the first dataset in memory (in alphabetical order) |
"logML_CJ" | boolean indicating whether the Chib (1995)/Chib & Jeliazkov (2001) approximation to the log-marginal likelihood should be calculated (truefalse); the default value is false |
Reported Parameters
| variable_name | vector of parameters associated with the independent variables; these are broken into groups according to the equation in which the independent variables appear |
Stored values and post-estimation analysis
If a left-hand-side id value is provided when a SUR model is created, then the
following results are saved in the model item and are accessible via the ‘.’ operator:
Samples | a matrix containing the draws from the posterior of (across all equations, starting from the first equation) and the unique elements of |
ym$xm1,, | vectors containing the draws from the posterior of the parameters associated with variables xm1,,xmK, for (the names of these vectors are the names of the variables that were included in the right-hand side of equation , prepended by ym$, where ym is the name of the dependent variable in equation ; this is done so that the samples on the parameters associated with a variable that appears in more than one equations can be distinguished) |
Omega_i_j | vectors containing the draws from the posterior of the unique elements of ; because is symmetric, only of its elements are stored (instead of all elements); i and j index the row and column of , respectively, at which the corresponding element is located |
Omega | matrix that stores the posterior mean of |
logML | the Lewis & Raftery (1997) approximation of the log-marginal likelihood |
logML_CJ | the Chib (1995)/Chib & Jeliazkov (2001) approximation to the log-marginal likelihood; this is available only if the model was estimated with the "logML_CJ"=true option |
nchains | the number of chains that were used to estimate the model |
nburnin | the number of burn-in draws per chain that were used when estimating the model |
ndraws | the total number of retained draws from the posterior (chains draws) |
nthin | value of the thinning parameter that was used when estimating the model |
nseed | value of the seed for the random-number generator that was used when estimating the model |
Additionally, the following functions are available for post-estimation analysis (see section B.14):
- diagnostics()
- test()
- pmp()
Examples
Example 1
myData.constant = ones(rows(myData), 1);
model1 = sur( {
y1 ~ constant x1 x2 x3 x4 x5 x6 x7 x8 x9 x10,
y2 ~ constant x1 x2 x3,
y3 ~ constant x1 x2 x3
} );
Example 2
myData.constant = ones(rows(myData), 1);
model1 = sur( {
y1 ~ constant x1 x2 x3 x4 x5 x6 x7 x8 x9 x10,
y2 ~ constant x1 x2 x3,
y3 ~ constant x1 x2 x3
}, "logML_CJ"=true );
print(mean([model1.y1$x1-model1.y2$constant, model1.y1$x2-model1.y3$constant]));
model2 = sur( {
y1 ~ constant x1 x2 x3 x4 x5 x6 x7 x8 x9 x10,
y2 ~ constant x1 x2 x3,
y3 ~ constant x1 x2 x3
},
"constraints" = {
y1$x1-y2$constant=0, y1$x5-0.5*y2$x1=0, y1$x6-y2$x2=0, y1$x7-y2$x3=0,
y1$x2-y3$constant=0, y1$x6-y3$x1=0, y1$x8-0.5*y3$x2=0, y1$x9-y3$x3=0,
},
"Xi" = 1e7*eye(8,8), "logML_CJ"=true );
print(mean([model2.y1$x1-model2.y2$constant, model2.y1$x2-model2.y3$constant]));
pmp( {model1, model2} );
pmp( {model2, model2}, "logML_CJ" = true);
1Optional arguments are always given in option-value pairs (eg. "chains"=3).