Questions tagged [quantile-regression]
107 questions
10
votes
2 answers
Quantile random forests from scikit-garden very slow at making predictions
I've started working with quantile random forests (QRFs) from the scikit-garden package. Previously I was creating regular random forests using RandomForestRegresser from sklearn.ensemble.
It appears that the speed of the QRF is comparable to the…

Tim Williams
- 183
- 1
- 10
5
votes
0 answers
Quantile Regression generates non-monotonic quantile forecasts, e.g. Q49>Q50
I would expect that a quantile regression gives forecasts for the quantiles that are monotonic, i.e.
However, the quantreg package in R generates forecasts that do not make sense at all, see the plot:
Is there a reason for that?
Example below.…

HOSS_JFL
- 765
- 2
- 9
- 24
5
votes
1 answer
QuantileRegression ValueError: operands could not be broadcast together with shapes
I am trying to forecast my target variable using Quantile Regression in Python.
The data I am considering for training and validation is from period 2015 Oct -2017 Dec 31st.
Now the model has developed,Im trying to forecast values for 2018 Jan,…

Nithin Das
- 364
- 1
- 5
- 14
5
votes
0 answers
Difference between rqPen and quantreg packages in R
I am building a quantile regression model + LASSO penalization for the boston housing data in R. I found 2 packages that can build this kind of models: rqPen and quantreg. rqPen implements a cross validation process to tune the LASSO parameter…

Álvaro Méndez Civieta
- 725
- 3
- 12
- 33
5
votes
1 answer
Fast nonnegative quantile and Huber regression in R
I am looking for a fast way to do nonnegative quantile and Huber regression in R (i.e. with the constraint that all coefficients are >0). I tried using the CVXR package for quantile & Huber regression and the quantreg package for quantile…

Tom Wenseleers
- 7,535
- 7
- 63
- 103
4
votes
2 answers
Is it allowed/possible to call an R function or fortran code within a pragma openmp parallel for loop in Rcpp?
In an Rcpp project I would like to be able to either call an R function (the cobs function from the cobs package to do a concave spline fit) or call the fortran code that it relies on (the cobs function uses quantreg's rq.fit.sfnc function to fit…

Tom Wenseleers
- 7,535
- 7
- 63
- 103
3
votes
1 answer
How can I extend the quantile regression lines geom_quantile to forecast in ggplot?
I am trying to plot the quantile regression lines for a set of data. I would like to extend the quantile regression lines from geom_quantile() in order to show how they forecast similar to using stat_smooth() with the fullrange argument set to TRUE.…

joerminer
- 153
- 8
3
votes
2 answers
Why its takes so much longer to fit model in sklearn.linear_model.QuantileRegressor then R model implementation?
First I used R implementation quantile regression, and after that I used Sklearn implementation with the same quantile (tau) and alpha=0.0 (regularization constant). I am getting the same formulas! I tried many "solvers" and still the running time…

Sapir Tubul
- 31
- 3
3
votes
1 answer
summary.rq output depends on sample size
I found out (see below) that the function summary.rq (page 88) from the quantreg package prints different output, depending on whether sample size is greater equal or less than 1001.
I am aware, that rq() uses a different method depending on whether…

Buochserhorn
- 133
- 4
3
votes
1 answer
Identifying Outliers with Quantile Regression and Python
I am trying to identify outliers in a dataset using the 5th and 95th percentiles of a regression line so I'm using quantile regression in Python with statsmodel, matplotlib and pandas. Based on this answer from blokeley, I can create a scatterplot…

Matt
- 203
- 1
- 4
- 8
3
votes
1 answer
R - Setting margins does not work
I estimated a linear regression model by using the quantreg package. I now want to display the results graphically by using the plot() function:
plottest = plot(summary(QReg_final), parm=2, main="y",ylab="jjjjj")
The result is the following (I…

shenflow
- 345
- 2
- 12
2
votes
1 answer
How to model quantiles regression curves for probabilities depending on a predictor in R?
I'd' like to model the 25th, 50th and 75th quantile regression curves (q25, q50, q75) for 241 values of probability ('prob') depending on x0.
For that purpose, I used the qgamV package as follows. However, this approach led to some q25, q50, q75…

denis
- 199
- 1
- 8
2
votes
1 answer
Confusion about the matrix "B" returned by `quantreg::boot.rq`
When invoking boot.rq like this
b_10 = boot.rq(x, y, tau = .1, bsmethod = "xy", cov = TRUE, R = reps, mofn = mofn)
what does the B matrix (size R x p) in b_10 contain: bootstrapped coefficient estimates or bootstrapped standard errors?
The Value…

erised
- 187
- 7
2
votes
1 answer
Is it possible to use lqmm with a mira object?
I am using the package lqmm, to run a linear quantile mixed model on an imputed object of class mira from the package mice. I tried to make a reproducible…

De La Cruz
- 33
- 4
2
votes
3 answers
Is there a neat approach to label a ggplot plot with the equation and other statistics from geom_quantile()?
I'd like to include the relevant statistics from a geom_quantile() fitted line in a similar way to how I would for a geom_smooth(method="lm") fitted linear regression (where I've previously used ggpmisc which is awesome). For example, this code:
#…

Mark Neal
- 996
- 16
- 52