sfalcmcross | R Documentation |
sfalcmcross
is a symbolic formula based function for the
estimation of the latent class stochastic frontier model (LCM) in the case
of cross-sectional or pooled cross-sectional data. The model is estimated
using maximum likelihood (ML). See Orea and Kumbhakar (2004), Parmeter and
Kumbhakar (2014, p282).
Only the half-normal distribution is possible for the one-sided error term. Eleven optimization algorithms are available.
The function also accounts for heteroscedasticity in both one-sided and two-sided error terms, as in Reifschneider and Stevenson (1991), Caudill and Ford (1993), Caudill et al. (1995) and Hadri (1999).
The model can estimate up to five classes.
sfalcmcross(
formula,
uhet,
vhet,
thet,
logDepVar = TRUE,
data,
subset,
weights,
wscale = TRUE,
S = 1L,
udist = "hnormal",
start = NULL,
whichStart = 2L,
initAlg = "nm",
initIter = 100,
lcmClasses = 2,
method = "bfgs",
hessianType = 1,
itermax = 2000L,
printInfo = FALSE,
tol = 1e-12,
gradtol = 1e-06,
stepmax = 0.1,
qac = "marquardt"
)
## S3 method for class 'sfalcmcross'
print(x, ...)
## S3 method for class 'sfalcmcross'
bread(x, ...)
## S3 method for class 'sfalcmcross'
estfun(x, ...)
formula |
A symbolic description of the model to be estimated based on
the generic function |
uhet |
A one-part formula to account for heteroscedasticity in the one-sided error variance (see section ‘Details’). |
vhet |
A one-part formula to account for heteroscedasticity in the two-sided error variance (see section ‘Details’). |
thet |
A one-part formula to account for technological heterogeneity in the construction of the classes. |
logDepVar |
Logical. Informs whether the dependent variable is logged
( |
data |
The data frame containing the data. |
subset |
An optional vector specifying a subset of observations to be used in the optimization process. |
weights |
An optional vector of weights to be used for weighted
log-likelihood. Should be |
wscale |
Logical. When |
S |
If |
udist |
Character string. Distribution specification for the one-sided
error term. Only the half normal distribution |
start |
Numeric vector. Optional starting values for the maximum likelihood (ML) estimation. |
whichStart |
Integer. If |
initAlg |
Character string specifying the algorithm used for
initialization and obtain the starting values (when
|
initIter |
Maximum number of iterations for initialization algorithm.
Default |
lcmClasses |
Number of classes to be estimated (default = |
method |
Optimization algorithm used for the estimation. Default =
|
hessianType |
Integer. If |
itermax |
Maximum number of iterations allowed for optimization.
Default = |
printInfo |
Logical. Print information during optimization. Default =
|
tol |
Numeric. Convergence tolerance. Default = |
gradtol |
Numeric. Convergence tolerance for gradient. Default =
|
stepmax |
Numeric. Step max for |
qac |
Character. Quadratic Approximation Correction for |
x |
an object of class sfalcmcross (returned by the function
|
... |
additional arguments of frontier are passed to sfalcmcross; additional arguments of the print, bread, estfun, nobs methods are currently ignored. |
LCM is an estimation of a finite mixture of production functions:
y_i = \alpha_j + \mathbf{x_i^{\prime}}
\bm{\beta_j} + v_{i|j} - Su_{i|j}
\epsilon_{i|j} = v_{i|j} - Su_{i|j}
where i
is the observation, j
is the class, y
is the
output (cost, revenue, profit), x
is the vector of main explanatory
variables (inputs and other control variables), u
is the one-sided
error term with variance \sigma_{u}^2
, and v
is the two-sided
error term with variance \sigma_{v}^2
.
S = 1
in the case of production (profit) frontier function and
S = -1
in the case of cost frontier function.
The contribution of observation i
to the likelihood conditional on
class j
is defined as:
P(i|j) = \frac{2}{\sqrt{\sigma_{u|j}^2 +
\sigma_{v|j}^2}}\phi\left(\frac{S\epsilon_{i|j}}{\sqrt{
\sigma_{u|j}^2 +\sigma_{v|j}^2}}\right)\Phi\left(\frac{
\mu_{i*|j}}{\sigma_{*|j}}\right)
where
\mu_{i*|j}=\frac{- S\epsilon_{i|j}
\sigma_{u|j}^2}{\sigma_{u|j}^2 + \sigma_{v|j}^2}
and
\sigma_*^2 = \frac{\sigma_{u|j}^2
\sigma_{v|j}^2}{\sigma_{u|j}^2 + \sigma_{v|j}^2}
The prior probability of using a particular technology can depend on some covariates (namely the variables separating the observations into classes) using a logit specification:
\pi(i,j) = \frac{\exp{(\bm{\theta}_j'\mathbf{Z}_{hi})}}{
\sum_{m=1}^{J}\exp{(\bm{\theta}_m'\mathbf{Z}_{hi})}}
with \mathbf{Z}_h
the covariates, \bm{\theta}
the coefficients estimated for
the covariates, and \exp(\bm{\theta}_J'\mathbf{Z}_h)=1
.
The unconditional likelihood of observation i
is simply the average
over the J
classes:
P(i) = \sum_{m=1}^{J}\pi(i,m)P(i|m)
The number of classes to retain can be based on information criterion (see
for instance ic
).
Class assignment is based on the largest posterior probability. This
probability is obtained using Bayes' rule, as follows for class j
:
w\left(j|i\right)=\frac{P\left(i|j\right)
\pi\left(i,j\right)}{\sum_{m=1}^JP\left(i|m\right)
\pi\left(i, m\right)}
To accommodate heteroscedasticity in the variance parameters of the error
terms, a single part (right) formula can also be specified. To impose the
positivity on these parameters, the variances are modelled respectively as:
\sigma^2_{u|j} = \exp{(\bm{\delta}_j'\mathbf{Z}_u)}
and \sigma^2_{v|j} =
\exp{(\bm{\phi}_j'\mathbf{Z}_v)}
, where Z_u
and Z_v
are the
heteroscedasticity variables (inefficiency drivers in the case of \mathbf{Z}_u
)
and \bm{\delta}
and \bm{\phi}
the coefficients. 'sfalcmcross'
only
supports the half-normal distribution for the one-sided error term.
sfalcmcross
allows for the maximization of weighted log-likelihood.
When option weights
is specified and wscale = TRUE
, the weights
are scaled as:
new_{weights} = sample_{size} \times
\frac{old_{weights}}{\sum(old_{weights})}
For complex problems, non-gradient methods (e.g. nm
or
sann
) can be used to warm start the optimization and zoom in the
neighborhood of the solution. Then a gradient-based methods is recommended
in the second step. In the case of sann
, we recommend to significantly
increase the iteration limit (e.g. itermax = 20000
). The Conjugate
Gradient (cg
) can also be used in the first stage.
A set of extractor functions for fitted model objects is available for
objects of class 'sfalcmcross'
including methods to the generic functions
print
,
summary
,
coef
,
fitted
,
logLik
,
residuals
,
vcov
,
efficiencies
,
ic
,
marginal
,
estfun
and
bread
(from the sandwich package),
lmtest::coeftest()
(from the lmtest package).
sfalcmcross
returns a list of class 'sfalcmcross'
containing the following elements:
call |
The matched call. |
formula |
Multi parts formula describing the estimated model. |
S |
The argument |
typeSfa |
Character string. 'Latent Class Production/Profit Frontier, e
= v - u' when |
Nobs |
Number of observations used for optimization. |
nXvar |
Number of main explanatory variables. |
nZHvar |
Number of variables in the logit specification of the finite mixture model (i.e. number of covariates). |
logDepVar |
The argument |
nuZUvar |
Number of variables explaining heteroscedasticity in the one-sided error term. |
nvZVvar |
Number of variables explaining heteroscedasticity in the two-sided error term. |
nParm |
Total number of parameters estimated. |
udist |
The argument |
startVal |
Numeric vector. Starting value for ML estimation. |
dataTable |
A data frame (tibble format) containing information on data
used for optimization along with residuals and fitted values of the OLS and
ML estimations, and the individual observation log-likelihood. When
|
initHalf |
When |
isWeights |
Logical. If |
optType |
The optimization algorithm used. |
nIter |
Number of iterations of the ML estimation. |
optStatus |
An optimization algorithm termination message. |
startLoglik |
Log-likelihood at the starting values. |
nClasses |
The number of classes estimated. |
mlLoglik |
Log-likelihood value of the ML estimation. |
mlParam |
Numeric vector. Parameters obtained from ML estimation. |
mlParamMatrix |
Double. Matrix of ML parameters by class. |
gradient |
Numeric vector. Each variable gradient of the ML estimation. |
gradL_OBS |
Matrix. Each variable individual observation gradient of the ML estimation. |
gradientNorm |
Numeric. Gradient norm of the ML estimation. |
invHessian |
The covariance matrix of the parameters obtained from the ML estimation. |
hessianType |
The argument |
mlDate |
Date and time of the estimated model. |
In the case of panel data, sfalcmcross
estimates a pooled
cross-section where the probability of belonging to a class a priori is not
permanent (not fixed over time).
Aigner, D., Lovell, C. A. K., and P. Schmidt. 1977. Formulation and estimation of stochastic frontier production function models. Journal of Econometrics, 6(1), 21–37.
Caudill, S. B., and J. M. Ford. 1993. Biases in frontier estimation due to heteroscedasticity. Economics Letters, 41(1), 17–20.
Caudill, S. B., Ford, J. M., and D. M. Gropper. 1995. Frontier estimation and firm-specific inefficiency measures in the presence of heteroscedasticity. Journal of Business & Economic Statistics, 13(1), 105–111.
Hadri, K. 1999. Estimation of a doubly heteroscedastic stochastic frontier cost function. Journal of Business & Economic Statistics, 17(3), 359–363.
Meeusen, W., and J. Vandenbroeck. 1977. Efficiency estimation from Cobb-Douglas production functions with composed error. International Economic Review, 18(2), 435–445.
Orea, L., and S.C. Kumbhakar. 2004. Efficiency measurement using a latent class stochastic frontier model. Empirical Economics, 29, 169–183.
Parmeter, C.F., and S.C. Kumbhakar. 2014. Efficiency analysis: A primer on recent advances. Foundations and Trends in Econometrics, 7, 191–385.
Reifschneider, D., and R. Stevenson. 1991. Systematic departures from the frontier: A framework for the analysis of firm inefficiency. International Economic Review, 32(3), 715–723.
print
for printing sfalcmcross
object.
summary
for creating and printing
summary results.
coef
for extracting coefficients of the
estimation.
efficiencies
for computing
(in-)efficiency estimates.
fitted
for extracting the fitted frontier
values.
ic
for extracting information criteria.
logLik
for extracting log-likelihood
value(s) of the estimation.
marginal
for computing marginal effects of
inefficiency drivers.
residuals
for extracting residuals of the
estimation.
vcov
for computing the variance-covariance
matrix of the coefficients.
bread
for bread for sandwich estimator.
estfun
for gradient extraction for each
observation.
## Using data on eighty-two countries production (GDP)
# LCM Cobb Douglas (production function) half normal distribution
# Intercept and initStat used as separating variables
cb_2c_h1 <- sfalcmcross(formula = ly ~ lk + ll + yr, thet = ~initStat,
data = worldprod)
summary(cb_2c_h1)
# summary of the initial ML model
summary(cb_2c_h1$InitHalf)
# Only the intercept is used as the separating variable
# and only variable initStat is used as inefficiency driver
cb_2c_h3 <- sfalcmcross(formula = ly ~ lk + ll + yr, uhet = ~initStat,
data = worldprod)
summary(cb_2c_h3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.