5.3 Random-effects stochastic frontier
Mathematical representation
(5.3) |
- the model is estimated using observations from groups, each group observed for periods (balanced or unbalanced panels); the total number of observations is
- is the value of the dependent variable for group , observed in period
- is a vector that stores the values of the independent variables for group , observed in period
- is a vector of parameters
- is the precision of the noise component of the error term:
- is the group-specific error term for group
- is precision of the group-specific error term:
-
is the inefficiency component of the error term for group
in
period
and it can have any non-negative distribution, represented in the equation above by
; BayES supports the
following distributions for :
- exponential:
- half normal:
When enters the specification with a plus sign then the model represents a cost frontier, while when enters with a minus sign the model represents a production frontier. For the efficiency scores generated by a stochastic frontier model to be meaningful, the dependent variable in both cases must be in logarithms. |
The mean of the distribution of the s is restricted to zero and, therefore, these are simply group-specific errors terms. However, including a constant term in the set of independent variables is valid and leads to a specification equivalent to one where the group effects are draws from a normal distribution with mean equal to the parameter associated with the constant term and precision . |
No time dependence is imposed on the inefficiency component of the error term: each is treated as an independent draw from . This specification is known as the “true random effects" stochastic frontier model (Greene, 2004) . |
Priors
Parameter | Probability density function | Default hyperparameters |
Common to all models
| ||
, | ||
, | ||
, | ||
Exponential model
| ||
, | ||
Half normal model
| ||
, | ||
Syntax
where:
- y is the dependent variable name, as it appears in the dataset used for estimation
- x1 x2 xK is a list of the independent variable names, as they appear in the dataset used for estimation; when a constant term is to be included in the model, this must be requested explicitly
Before using the sf_re() function the dataset used for estimation must be declared as a panel dataset using the set_pd() function (see section B.13). |
BayES automatically drops from the sample used for estimation groups which are observed only once. This is because for these groups the group effect () cannot be distinguished from the noise component of the error term (). |
The optional arguments for the random-effects stochastic frontier model are:3
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 |
Model specification
| |
"udist" | specification of the distribution of the inefficiency component of the error term; the following options are available, corresponding to the distributions presented at the beginning of this section:
the default value is "exp" |
"production" | boolean specifying the type of frontier (production/cost); it could be set to either true (production) or false (cost); the default value is true |
Hyperparameters
| |
Common to all models | |
"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 |
"a_tau" | shape parameter of the prior for (positive number); the default value is |
"b_tau" | rate parameter of the prior for (positive number); the default value is |
"a_omega" | shape parameter of the prior for (positive number); the default value is |
"b_omega" | rate parameter of the prior for (positive number); the default value is |
Exponential model
| |
"a_lambda" | shape parameter of the prior for (positive number); the default value is |
"b_lambda" | rate parameter of the prior for (positive number); the default value is |
Half normal model | |
"a_phi" | shape parameter of the prior for (positive number); the default value is |
"b_phi" | rate parameter of the prior for (positive number); 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
Common to all models | ||
| variable_name | vector of parameters associated with the independent variables |
| tau | precision parameter of the noise component of the error term, |
| omega | precision parameter of the group-specific error term, |
| sigma_v | standard deviation of the noise component of the error term, |
| sigma_alpha | standard deviation of the group-specific error term: |
Exponential model
| ||
| lambda | rate parameter of the distribution of the inefficiency component of the error term, |
| sigma_u | scale parameter of the inefficiency component of the error term: . For the exponential model the standard deviation of is equal to the scale parameter. |
Half normal model | ||
| phi | precision parameter of the distribution of the inefficiency component of the error term, |
| sigma_u | scale parameter of the inefficiency component of the error term: . The standard deviation of for the half-normal model can be obtained as . |
Stored values and post-estimation analysis
If a left-hand-side id value is provided when a random-effects stochastic frontier 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 , and either (exponential model) or (half-normal model) |
x1,,xK | vectors containing the draws from the posterior of the parameters associated with variables x1,,xK (the names of these vectors are the names of the variables that were included in the right-hand side of the model) |
tau | vector containing the draws from the posterior of |
omega | vector containing the draws from the posterior of |
lambda | vector containing the draws from the posterior of (available after the estimation of the exponential model) |
phi | vector containing the draws from the posterior of (available after the estimation of the half-normal model) |
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 |
alpha_i | vector that stores the group-specific errors; the values in this vector are not guaranteed to be in the same order as the order in which the groups appear in the dataset used for estimation; use the store() function to associate the values in alpha_i with the observations in the dataset |
eff_i | vector that stores the expected values of the observation-specific efficiency scores, ; the values in this vector are not guaranteed to be in the same order as the order in which the observations appear in the dataset used for estimation; use the store() function to associate the values in eff_i with the observations in the dataset |
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()
- store()
The random-effects stochastic frontier model uses the store() function to associate the group effects (alpha_i) or the estimates of the efficiency scores (eff_i) with specific observations and store their values in the dataset used for estimation. The generic syntax for a statement involving the store() function after estimation of a random-effects stochastic frontier model and for each of these two quantities is:
and:
Examples
Example 1
myData.constant = ones(rows(myData), 1);
set_pd( year, id, "dataset" = myData);
myModel = sf_re( y ~ constant x1 x2 x3 );
Example 2
myData.constant = ones(rows(myData), 1);
set_pd( year, id, "dataset" = myData);
exp_SFRE = sf_re( y ~ constant x1 x2 x3, "logML_CJ" = true );
hnorm_SFRE = sf_re( y ~ constant x1 x2 x3, "logML_CJ" = true,
"udist" = "hnorm" );
store( alpha_i, re_exp, "model" = exp_SFRE );
store( alpha_i, re_hnorm, "model" = hnorm_SFRE );
store( eff_i, eff_exp, "model" = exp_SFRE );
store( eff_i, eff_hnorm, "model" = hnorm_SFRE );
pmp( { exp_SFRE, hnorm_SFRE } );
pmp( { exp_SFRE, hnorm_SFRE }, "logML_CJ"=true );
hist(myData.eff_exp,
"title"="Efficiency scores from the exponential model",
"grid"="on");
hist(myData.eff_hn,
"title"="Efficiency scores from the halfnormal model",
"grid"="on");
3Optional arguments are always given in option-value pairs (eg. "chains"=3).