quokar (version 0.1.0)

frame_ald_weight: Weighting Matrix of Quantile regression using Asymmetric Laplace Distrubtion

Description

This function calulate the weighting matrix

Usage

frame_ald_weight(y, x, tau, error, iter)

Arguments

y

dependent variable of quantile regression

x

design matrix of quantile regression

tau

quantile must be a scaler

error

The EM algorithm accuracy of error used in MLE estimation

iter

The iteration frequancy for EM algorithm used in MLE estimation

Details

In the estimation procedure in EM algorithm, we can see that \(\varepsilon\) is inversely proportional to \(d_i = |y_i-x^{'}_{i}\beta^{(k)}_{p}|/\sigma\). Hence, \(u_i(\theta^{k})=\varepsilon_{-1i}(\theta^{(k)})\) can be interpreted as a type of weight for \(i\)th case in the estimates of \(\beta_{(k)^p}\), which tends to be small for outlying observations.

Examples

Run this code
# NOT RUN {
library(ggplot2)
library(dplyr)
library(ALDqr)
data(ais)
y <- ais$BMI
x <- cbind(1, ais$LBM)
tau <-  c(0.1, 0.5, 0.9)
error <- 1e-06
iter <- 100
weights <- frame_ald_weight(y, x, tau, error, iter)
weights

# }

Run the code above in your browser using DataLab