Semiparametric Estimation of Stochastic Frontier Models following the two step procedure proposed by Fan et al (1996) and further developed by Vidoli and Ferrara (2014). In the first step semiparametric or nonparametric regression techniques are used to relax parametric restrictions regards the functional form of the frontier and in the second step variance parameters are obtained by pseudolikelihood or method of moments estimators.
semsfa(formula, data = list(), sem.method = "gam", var.method = "fan",
ineffDecrease=TRUE, tol = 1e-05, n.boot=0,...)an object of class "formula": a symbolic description of the model to be fitted. The details of model specification are given under 'Details'
a data frame containing the variables in the model
a character string indicating the type of estimation method to be used in the first step for the semiparametric or nonparametric regression; possible values are "gam" (default), "kernel" or "loess"
the type of estimation method to be used in the second step for the variance components: "fan" (default) for Fan et al. (1996) approach and "mm" for method of moments
logical: TRUE (default) for estimating a production function, FALSE for estimating a cost function; this is done for usage compatibility with frontier package
numeric. Convergence tolerance for pseudolikelihood estimators of variance parameters of the composed error term
numeric. Number of bootstrap replicates to calculate standard error for the variance components, by default bootstrap standard errors will not be calculated (n.boot=0)
further arguments accepted by mgcv::gam, np::npreg or loess
semsfa() returns an object of class semsfa.
An semsfa object is a list containing the following components:
the formula used
the response variable used as specified in formula
the data frame used
the matched call
the type of semiparametric or nonparametric regression as given by sem.method ("gam", "kernel", "loess")
the type of error component estimator ("fan", "mm")
logical, as given by ineffDecrease
an object of class "gam", "np"(kernel) or "loess" depending on sem.method
fitted values on the "mean" frontier (semiparametric/non parametric regression)
asymmetry index calculated on residuals obtained in the first step
\(\lambda\) estimate
\(\sigma\) estimate
fitted values on the frontier
convergence tolerance for pseudolikelihood estimators used in optimize
residual degree of freedom of the model
'Bayesian Information Criterion' according to the formula -2*log-likelihood+ log(n)*npar where npar represents the number of parameters in the fitted model and n the number of observations
number of bootstrap replicates used (default n.boot=0)
a matrix containing \(\lambda\) and \(\sigma\) values from each bootstrap replicate (if n.boot>0)
boostrapped standard errors for \(\lambda\) and \(\sigma\) (if n.boot>0)
Parametric stochastic production frontier models, introduced by Aigner et al. (1977) and Meeusen and van den Broeck (1977), specify output in terms of a response function and a composite error term. The composite error term consists of a two-sided error representing random effects and a one-sided term representing technical inefficiency.
The production stochastic frontier model can be written, in general terms, as:
$$y_i = f (x_i)+v_i - u_i,\quad \quad i = 1, ..., n,$$
where \(Y_i\in R^+\) is the single output of unit \(i\), \(X_i\in R^{+}_{p}\) is the vector of inputs, \(f(.)\) defines a production frontier relationship between inputs X and the single output Y. In following common practice, we assume that \(v\) and \(u\) are each identically independently distributed (\(iid\)) with \(v\sim N(0,\sigma_v)\) and \(u\) distributed half-normally on the non-negative part of the real number line: \(u\sim N^{+}(0,\sigma_u)\); furthermore, the probability density function of the composite disturbance can be rewritten in terms of \(\lambda = \sigma_u/\sigma_v\) and \(\sigma^2 = \sigma_v^2+\sigma_u^2\) for the estimation algorithm.
To overcome drawbacks due to the specification of a particular production function \(f(\cdot)\) we consider the estimation of a Semiparametric Stochastic Production Frontier Models through a two step procedure originally proposed by Fan et al (1996): in the first step a semiparametric or nonparametric regression technique is used to estimate the conditional expectation, while in the second step \(\lambda\) and \(\sigma\) parameters are estimated by pseudolikelihood (via optimize) or by method of moments estimators (var.method argument).
In the case of a cost function frontier (ineffDecrease=FALSE) the composite error term is \(\varepsilon = v + u\).
Vidoli and Ferrara (2014) suggest a Generalized Additive Model (GAM) framework in the first step even if any semiparametric or nonparametric tecnique may be used (Fan et al., 1996).
The avalaible methods for the first step are:
sem.method="gam" invokes gam() from mgcv;
sem.method="kernel" invokes npreg() from np;
sem.method="loess" invokes loess() from stats.
Since in the first step different estimation procedure may be invoked from different packages, the formula argument has to be compatible with the corresponding function. The avalaible methods for the second step are:
var.method="fan" pseudolikelihood;
var.method="mm" Method of Moments.
Aigner., D., Lovell, C.A.K., Schmidt, P., 1977. Formulation and estimation of stochastic frontier production function models. Journal of Econometrics 6:21-37
Fan, Y., Li, Q., Weersink, A., 1996. Semiparametric estimation of stochastic production frontier models. Journal of Business & Economic Statistics 14:460-468
Hastie, T., Tibshirani, R., 1990. Generalized additive models. Chapman & Hall
Kumbhakar, S.C., Lovell, C.A.K, 2000. Stochastic Frontier Analysis. Cambridge University Press, U.K
Meeusen, W., van den Broeck, J., 1977. Efficiency estimation from cobb-douglas production functions with composed error. International Economic Review 18:435-444
Vidoli, F., Ferrara, G., 2014. Analyzing Italian citrus sector by semi-nonparametric frontier efficiency models. Empirical Economics doi 10.1007/s00181-014-0879-6
# NOT RUN {
set.seed(0)
n<-200
x<- runif(n, 1, 2)
v<- rnorm(n, 0, 1)
u<- abs(rnorm(n,0,2.5))
#cost frontier
fy<- 2+30*x+5*x^2
y <- fy + v + u
dati<-data.frame(y,x)
#first-step: gam, second-step: fan
o<-semsfa(y~s(x),dati,sem.method="gam",ineffDecrease=FALSE)
#first-step: gam, second-step: mm
# }
# NOT RUN {
o<-semsfa(y~s(x),dati,sem.method="gam",ineffDecrease=FALSE,var.method="mm")
# }
# NOT RUN {
plot(x,y)
curve(2+30*x+5*x^2,add=TRUE)
points(sort(x),o$fitted[order(x)],col=3,type="l")
#production frontier
fy<- 2+30*x-5*x^2
y <- fy + v - u
dati<-data.frame(y,x)
#first-step: gam, second-step: fan
o<-semsfa(y~s(x),dati,sem.method="gam",ineffDecrease=TRUE)
plot(x,y)
curve(2+30*x-5*x^2,add=TRUE)
points(sort(x),o$fitted[order(x)],col=3,type="l")
# }
Run the code above in your browser using DataLab