quokar (version 0.1.0)

frame_nlrq: Visualization of fitting process of non-linear quantile regression: interior point algorithm

Description

This function explore the fitting process of nonlinear quantile regression

Usage

frame_nlrq(formula, data, tau, start)

Arguments

formula

non-linear quantile regression model

data

data frame

tau

quantiles

start

the initial value of all parameters to estimate, must be a list

Value

Weighted observations in non-linear quantile regression model fitting using interior algorithm

Details

To extentd the linear programming method to the case of non-linear response functions, Koenker & Park(1996) considered the nonlinear \(l_{1}\) problem $$min_{t\in R^{p}} \sum{|f_{i}(t)|}$$ where, for example, $$f_{i}(t)=y_i-f_{0}(x_i, t)$$ As noted by El Attar et al(1979) a necessary condition for \(t*\) to solve \(min_{t\in R^{p}} \sum{|f_{i}(t)|}\) is that there exists a vector \(d \in [-1, 1]^n\) such that $$J(t*)^{'}d = 0$$ $$f(t*)^{'}d = \sum{|f_i(t*)|}$$ where \(f(t)=(f_i(t))\) and \(J(t)=(\partial f_i(t)/\partial t_j)\). Thus, as proposed by Osborne and Watson(1971), one approach to solving \(min_{t\in R^{p}} \sum{|f_{i}(t)|}\) is to solve a succession of linearized \(l_1\) problems minimizing $$\sum |f_{i}(t)-J_{i}(t)^{'}\delta|$$

Examples

Run this code
# NOT RUN {
library(tidyr)
library(ggplot2)
library(purrr)
x <- rep(1:25, 20)
y <- SSlogis(x, 10, 12, 2) * rnorm(500, 1, 0.1)
Dat <- data.frame(x = x, y = y)
formula <- y ~ SSlogis(x, Aysm, mid, scal)
nlrq_m <- frame_nlrq(formula, data = Dat, tau = c(0.1, 0.5, 0.9))
weights <- nlrq_m$weights
m <- data.frame(Dat, weights)
m_f <- m %>% gather(tau_flag, value, -x, -y)
ggplot(m_f, aes(x = x, y = y)) +
  geom_point(aes(size = value, colour = tau_flag)) +
  facet_wrap(~tau_flag)
# }

Run the code above in your browser using DataLab