Learn R Programming

npbr (version 1.0)

quad_spline_est: Constrained quadratic spline frontiers

Description

This function is an implementation of the constrained quadratic spline smoother proposed by Daouia, Noh and Park (2013).

Usage

quad_spline_est(xtab, ytab, x, kn = ceiling((length(xtab))^(1/4)), cv = 0, 
all.dea = FALSE)

Arguments

xtab
numeric vectors containing the observed inputs $x_1,\ldots,x_n$
ytab
numeric vectors of the same length as xtab containing the observed outputs $y_1,\ldots,y_n$
x
a numeric vector of evaluation points in which the estimator is to be computed
kn
an integer specifying the number of knots at which the spline estimate will be computed
cv
an integer equal to 0 (under the monotonicity constraint) or 1 (under simultaneous monotonicity and concavity constraints)
all.dea
a boolean

Value

  • Returns a vector of numeric with the same length than x

Details

Let $a$ and $b$ be, respectively, the minimum and maximum of the design points $x_1,\ldots,x_n$. Denote a partition of $[a,b]$ by $a=t_0e.g., Schumaker (2007)). When the true frontier $\varphi(x)$ is known or required to be monotone nondecreasing (option cv=0), its constrained quadratic spline estimate is defined by $\hat\varphi_n(x)=\pi(x)^T \hat\alpha$, where $\hat\alpha$ minimizes $$\int_{0}^1\pi(x)^T \alpha \,dx = \sum_{j=1}^N \alpha_j \int_{0}^1\pi_j(x) \,dx$$ over $\alpha\in\R^N$ subject to the envelopment and monotonicity constraints $\pi(x_i)^T \alpha\geq y_i$, $i=1,\ldots,n$, and $\pi'(t_j)^T \alpha\geq 0$, $j=0,1,\ldots,k_n$, with $\pi'$ being the derivative of $\pi$. Considering the special connection of the spline smoother $\hat \varphi_n$ with the traditional FDH frontier $\varphi_n$ (see the function dea_est), Daouia et al. (2013) propose an easy way of choosing the knot mesh. Let $(\mathcal{X}_1,\mathcal{Y}_1),\ldots, (\mathcal{X}_\mathcal{N},\mathcal{Y}_\mathcal{N})$ be the observations $(x_i,y_i)$ lying on the FDH boundary (i.e. $y_i=\varphi_n(x_i)$). The basic idea is to pick out a set of knots equally spaced in percentile ranks among the $\mathcal{N}$ FDH points $(\mathcal{X}_{\ell},\mathcal{Y}_{\ell})$ by taking $t_j = {\mathcal{X}_{[j \mathcal{N}/k_n]}}$, the $j/k_n$th quantile of the values of $\mathcal{X}_{\ell}$ for $j=1,\ldots,k_n-1$. The choice of the number of internal knots is then viewed as model selection through the minimization of the AIC and BIC information criteria (see the function quad_spline_est_kn). When the monotone boundary $\varphi(x)$ is also believed to be concave (option cv=1), its constrained fit is defined as $\hat\varphi^{\star}_n(x)=\pi(x)^T \hat\alpha^{\star}$, where $\hat\alpha^{\star}\in\R^N$ minimizes the same objective function as $\hat\alpha$ subject to the same envelopment and monotonicity constraints and the additional concavity constraints $\pi''(t^*_j)^T \alpha\leq 0$, $j=1,\ldots,k_n,$ where $\pi''$ is the constant second derivative of $\pi$ on each inter-knot interval and $t^*_j$ is the midpoint of $(t_{j-1},t_j]$. Regarding the choice of knots, the same scheme as for $\hat\varphi_n$ can be applied by replacing the FDH points $(\mathcal{X}_1,\mathcal{Y}_1),\ldots, (\mathcal{X}_\mathcal{N},\mathcal{Y}_\mathcal{N})$ with the DEA points $(\mathcal{X}^*_1,\mathcal{Y}^*_1),\ldots, (\mathcal{X}^*_\mathcal{M},\mathcal{Y}^*_\mathcal{M})$, that is, the observations $(x_i,y_i)$ lying on the piecewise linear DEA frontier (see the function dea_est). Alternatively, the strategy of just using all the DEA points as knots is also working quite well for datasets of modest size as shown in Daouia et al. (2013). In this case, the user has to choose the option all.dea=TRUE.

References

Daouia, A., Noh, H. and Park, B.U. (2013). Data Envelope Fitting with Constrained Polynomial splines. TSE Working Paper, http://www.tse-fr.eu/images/doc/wp/etrie/wp_tse_449.pdf. Schumaker, L.L. (2007). Spline Functions: Basic Theory, 3rd edition, Cambridge University Press.

See Also

quad_spline_est_kn

Examples

Run this code
data("green")
plot(log(OUTPUT)~log(COST), data=green)
x <- seq(min(log(green$COST)), max(log(green$COST)), length.out=1001)
# under the separate monotonicity constraint with the knots mesh being
# obtained via AIC and BIC criteria
lines(x, quad_spline_est(log(green$COST), log(green$OUTPUT), x, kn=9, cv=0),
lty=1, col="red")   
lines(x, quad_spline_est(log(green$COST), log(green$OUTPUT), x, kn=6, cv=0),
lty=1, col="blue")
# under both monotonicity and concavity constraints
# with the same optimal number of knots obtained using AIC and BIC criteria
lines(x, quad_spline_est(log(green$COST), log(green$OUTPUT), x, kn=1, cv=1), 
lty=2)   
legend("topleft",legend=c("monotonicity (kn=9)", "monotonicity (kn=6)",
"monotonicity + concavity (kn=1)"), col=c("red","blue","black"), lty=c(1,1,2))

Run the code above in your browser using DataLab