Learn R Programming

LorenzRegression (version 2.2.0)

Rearrangement.estimation: Estimates a monotonic regression curve via Chernozhukov et al (2009)

Description

Rearrangement.estimation estimates the increasing link function of a single index model via the methodology proposed in Chernozhukov et al (2009).

Usage

Rearrangement.estimation(
  y,
  index,
  t = index,
  weights = NULL,
  method = "loess",
  ...
)

Value

A list with the following components

t

the points over which the estimation has been undertaken.

H

the estimated link function evaluated at t.

Arguments

y

The response variable.

index

The estimated index. The user may obtain it using function Lorenz.Reg.

t

A vector of points over which the link function \(H(.)\) should be estimated. Default is the estimated index.

weights

A vector of sample weights. By default, each observation is given the same weight.

method

Either a character string specifying a smoothing method (e.g., "loess", the default), or a list containing two elements:

  • fit_fun: a function used to fit the model, typically taking arguments y, x, and optionally weights, and returning a fitted object.

  • predict_fun: a function to generate predictions from the fitted object. It must accept the fitted object and an argument newdata.

The specification of a custom method is illustrated in the Examples section. If a character string is provided, a predict method must exist for that function (e.g., predict.loess). If weights are provided but unsupported by the fit function, a warning is issued and the weights are ignored.

...

Additional arguments passed to the fit function defined by method.

Details

A first estimator of the link function, neglecting the assumption of monotonicity, is obtained using the procedure chosen via method. The final estimator is obtained through the rearrangement operation explained in Chernozhukov et al (2009). This operation is carried out with function rearrangement from package Rearrangement.

References

Chernozhukov, V., I. Fernández-Val, and A. Galichon (2009). Improving Point and Interval Estimators of Monotone Functions by Rearrangement. Biometrika 96 (3). 559–75.

See Also

Lorenz.Reg, rearrangement

Examples

Run this code
data(Data.Incomes)
PLR <- Lorenz.Reg(Income ~ ., data = Data.Incomes,
                  penalty = "SCAD", eps = 0.01)
y <- PLR$y
index <- predict(PLR)
# Default method where the first step is obtained with loess()
Rearrangement.estimation(y = y, index = index, method = "loess")
# Custom method, where the first step is obtained with ksmooth()
# ksmooth() lacks from a separation between fitting and predicting interfaces
ksmooth_method <- list(
  fit_fun = function(y, x, ...) {
    list(y = y, x = x, args = list(...))
  },
  predict_fun = function(fit, newdata) {
    if(missing(newdata)){
      x.points <- fit$x
    } else {
      x.points <- newdata[,1]
    }
    o <- order(order(x.points))
    yhat <- do.call(ksmooth, c(list(x = fit$x, y = fit$y, x.points = x.points), fit$args))$y
    yhat[o]
  }
)
Rearrangement.estimation(y = y, index = index, method = ksmooth_method, bandwidth = 0.1)

Run the code above in your browser using DataLab