# frame_fn_path: Visualization of the fitting path of quantile regression:... In quokar: Quantile Regression Outlier Diagnostics with K Left Out Analysis

## Description

observations used in quantile regression fitting

min_{b \in R^{p}}∑_{i=1}^{n}ρ_{τ}(y_i-x_{i}^{'}b)

where ρ_{τ}(r)=r[τ-I(r<0)]$for$τ \in (0,1). This yields the modified linear program

min(τ e^{'}u+(1-τ)e^{'}v|y=Xb+u-v,(u,v) \in R_{+}^{2n})

Adding slack variables, s, satisfying the constrains a+s=e, we obtain the barrier function

B(a, s, u) = y^{'}a+μ ∑_{i=1}^{n}(loga_{i}+logs_{i})

which should be maximized subject to the constrains X^{'}a=(1-τ)X^{'}e and a+s=e. The Newton step δ_{a} solving

max{y^{'}δ_{a}+μ δ^{'}_{a}(A^{-1}-S^{-1})e- \frac{1}{2}μ δ_{a}^{'}(A^{-2}+S^{-2})δ_{a}}

subject to X{'}δ_{a}=0, satisfies

y+μ(A^{-1}-S^{-1})e-μ(A^{-2}+S^{-2})δ_{a}=Xb

for some b\in R^{p}, and δ_{a} such that X^{'}δ_{a}=0. Using the constraint, we can solve explicitly for the vector b,

b=(X^{'}WX)^{-1}X^{'}W[y+μ(A^{-1}-S^{-1})e]

where W=(A^{-2}+S^{-2})^{-1}. This is a form of the primal log barrier algorithm described above. Setting μ=0 in each step yields an affine scaling variant of the algorithm. The basic linear algebra of each iteration is essentially unchanged, only the form of the diagonal weighting matrix W has chagned.

## Usage

 1 frame_fn_path(object, tau) 

## Arguments

 object quantile regression model using interior point method tau quantile

## Details

This function used to illustrate the fitting process of quantile regression using interior point method. Koenker and Bassett(1978) introduced asymmetric weight on positive and negative residuals, and solves the slightly modified l1-problem.

## Value

The fitting path of quantile regression model using interior point method

## Author(s)

Wenjing Wang wenjingwangr@gmail.com

## References

Portnoy S, Koenker R. The Gaussian hare and the Laplacian tortoise: computability of squared-error versus absolute-error estimators. Statistical Science, 1997, 12(4): 279-300.

## Examples

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ## Not run: library(ggplot2) library(quantreg) data(ais) tau <- c(0.1, 0.5, 0.9) object <-rq(BMI ~ LBM + Ht, tau = tau, data = ais, method = 'fn') frame_fn <- frame_fn_path(object, tau) #plot the path frame_fn1 <- frame_fn[[1]] ggplot(frame_fn1, aes(x = value, y = objective)) + geom_point() + geom_path() + facet_wrap(~ variable, scale = 'free') ## End(Not run) 

quokar documentation built on May 2, 2019, 6:39 a.m.