quokar (version 0.1.0)

frame_ald: Density function plot of the error term for quantile regression model using asymmetric Laplace distribution

Description

density function plot of the error term on each quantile

Usage

frame_ald(y, x, tau, smooth, error, iter)

Arguments

y

vector, dependent variable of quantile regression

x

matrix, matrix consisted independent variables of quantie regression

tau

sigle number or vector, quantiles

smooth

sigular, default is 100, the larger the smoother of density function

error

the convergence maximum error

iter

maximum iterations of the EM algorithm

Value

dataframe to plot the density function of the error term

Examples

Run this code
# NOT RUN {
library(ggplot2)
data(ais)
x <- matrix(ais$LBM, ncol = 1)
y <- ais$BMI
tau = c(0.1, 0.5, 0.9)
ald_data <- frame_ald(y, x, tau, smooth = 10, error = 1e-6,
                  iter = 2000)
ggplot(ald_data) +
   geom_line(aes(x = r, y = d, group = obs, colour = tau_flag)) +
   facet_wrap(~tau_flag, ncol = 1, scale = "free") +
   xlab('') +
   ylab('Asymmetric Laplace Distribution Density Function')

# }

Run the code above in your browser using DataLab