Title: | Semiparametric Estimation of Stochastic Frontier Models |
---|---|
Description: | Semiparametric Estimation of Stochastic Frontier Models following a two step procedure: in the first step semiparametric or nonparametric regression techniques are used to relax parametric restrictions of the functional form representing technology and in the second step variance parameters are obtained by pseudolikelihood estimators or by method of moments. |
Authors: | Giancarlo Ferrara and Francesco Vidoli |
Maintainer: | Giancarlo Ferrara <[email protected]> |
License: | GPL |
Version: | 1.1 |
Built: | 2024-12-22 06:49:40 UTC |
Source: | CRAN |
Semiparametric Estimation of Stochastic Frontier Models following the two step procedure proposed by Fan et al (1996) and further developed by Vidoli and Ferrara (2015) and Ferrara and Vidoli (2017). 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. Monotonicity restrinctions can be imposed by means of P-splines.
Giancarlo Ferrara, Francesco Vidoli
Maintainer: Giancarlo Ferrara <[email protected]>
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
Ferrara, G., Vidoli, F., 2017. Semiparametric stochastic frontier models: A generalized additive model approach. European Journal of Operational Research, 258:761-777.
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., 2015. Analyzing Italian citrus sector by semi-nonparametric frontier efficiency models. Empirical Economics, 49:641-658
This function calculates and returns efficiency estimates from semiparametric stochastic frontier models estimated with semsfa()
.
efficiencies.semsfa(semobj, log.output = TRUE, ...)
efficiencies.semsfa(semobj, log.output = TRUE, ...)
semobj |
a stochastic frontier model object returned by |
log.output |
logical. Is the dependent variable logged? |
... |
further arguments to the summary method are currently ignored |
The estimation of the individual efficiency score for a particular point on a production frontier might be obtained from the Jondrow et al. (1982) procedure. Defining:
it can be shown that:
We can use this distribution to obtain point previsions of trought the mean of the conditional distribution:
where and
represent the standard Normal density and cumulative distribution function, respectively; alternative formulas for cost frontier models are easy to get (please see Kumbhakar and Lovell, 2000).
If the response variable is measured in logs, a point estimate of the efficiency is then provided by ; otherwise,
(fitt-u)/fitt
where fitt
is the estimated output evaluated at the frontier, given the inputs.
An object of class semsfa
containing the following additional results:
u |
the prediction of the individual efficiency score |
efficiencies |
point estimate of the efficiency |
Giancarlo Ferrara and Francesco Vidoli
Jondrow, J., Lovell, C.A.K., Materov, I.S., Schmidt, P., 1982. On the estimation of technical inefficiency in stochastic frontier production models. Journal of Econometrics 19, 233-238.
Kumbhakar, S.C., Lovell, C.A.K., 2000. Stochastic Frontier Analysis. Cambridge University Press, New York.
semsfa
, summary.semsfa
, plot.semsfa
.
set.seed(0) n<-200 #generate data x<- runif(n, 1, 2) fy<- 2+30*x-5*x^2 v<- rnorm(n, 0, 1) u<- abs(rnorm(n,0,2.5)) #production frontier y <- fy + v - u dati<-data.frame(y,x) #first-step: gam, second-step: fan (default) o<-semsfa(y~s(x),dati,sem.method="gam") #calculate efficiencies a<-efficiencies.semsfa(o)
set.seed(0) n<-200 #generate data x<- runif(n, 1, 2) fy<- 2+30*x-5*x^2 v<- rnorm(n, 0, 1) u<- abs(rnorm(n,0,2.5)) #production frontier y <- fy + v - u dati<-data.frame(y,x) #first-step: gam, second-step: fan (default) o<-semsfa(y~s(x),dati,sem.method="gam") #calculate efficiencies a<-efficiencies.semsfa(o)
parameterPseudolikelihood estimator of the parameter
fan(lambda_fan, resp, Ey, ineffD)
fan(lambda_fan, resp, Ey, ineffD)
lambda_fan |
the |
resp |
the single response variable Y observed |
Ey |
the conditional expectation estimate obtained in the first step of the algorithm |
ineffD |
logical: TRUE for estimating a production function, FALSE for estimating a cost function; this is done for usage compatibility with frontier package |
Estimated parameter
Internal usage only
Giancarlo Ferrara and Francesco Vidoli
Fan, Y., Li, Q., Weersink, A., 1996. Semiparametric estimation of stochastic production frontier models. Journal of Business & Economic Statistics 14:460-468
This function plots the semiparametric/nonparametric intermediate model object estimated in the first step of the algorithm and, if efficiencies.semsfa()
is esecuted, individual point estimate of the efficiency.
## S3 method for class 'semsfa' plot(x, g.type, mod, ...)
## S3 method for class 'semsfa' plot(x, g.type, mod, ...)
x |
a |
g.type |
a character string indicating the type of plot. Possible values are: "reg" to plot the semiparametric/nonparametric model object estimated in the first step from |
mod |
a character string indicating the plot style for g.type="eff": "hist" for histogram and "dens" for density plot |
... |
further arguments passed to plot.default. |
The function simply generates plots.
Giancarlo Ferrara and Francesco Vidoli
set.seed(0) n<-200 #generate data x<- runif(n, 1, 2) fy<- 2+30*x-5*x^2 v<- rnorm(n, 0, 1) u<- abs(rnorm(n,0,2.5)) #production frontier y <- fy + v - u dati<-data.frame(y,x) #first-step: gam, second-step: fan (default) o<-semsfa(y~s(x),dati,sem.method="gam") #the following plot will be like that generated by plot.gam plot(o,g.type="reg") #adding a covariate z<- runif(n, 1, 2) dati$z<-z #first-step: kernel, second-step: fan (default) o<-semsfa(y~x+z,dati,sem.method="kernel") #the plot will be like that generated by a plot.npreg ## Not run: plot(o,g.type="reg") #calculate efficiencies ... a<-efficiencies.semsfa(o) plot(a,g.type="eff",mod="dens") #adding further parameters as for plot.default: col, main, xlim, ... plot(a,g.type="eff",mod="dens",col=2,main="Density Efficiency",xlim=c(0,1),xlab="Efficiency")
set.seed(0) n<-200 #generate data x<- runif(n, 1, 2) fy<- 2+30*x-5*x^2 v<- rnorm(n, 0, 1) u<- abs(rnorm(n,0,2.5)) #production frontier y <- fy + v - u dati<-data.frame(y,x) #first-step: gam, second-step: fan (default) o<-semsfa(y~s(x),dati,sem.method="gam") #the following plot will be like that generated by plot.gam plot(o,g.type="reg") #adding a covariate z<- runif(n, 1, 2) dati$z<-z #first-step: kernel, second-step: fan (default) o<-semsfa(y~x+z,dati,sem.method="kernel") #the plot will be like that generated by a plot.npreg ## Not run: plot(o,g.type="reg") #calculate efficiencies ... a<-efficiencies.semsfa(o) plot(a,g.type="eff",mod="dens") #adding further parameters as for plot.default: col, main, xlim, ... plot(a,g.type="eff",mod="dens",col=2,main="Density Efficiency",xlim=c(0,1),xlab="Efficiency")
Semiparametric Estimation of Stochastic Frontier Models following the two step procedure proposed by Fan et al (1996) and further developed by Vidoli and Ferrara (2015) and Ferrara and Vidoli (2017). 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. Monotonicity restrinctions can be imposed by means of P-splines.
semsfa(formula, data = list(), sem.method = "gam", var.method = "fan", ineffDecrease=TRUE, tol = 1e-05, n.boot=0,...)
semsfa(formula, data = list(), sem.method = "gam", var.method = "fan", ineffDecrease=TRUE, tol = 1e-05, n.boot=0,...)
formula |
an object of class "formula": a symbolic description of the model to be fitted. The details of model specification are given under 'Details' |
data |
a data frame containing the variables in the model |
sem.method |
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), "gam.mono" for monotone gam, "kernel" or "loess" |
var.method |
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 |
ineffDecrease |
logical: TRUE (default) for estimating a production function, FALSE for estimating a cost function; this is done for usage compatibility with frontier package |
tol |
numeric. Convergence tolerance for pseudolikelihood estimators of variance parameters of the composed error term |
n.boot |
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 |
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:
where is the single output of unit
,
is the vector of inputs,
defines a production frontier relationship between inputs X and the single output Y. In following common practice, we assume that
and
are each identically independently distributed (
) with
and
distributed half-normally on the non-negative part of the real number line:
; furthermore, the probability density function of the composite disturbance can be rewritten in terms of
and
for the estimation algorithm.
To overcome drawbacks due to the specification of a particular production function
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
and
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 .
Vidoli and Ferrara (2015) 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="gam.mono" invokes gamlss() from gamlss to impose monotonicity restrictions on inputs;
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.
semsfa()
returns an object of class semsfa
.
An semsfa
object is a list containing the following components:
formula |
the formula used |
y |
the response variable used as specified in |
data |
the data frame used |
call |
the matched call |
sem.method |
the type of semiparametric or nonparametric regression as given by sem.method ("gam", "gam.mono", "kernel", "loess") |
var.method |
the type of error component estimator ("fan", "mm") |
ineffDecrease |
logical, as given by ineffDecrease |
reg |
an object of class "gam", "gamlss" (monotone gam), "np"(kernel) or "loess" depending on sem.method |
reg.fitted |
fitted values on the "mean" frontier (semiparametric/non parametric regression) |
regkewness |
asymmetry index calculated on residuals obtained in the first step |
lambda |
|
sigma |
|
fitted |
fitted values on the frontier |
tol |
convergence tolerance for pseudolikelihood estimators used in optimize |
residual.df |
residual degree of freedom of the model |
bic |
'Bayesian Information Criterion' according to the formula |
n.boot |
number of bootstrap replicates used (default n.boot=0) |
boot.mat |
a matrix containing |
b.se |
boostrapped standard errors for |
The function summary
(i.e. summary.semsfa
) can be used to obtain a summary of the results, efficiencies.semsfa
to calculate efficiency scores and plot
(i.e. plot.semsfa
) to graph efficiency previsions and regression components (i.e. the first step).
You must take the natural logarithm of the response variable before fitting a stochastic frontier production or cost model.
Giancarlo Ferrara
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
Ferrara, G., Vidoli, F., 2017. Semiparametric stochastic frontier models: A generalized additive model approach. European Journal of Operational Research, 258:761-777.
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., 2015. Analyzing Italian citrus sector by semi-nonparametric frontier efficiency models. Empirical Economics, 49:641-658
summary.semsfa
, efficiencies.semsfa
, plot.semsfa
.
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") 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") #imposing monotonicity restrictions on inputs set.seed(25) n=150 x=runif(n,0,3) u=abs(rnorm(n,0,1)) v=rnorm(n,0,.75*((pi-2)/pi)) #production frontier fy<-10-5*exp(-x) y <- fy+v-u dati<-data.frame(y,x) #first-step: monotone gam, second-step: fan o<-semsfa(y~pbm(x,mono="up"),sem.method = "gam.mono",dati) plot(x,y) curve(10-5*exp(-x),add=TRUE) points(sort(x),o$fitted[order(x)],col=3,type="l")
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") 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") #imposing monotonicity restrictions on inputs set.seed(25) n=150 x=runif(n,0,3) u=abs(rnorm(n,0,1)) v=rnorm(n,0,.75*((pi-2)/pi)) #production frontier fy<-10-5*exp(-x) y <- fy+v-u dati<-data.frame(y,x) #first-step: monotone gam, second-step: fan o<-semsfa(y~pbm(x,mono="up"),sem.method = "gam.mono",dati) plot(x,y) curve(10-5*exp(-x),add=TRUE) points(sort(x),o$fitted[order(x)],col=3,type="l")
semsfa
objectCreate and print summary results of a stochastic frontier model object returned by semsfa()
with regard to the "CONDITIONAL EXPECTATION ESTIMATE" of the first step and to the "VARIANCE COMPONENTS ESTIMATE" of the compound error.
## S3 method for class 'semsfa' summary(object, ...)
## S3 method for class 'semsfa' summary(object, ...)
object |
an |
... |
further arguments to the summary method are currently ignored |
Please note that if bootstrap is carried out the -statistic is not reliable for testing the statistical significance of
and
, because these parameters are censored and cannot follow a
-distribution.
We suggest to compare the BIC of the semiparametric estimated model with the base model.
summary.semsfa
returns the summary of an object returned by semsfa()
with few modifications if bootstrap is carried out:
b.t |
|
b.pv |
|
summary
returns the same result if applied to an object created with semsfa
or efficiencies.semsfa
Giancarlo Ferrara and Francesco Vidoli
#generate data set.seed(0) n<-200 x<- runif(n, 1, 2) fy<- 2+30*x-5*x^2 v<- rnorm(n, 0, 1) u<- abs(rnorm(n,0,2.5)) #production frontier y <- fy + v - u dati<-data.frame(y,x) #first-step: gam, second-step: fan (default) #without bootstrap o<-semsfa(y~s(x),dati,sem.method="gam") summary(o) # ... with bootstrap o<-semsfa(y~s(x),dati,sem.method="gam",n.boot=100) summary(o)
#generate data set.seed(0) n<-200 x<- runif(n, 1, 2) fy<- 2+30*x-5*x^2 v<- rnorm(n, 0, 1) u<- abs(rnorm(n,0,2.5)) #production frontier y <- fy + v - u dati<-data.frame(y,x) #first-step: gam, second-step: fan (default) #without bootstrap o<-semsfa(y~s(x),dati,sem.method="gam") summary(o) # ... with bootstrap o<-semsfa(y~s(x),dati,sem.method="gam",n.boot=100) summary(o)