Learn R Programming

npbr (version 1.8)

quad_spline_est: Quadratic spline frontiers

Description

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

Usage

quad_spline_est(xtab, ytab, x, kn = ceiling((length(xtab))^(1/4)), method= "u", 
 all.dea = FALSE, control = list("tm_limit" = 700))

Value

Returns a numeric vector with the same length as x. Returns a vector of NA if no solution has been found by the solver (GLPK).

Arguments

xtab

a numeric vector containing the observed inputs \(x_1,\ldots,x_n\).

ytab

a numeric vector 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 inter-knot segments used in the computation of the spline estimate.

method

a character equal to "u" (unconstrained estimator), "m" (under the monotonicity constraint) or "mc" (under simultaneous monotonicity and concavity constraints).

all.dea

a boolean.

control

a list of parameters to the GLPK solver. See *Details* of help(Rglpk_solve_LP).

Author

Hohsuk Noh.

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_0<t_1<\cdots<t_{k_n}=b\) (see below the selection process). Let \(N=k_n+1\) and \(\pi(x)=(\pi_1(x),\ldots,\pi_N(x))^T\) be the vector of normalized B-splines of order 3 based on the knot mesh \(\{t_j\}\) (see, e.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. (2015) 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_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. (2016). In this case, the user has to choose the option all.dea=TRUE.

References

Daouia, A., Noh, H. and Park, B.U. (2016). Data Envelope fitting with constrained polynomial splines. Journal of the Royal Statistical Society: Series B, 78(1), 3-30. doi:10.1111/rssb.12098.

Schumaker, L.L. (2007). Spline Functions: Basic Theory, 3rd edition, Cambridge University Press.

See Also

quad_spline_kn

Examples

Run this code
if (FALSE) {
data("green")
x.green <- seq(min(log(green$COST)), max(log(green$COST)), length.out=101)
# 1. Unconstrained quadratic spline fits
# Optimal number of inter-knot segments via the BIC criterion
(kn.bic.green.u<-quad_spline_kn(log(green$COST), 
 log(green$OUTPUT), method="u", type="BIC"))
# Unconstrained spline estimate
y.quad.green.u<-quad_spline_est(log(green$COST), 
 log(green$OUTPUT), x.green, kn=kn.bic.green.u, method="u")

# 2. Monotonicity constraint
# Optimal number of inter-knot segments via the BIC criterion
(kn.bic.green.m<-quad_spline_kn(log(green$COST), 
 log(green$OUTPUT), method="m", type="BIC"))
# Monotonic splines estimate
y.quad.green.m<-quad_spline_est(log(green$COST), 
 log(green$OUTPUT), x.green, kn=kn.bic.green.m, method="m") 
   
# 3. Monotonicity and Concavity constraints
# Optimal number of inter-knot segments via the BIC criterion
(kn.bic.green.mc<-quad_spline_kn(log(green$COST), 
 log(green$OUTPUT), method="mc", type="BIC"))
# Monotonic/Concave splines estimate 
y.quad.green.mc<-quad_spline_est(log(green$COST), 
 log(green$OUTPUT), x.green, kn=kn.bic.green.mc, 
 method="mc", all.dea=TRUE)

# Representation 
plot(x.green, y.quad.green.u, lty=1, lwd=4, col="green", 
 type="l", xlab="log(COST)", ylab="log(OUTPUT)")   
lines(x.green, y.quad.green.m, lty=2, lwd=4, col="cyan")
lines(x.green, y.quad.green.mc, lwd=4, lty=3, col="magenta")   
points(log(OUTPUT)~log(COST), data=green)
legend("topleft", col=c("green","cyan","magenta"), 
lty=c(1,2,3), legend=c("unconstrained", "monotone", 
 "monotone + concave"), lwd=4, cex=0.8) 
}   

Run the code above in your browser using DataLab