# Test of Monotonicity and Convexity by Splines

##### Posted on Apr 23, 2022

Consider quadratic B-spline basis functions for the test of monotonicity and cubic B-splines for the test of convexity

propose to test $H_1:f’(x)\ge 0$ vs $H_2$

Define the $m\times k$ matrix $S$ of slopes at the knots by $S_{jl} = B’_{jp}(t_l)$. If the spline function

$g(x) = \sum_{j=1}^m b_jB_{jp}(x)$

is non-decreasing, then $S^Tb\ge 0$. For quadratic splines, it is a sufficient and necessary condition.

Similarly, if $T$ is the matrix of the second derivatives of the basis functions at the knots, that is, $T_{jl}=B_{jp}’‘(t_l)$, then for convex spline function, we have $T^Tb\ge 0$. For cubic (and lower order) regression splines, it is a sufficient and necessary condition.

The $\hat b^\star$ that minimizes under the monotonicity constraints (or the convexity constraints) is found using standard quadratic programming routines. Briefly, the constrained solution is a least-squares projection onto a linear space of (possibly) smaller dimension.

• obtain the unconstrained minimizer and determine the minimum of the slopes at the knots, and denote it as $s_\min$
• if $s_\min$ is non-negative, then do not reject $H_1$
• otherwise, estimate the distribution of the minimum slope under the null hypothesis
• if $s_\min$ is smaller than the estimated percentile, then reject

propose two approaches for obtaining the null distribution

• the first approach is an analytic method which requires normality assumption or using normal approaximation
• the second method is resampling-based

## Extension to partial linear models

$y_i = f(x_i) + z_i^t\gamma + \sigma\varepsilon_i$

The code is available at https://www.stat.colostate.edu/~meyer/testmonotonicity.R

Published in categories Note