# rearrange

0th

Percentile

##### Rearrangement

Monotonize a step function by rearrangement

Keywords
regression
##### Usage
rearrange(f,xmin,xmax)
##### Arguments
f

object of class stepfun

xmin

minimum of the support of the rearranged f

xmax

maximum of the support of the rearranged f

##### Details

Given a stepfunction $Q(u)$, not necessarily monotone, let $F(y) = \int \{ Q(u) \le y \} du$ denote the associated cdf obtained by randomly evaluating $Q$ at $U \sim U[0,1]$. The rearranged version of $Q$ is $\tilde Q (u) = \inf \{ u: F(y) \ge u \}. The rearranged function inherits the right or left continuity of original stepfunction.$

##### Value

Produces transformed stepfunction that is monotonic increasing.

##### References

Chernozhukov, V., I. Fernandez-Val, and A. Galichon, (2006) Quantile and Probability Curves without Crossing, Econometrica, forthcoming.

Chernozhukov, V., I. Fernandez-Val, and A. Galichon, (2009) Improving Estimates of Monotone Functions by Rearrangement, Biometrika, 96, 559--575.

Hardy, G.H., J.E. Littlewood, and G. Polya (1934) Inequalities, Cambridge U. Press.

rq rearrange

• rearrange
##### Examples
# NOT RUN {
data(engel)
z <- rq(foodexp ~ income, tau = -1,data =engel)
zp <- predict(z,newdata=list(income=quantile(engel\$income,.03)),stepfun = TRUE)
plot(zp,do.points = FALSE, xlab = expression(tau),
ylab = expression(Q ( tau )), main="Engel Food Expenditure Quantiles")