frame_ald_weight: Weighting Matrix of Quantile regression using Asymmetric...

Description Usage Arguments Details Author(s) Examples

View source: R/frame_ald_weight.R

Description

This function calulate the weighting matrix

Usage

1
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}β^{(k)}_{p}|/σ. Hence, u_i(θ^{k})=\varepsilon_{-1i}(θ^{(k)}) can be interpreted as a type of weight for ith case in the estimates of β_{(k)^p}, which tends to be small for outlying observations.

Author(s)

Wenjing Wang wenjingwangr@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

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