Quantile-Based Estimators

Quantile-based estimators (Q-estimators) fit any parametric distribution through its quantile function, by minimizing the integrated loss of quantile regression. They are usually more robust than maximum likelihood estimators, and allow for censored and truncated data. The package implements user-defined quantile functions, built-in families (normal, gamma, continuous Poisson, uniform), linear models and proportional hazards models. The method is described in Sottile and Frumento (2022) .


Qest

CRAN status R-CMD-check

'Qest' implements the quantile-based estimators (Q-estimators) of Sottile and Frumento (2022): any parametric model is fitted through its quantile function by minimizing the integrated loss of quantile regression. Q-estimators are usually more robust than maximum likelihood, and allow for censored and truncated data.

  • Qest(): user-defined quantile functions, or the families Qnorm, Qgamma, Qpois (continuous Poisson) and Qunif;
  • Qlm(): linear models with normal errors;
  • Qcoxph(): proportional hazards models with a piecewise linear baseline hazard.

Installation

install.packages("Qest")
# development version
remotes::install_github("gianluca-sottile/Qest")

Example

library(Qest)
set.seed(1)
n <- 200
dat <- data.frame(x = runif(n))
dat$y <- rgamma(n, shape = 2, scale = exp(1 + dat$x))
Qg <- function(theta, tau, data) {
  qgamma(tau, shape = exp(theta[1]), scale = exp(theta[2] + theta[3] * data$x))
}
m1 <- Qest(y ~ x, Q = Qg, start = c(NA, NA, NA), data = dat)
m2 <- Qest(y ~ x, Q = Qgamma, data = dat)
cbind(user = coef(m1), family = coef(m2))
#>             user    family
#> Theta1 0.6636152 0.6635124
#> Theta2 0.9955430 0.9956836
#> Theta3 0.9858171 0.9858114
summary(m2)
#> 
#> Call: Qest(formula = y ~ x, Q = Qgamma, data = dat)
#> 
#> n. of observations: 200 
#> n. of parameters: 3 
#> n. of iterations: 4 
#> 
#> Coefficients:
#>             Estimate Std. Error z value Pr(>|z|)    
#> log(shape)    0.6635     0.1084   6.120 9.37e-10 ***
#> (Intercept)   0.9957     0.1650   6.034 1.59e-09 ***
#> x             0.9858     0.1933   5.099 3.41e-07 ***
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> 
#> Minimized loss function: 331.7161
#> 

Reference

Sottile, G. and Frumento, P. (2022). Robust estimation and regression with parametric quantile functions. Computational Statistics and Data Analysis, 171, 107471. https://doi.org/10.1016/j.csda.2022.107471

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("Qest")

2.0.0 by Gianluca Sottile, 6 days ago


https://github.com/gianluca-sottile/Qest


Report a bug at https://github.com/gianluca-sottile/Qest/issues


Browse source code at https://github.com/cran/Qest


Authors: Gianluca Sottile [aut, cre] (ORCID: , Paolo Frumento [aut]


Documentation:   PDF Manual  


GPL (>= 2) license


Imports graphics, matrixStats, stats, survival, utils

Suggests knitr, rmarkdown, testthat


See at CRAN