SemiQRegAND: Semiparametric quantile regression in quantile-based...

Description Usage Arguments Value References Examples

View source: R/SemiRegAND.R

Description

The local polynomial technique is used to estimate location and scale function of the quantile-based asymmetric normal distribution discussed in Gijbels et al. (2019c). The semiparametric quantile estimation technique is used to estimate βth conditional quantile function in quantile-based asymmetric normal distributional setting discussed in Gijbels et al. (2019b) and Gijbels et al. (2019c).

Usage

1
2
3
4
5
locpolAND_x0(x, y, p1 = 1, p2 = 1, h, alpha = 0.5, x0, tol = 1e-08)

locpolAND(x, y, p1, p2, h, alpha, m = 101)

SemiQRegAND(beta, x, y, p1 = 1, p2 = 1, h, alpha = NULL, m = 101)

Arguments

x

This a conditioning covariate.

y

The is a response variable.

p1

This is the order of the Taylor expansion for the location function (i.e.,μ(X)) in local polynomial fitting technique. The default value is 1.

p2

This is the order of the Taylor expansion for the log of scale function (i.e., \ln[φ(X)]) in local polynomial fitting technique. The default value is 1.

h

This is the bandwidth parameter h.

alpha

This is the index parameter α of the quantile-based asymmetric normal density. The default value is 0.5 in the codes code locpolAND_x0 and code locpolAND. The default value of α is NULL in the code SemiQRegAND. In this case, α will be estimated based on the residuals from local linear mean regression.

x0

This is a grid-point x_0 at which the function is to be estimated.

tol

the desired accuracy. See details in optimize.

m

This is the number of grid points at which the functions are to be evaluated. The default value is 101.

beta

This is a specific probability for estimating βth quantile function.

Value

The code locpolAND_x0 provides the realized value of the local maximum likelihood estimator of \widehat{θ}_{rj}(x_0) for (r\in \{1,2\}; j=1,2,...,p_r) with the estimated approximate asymptotic bias and variance at the grind point x_0 discussed in Gijbels et al. (2019c).

The code locpolAND provides the realized value of the local maximum likelihood estimator of \widehat{θ}_{r0}(x_0) for (r\in \{1,2\}) with the estimated approximate asymptotic bias and variance at all m grind points x_0 discussed in Gijbels et al. (2019c).

The code SemiQRegAND provides the realized value of the βth conditional quantile estimator by using semiparametric quantile regression technique discussed in Gijbels et al. (2019b) and Gijbels et al. (2019c).

References

Gijbels, I., Karim, R. and Verhasselt, A. (2019b). Quantile estimation in a generalized asymmetric distributional setting. To appear in Springer Proceedings in Mathematics & Statistics, Proceedings of ‘SMSA 2019’, the 14th Workshop on Stochastic Models, Statistics and their Application, Dresden, Germany, in March 6–8, 2019. Editors: Ansgar Steland, Ewaryst Rafajlowicz, Ostap Okhrin.

Gijbels, I., Karim, R. and Verhasselt, A. (2019c). Semiparametric quantile regression using quantile-based asymmetric family of densities. Manuscript.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
data(LocomotorPerfor)
x=log(LocomotorPerfor$Body_Mass)
y=log(LocomotorPerfor$MRRS)
h_ROT =  0.9030372
locpolAND_x0(x, y, p1=1,p2=1,h=h_ROT,alpha=0.50,x0=median(x))


data(LocomotorPerfor)
x=log(LocomotorPerfor$Body_Mass)
y=log(LocomotorPerfor$MRRS)
h_ROT =  0.9030372
locpolAND(x, y, p1=1,p2=1,h=h_ROT, alpha=0.50)


# Data
data(LocomotorPerfor)
x=log(LocomotorPerfor$Body_Mass)
y=log(LocomotorPerfor$MRRS)
h_ROT =  0.9030372
gridPoints=101
alpha= 0.5937
plot(x,y)
# location and scale functions estimation at the grid point x0
gridPoints=101
fit_AND <-locpolAND(x, y, p1=1,p2=1,h=h_ROT, alpha=alpha, m = gridPoints)
par(mgp=c(2,.4,0),mar=c(5,4,4,1)+0.01)

# For phi plot
plot(fit_AND$x0,exp(fit_AND$theta_20),ylab=expression(widehat(phi)(x[0])),
xlab="log(Body mass)",type="l",font.lab=2,cex.lab=1.5,
bty="l",cex.axis=1.5,lwd =3)

## For theta2 plot
plot(fit_AND$x0,fit_AND$theta_20,ylab=expression(bold(widehat(theta[2]))(x[0])),
xlab="log(Body mass)",type="l",col=c(1), lty=1, font.lab=1,cex.lab=1.5,
bty="l",cex.axis=1.3,lwd =3)



par(mgp=c(2.5, 1, 0),mar=c(5,4,4,1)+0.01)
# X11(width=7, height=7)
plot(x,y, ylim=c(0,4.5),xlab = "log(Body mass (kg))",
ylab = "log(Maximum relative running speed)",font.lab=1.5,
cex.lab=1.5,bty="l",pch=20,cex.axis=1.5)

lines(fit_AND$x0,fit_AND$theta_10, type='l',col=c(4),lty=6,lwd =3)
lines(fit_AND$x0,SemiQRegAND(beta=0.50,x, y,
p1=1,p2=1, h=h_ROT,alpha=alpha,m=gridPoints)$fit_beta_AND,
type='l',col=c(1),lty=5,lwd =3)
lines(fit_AND$x0,SemiQRegAND(beta=0.90,x, y,
p1=1,p2=1, h=h_ROT,alpha=alpha,m=gridPoints)$fit_beta_AND,type='l',col=c(14),lty=4,lwd =3)
lines(fit_AND$x0,SemiQRegAND(beta=0.10,x, y,
p1=1,p2=1, h=h_ROT,alpha=alpha,m=gridPoints)$fit_beta_AND,type='l',
col=c(19),lty=2,lwd =3)

legend("topright", legend = c(expression(beta==0.10),
                             expression(beta==0.50), expression(beta==0.5937),
                             expression(beta==0.90)), col = c(19,1,4,14), lty=c(2,5,6,4),
      adj = c(.07, 0.5),, inset = c(0.05, +0.01), lwd = 3,cex=1.2)

QBAsyDist documentation built on Sept. 4, 2019, 1:05 a.m.