BayES BayES

10.1 Simple Seemingly Unrelated Regressions (SUR)

Mathematical representation

y1i = x1iβ1 + 𝜀1i y2i = x2iβ2 + 𝜀2i yMi = xMiβM + 𝜀Mi

An equivalent and more compact representation of the model is:

yi = Xiβ + 𝜀i,𝜀i N 0,Ω1

where:

yiM×1 = y1i y2i y Mi ,XiM×K = x1i 0 0 0 x2i 0 0 0 xMi ,βK×1 = β1 β2 β M ,𝜀iM×1 = 𝜀1i 𝜀2i 𝜀 Mi

Priors




Parameter Probability density function Default hyperparameters



β p β = |P|12 2πK2 exp 1 2 β mP β m m = 0 K, P = 0.001 IK
Ω p Ω = |Ω|nM1 2 |V1|n2 2nM2ΓMn 2 exp 1 2 tr V1Ω n = M2, V = 100 M IM



Syntax

[<model name> = ] sur( { 
      y1 ~ x11 x12  x1K1, 
      y2 ~ x21 x22  x2K2, 
      , 
      yM ~ xM1 xM2  xMKM } 
      [, <options> ] 
);

where:

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 β (K ×1 vector); the default value is 0K

"P"

precision matrix of the prior for β (K ×K symmetric and positive-definite matrix); the default value is 0.001 IK

"V"

scale matrix of the prior for Ω (M ×M symmetric and positive-definite matrix); the default value is 100 M IM

"n"

degrees-of-freedom parameter of the prior for Ω (real number greater than or equal to M); the default value is M2

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 (true|false); 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,,
  ym$xmKm

vectors containing the draws from the posterior of the parameters associated with variables xm1,,xmKm, for m = 1,2,,M (the names of these vectors are the names of the variables that were included in the right-hand side of equation m, prepended by ym$, where ym is the name of the dependent variable in equation m; 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 M1M 2 + M of its elements are stored (instead of all M2 elements); i and j index the row and column of Ω, respectively, at which the corresponding element is located

Omega

M ×M 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):

Examples

Example 1

myData = import("$BayESHOME/Datasets/dataset5.csv"); 
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 = import("$BayESHOME/Datasets/dataset5.csv"); 
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).

Share this content:
Facebook Twitter LinkedIn Email
© 2016–20 Grigorios Emvalomatis