Estimating the CDF of the response for a given value of covariate. Additionally quantiles are computed from the distribution function which allows for the calculation of regression quantiles.
cdf.qp(expectreg, x = NA, qout = NA, extrap = FALSE, e0 = NA, eR = NA,
lambda = 0, var.dat = NA)cdf.bundle(bundle, qout = NA, extrap = FALSE)
An object of class expectreg or subclass bundle respectively. The number of expectiles should be high enough to ensure accurate estimation. One approach would be to take as many expectiles as data points. Also make sure that extreme expectiles are incuded, e.g. expectiles corresponding to very small and large asymmetrie values.
The covariate value where the CDF is estimated. By default the first covariate value.
Vector of quantiles that will be computed from the CDF.
If TRUE, extreme quantiles will be extrapolated linearly, otherwise the maximum of the CDF is used.
Scalar number which offers the possibility to specify an artificial minimal expectile (for example the minimum of the data) used for the calculation. By default e0 = e1 + (e1 - e2) where e1 is the actual minimal expectile and e2 the second smallest expectile.
Scalar number which offers the possibility to specify an artificial maximal expectile (for example the maximum of the data) used for the calculation. By default eR = eR-1 + (eR-1 - eR-2) where eR-1 is the actual maximal expectile and eR-2 the second largest expectile.
Positive Scalar. Penalty parameter steering the smoothness of the fitted CDF. By default equal to 0 which means no penalization.
Positive Scalar for a applied penalization, i.e lambda
unequal to 0.
In default this argument can be used to let the penalty depend on the variance of the expectiles.
A list consisting of
vector of expectiles where the CDF is computed.
vector of values of the CDF at the expectiles x
.
vector of quantile values estimated from the CDF.
vector of probabilities for the calculated quantiles.
Expectile curves can describe very well the spread and location of a scatterplot. With
a set of curves they give good impression about the nature of the data. This information
can be used to estimate the conditional density from the expectile curves.
The results of the bundle model are especially suited in this case
as only one density will be estimated which can then be modulated to
over the independent variable x. The
density estimation can be formulated as penalized least squares problem that results in a smooth non-negative
density.
The theoretical values of a quantile regression at this covariate value
are also returned for adjustable probabilities qout
.
Schnabel SK and Eilers PHC (2010) A location scale model for non-crossing expectile curves (working paper)
Schulze Waltrup L, Sobotka F, Kneib T and Kauermann G (2014) Expectile and Quantile Regression - David and Goliath? Statistical Modelling.
# NOT RUN {
d = expectreg.ls(dist ~ rb(speed),data=cars,smooth="f",lambda=5,estimate="restricted",
expectiles=c(0.0001,0.001,seq(0.01,0.99,0.01),0.999,0.9999))
e = cdf.qp(d,15,extrap=TRUE)
e
e2 = cdf.qp(d,15,extrap=TRUE,e0=-25)
e2
b<-cdf.bundle(d,extrap=TRUE)
plot(b)
# }
Run the code above in your browser using DataLab