102 questions
Tooling
0
votes
0
replies
33
views
Good packages for bounded Linear Quantile Regression?
I'm looking for a good package to train a linear quantile regression model, i.e. $\hat y = \sum_{i=1}^n w_i \cdot X_i$. With $x_i$ are the input features, and $w_i$ are the bounded trainable weights. ...
2
votes
1
answer
68
views
Is there a way to weight geom_smooth by different quantiles?
I am depicting the 14 day spei conditions leading up to and following wildfires. I'm looking for trends in variability or dips. In my study region, n = 399. As one could expect, there is a lot of ...
0
votes
1
answer
105
views
how to get global p for categorical variables in quantreg::rq
I am running an analysis for quantile regression evaluated at the median. Below is the code that I have used. My Education level is a 4-level data, giving me 3 p-values. I would like to get an overall ...
0
votes
1
answer
70
views
estimating conditional densities from expectile 'bundle' with expectreg
(please tag 'expectreg' - don't have the rep)
This framework and package seems to exist more or less in the shadows but I'm going to try my luck here.
I'm trying to estimate distribution Y|X non-...
0
votes
0
answers
97
views
Quantile regression in SAS vs Python
Given this dataset
df=pd.DataFrame({'year':[2000,2000,2000,2000,2000,2001,2001,2001,2001,2001,2002,2002,2002,2002,2002],'metric':[2,3,4,5,6,12,13,14,15,16,22,23,24,25,26]})
running quantile ...
2
votes
0
answers
607
views
implementing keras version of quantile loss for regression
I am trying to implement Quantile loss for a regression problem based on the formula from this article (number 14 at the end of the article):
Here is my implementation:
import numpy as np
def ...
0
votes
1
answer
188
views
Is it normal that quantregForest predictions and error metrics are completely different (and worse) than RandomForest ones with same data?
I am using quantregForest to perform quantile regression. Since I already have a script which uses randomForest, at first I simply tried to replace all my calls to randomForest with quantregForest and ...
0
votes
0
answers
181
views
Quantile regression and sample size for a given tau
I am performing the quantile regression in R on a non linear model. I am getting the coefficients for the desired quantiles (tau = 0.05, 0.50, 0.95).
All very nice, but running the code without ...
0
votes
1
answer
587
views
Find Pseudo R-squared for quantile regression models
I have tried to implement quantile regression for the Boston dataset.
library(MASS)
data(Boston)
attach(Boston)
qr_res_0.9 <- rq(medv ~ lstat + rm + crim + dis,
tau = 0.9,...
0
votes
1
answer
685
views
i need to install rqpd R package for quantile regression
i am doing a Quantile regression project. i have the R codes. i needed to install rqpd package for that. I find this code for installing the package :
install.packages("rqpd", repos="...
0
votes
1
answer
549
views
Quantile Forest error "predict() got an unexpected keyword argument 'quantiles'"
I continue to run into errors when run any form of quantile forest models with the prediction and quantile phases. I am following this example but with my own X and y. I have trained many a random ...
1
vote
0
answers
124
views
How to improve the performance of segmented regression using quantile regression in R?
I am currently working on a project where I need to estimate changes in physical fitness over time using segmented regression with quantile regression in R. The data I'm working with consists of ...
0
votes
1
answer
41
views
How to plot confidence interval for yintercept in ggplot
I have two datasets. One with quantile estimates for multiple quantiles and the other with ols estimate.
d1 <- structure(
list(
tau = c(0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, ...
2
votes
1
answer
1k
views
How to create multiple spanner headers in gtsummary
Iv created two merged tables of quantiile regression as explained here
https://yuzar-blog.netlify.app/posts/2022-12-01-quantileregression/
tbl_merge(
tbls = list(
tbl_regression(l) %>% ...
1
vote
1
answer
356
views
quantreg::rq in R provides unstable p-values
using R, I m performing a backtest on a time series by using quantile regression (quantreg::rq) on a number of features. These features are then selected based on a condition such as p-values <= 5%....
0
votes
1
answer
128
views
Merging on row index in R (by = 0 and by = "row.names" not working)
Tl;dr - I'm trying to use the merge.data.table() function with row indexes and the suggestions given in the R documentation are not working.
My data is roughly:
library(data.table)
library(quantreg)
...
1
vote
0
answers
180
views
Adapting quantile regression to the caret package
I want to try adpat quantile regression to caret package. I wrote below code to adapt but I get the error as below:
library(quantreg)
quantregression <- list(type='Regression', library='quantreg',...
2
votes
1
answer
281
views
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. ...
1
vote
1
answer
381
views
Quantile g-computation
I want to perform a time-to-event analysis using qgcomp package. I used qgcomp.cox.boot function and adjusted for confounding factors. However I have encountered some problems.
library("ggplot2&...
0
votes
1
answer
467
views
Scikit-learn QuantileRegressor memory allocation error. No issue with statsmodel QuantReg with the same data
I also posted this here.
I'm trying to fit a quantile regression model to my input data. I would like to use sklearn, but I am getting a memory allocation error when I try to fit the model. The same ...
0
votes
1
answer
203
views
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 ...
1
vote
0
answers
97
views
I need a work around for the 'weights' argument of the 'rq' function in Koenker's 'quantreg' package
Today, I was trying to implement a weighted bootstrap method in R and ran into a problem involving the 'weights' argument of the 'rq' function. Essentially, when putting it inside a function, it ...
0
votes
1
answer
528
views
Quantile regression model from `quantreg` does not finish computation
I am developing an iterative algorithm that uses quantile regression models at each iteration. For that I use the rq function from the quantreg package in R. So far it has worked fine. However, I have ...
1
vote
0
answers
656
views
How can I extract the random effects information from lmm and lqmm models using multiple imputed data?
Continuing from this question: Is it possible to use lqmm with a mira object?
I have tried to get the random effects for the mixed models (lmm and lqmm), and it has been hard.
library(lqmm)
library(...
2
votes
1
answer
536
views
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 example:
library(lqmm)
library(mice)
summary(...
0
votes
1
answer
469
views
Plot your own generated confidence interval with ggplot2 in R
Following this question Bootstrapping CI for a quantile regression in R outside the quantreg framework, I would like to plot the confidence interval, obtained with the solution provided, on my ...
0
votes
1
answer
174
views
Bootstrapping CI for a quantile regression in R outside the quantreg framework
I have an object, model1, resulting from a quantile regression. In model1 I have 3 columns and 99 rows with a step of 1 centile like this:
> model1
tau intercept julian_day
1 0.01 17.25584 -...
0
votes
1
answer
364
views
Alternatives to a regression model in R?
So I am trying to solve a problem where I have a dataset with 3 columns, "CustomerID", "Fast", and "Precise" where "CustomerID" is simply the number of the ...
0
votes
1
answer
290
views
Is there any place in scikit-learn Lasso/Quantile Regression source code that L1 regularization is applied?
I could not find where the Manhattan distance of weights is calculated and multiplied with alpha (L1 reg. coefficient) in the Lasso Regression and the Quantile Regression source code of scikit-learn.
...
0
votes
0
answers
970
views
error in base backsolve with quantile regression, how do I solve?
If I run the library for 'quantreg', I get a warning that backsolve is masked from base. Then I try to run a quantile regression and I get an error involving backsolve. How can I solve this?
library(...
0
votes
0
answers
120
views
How can I interpret my rho risk values when performing probabilistic time series forecasting?
I am currently exploring different probabilistic time series forecasting models for car sales data and have planned to evaluate the probabilistic forecasts with the metrics rho-risk as described on ...
3
votes
1
answer
340
views
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 ...
-1
votes
1
answer
82
views
SAS Code On Ranking Exam Performance Using Conditional Quantile Regression
I'm relatively new to R and coding in general and I have been trying to replicate an example provided in this PDF (https://support.sas.com/resources/papers/proceedings17/SAS0525-2017.pdf) on quantile ...
1
vote
1
answer
578
views
How to determine degrees of freedom for t stat with quantile regression and bootstrapped standard errors in R
I am using R to conduct a quantile regression with bootstrapped standard errors to test if one variable is higher than a second variable at the 5th, 50th, and 95th percentiles of the distributions. ...
1
vote
2
answers
1k
views
How to perform bootstrapping for estimation and inference of quantile regression using multiply imputed data in R?
I am trying to manually pool results from quantile regression models run on multiply imputed data in R using mice. I make use of a bootstrapping procedure to get 95% CIs and P values of the model ...
4
votes
2
answers
3k
views
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 ...
0
votes
0
answers
238
views
Quadratic quantile regression in R
Does anyone know how to fit a quadratic (or higher order) model on a continuous variable and do quantile regression on it in R? Additionally, how do you tell what level of tau fits the data better?
...
1
vote
1
answer
2k
views
How to create a quantiles column in pandas dataframe that calculates the corresponding quantile
I have a dataframe df that is indexed by customer id. and includes:
df=['Customer ID', 'Sales' ,'Product code' ,'Price']]: https://i.sstatic.net/vP8Gy.png
I want to create a column Quantile, which ...
0
votes
1
answer
2k
views
RandomForestQuantileRegressor from scikit-garden .fit method freezes when training last tree
I've been working with scikit-garden for around 2 months now, trying to train quantile regression forests (QRF), similarly to the method in this paper. The authors of the paper used R, but because my ...
2
votes
0
answers
370
views
R: looking for implementation of quantile regression with fixed effects by Machado and Silva (2019)
I am looking for an R implementation of the quantile regression with fixed effects as proposed by Machado and Santos Silva (2019).
Is it included in any package or is anyone currently working on it?
I ...
0
votes
0
answers
401
views
Statsmodels QuantReg will only train with certain amount of features
I am using statsmodels to train a linear quantile regression. I have different combinations of features that I need to try and train, but it is as if statsmodels only allows a certain amount of ...
1
vote
2
answers
1k
views
summary of quantile regression with rqpd does not return standard errors
I am using rqpd package in R to have a quantile regression with fixed effects (quantreg package does not support quantile regressions with fixed effects) as follow:
reg_q1 <- rqpd::rqpd(...
1
vote
1
answer
391
views
Inspection of trees in a Quantile Random Forest Regression model
I am interested in training a random forest to learn some conditional quantile on some data {X, y} sampled independently from some distribution.
That is, for some $$\alpha \in (0, 1)$$, a mapping $$\...
0
votes
1
answer
89
views
R: Reduce number of plots in quantile regression results
By using the following code I am able to plot the results of my quantile regression model:
quant_reg_all <- rq(y_quant ~ X_quant, tau = seq(0.05, 0.95, by = 0.05), data=df_lasso)
quant_plot <- ...
1
vote
2
answers
305
views
Misuse predict.rq in the package quantreg?
I am using quantreg package to predict new data based on training set. However, I noticed a discrepancy between predict.rq or predict and doing it manually. Here is an example:
The quantile regression ...
0
votes
0
answers
642
views
Prediction Intervals from Quantile Regression Forests have higher coverage than expected?
Question:
What factors may cause the prediction interval to have wider coverage than would be expected? Particularly with regard to quantile regression forests with the ranger package?
Specific ...
0
votes
1
answer
164
views
Apply function to a subset of columns by factor group
Suppose I want to apply a simple quantile regression to a subset of columns in a dataframe, by all the factor values of a column.
As an example, take mtcars.
data(mtcars)
cols <- c("mpg", ...
0
votes
2
answers
284
views
R quantreg : boundary condition rq() function goes into infinite loop
I'm facing a problem that
rq(y ~ x, tau = 0.50, method = "br")
doesn't complete calculation. There is no error and warning.
I traced code and found .Fortran() in rq.fit.br() does not finish ...
0
votes
2
answers
1k
views
How to conduct unconditional quantile regression in R? [closed]
The only package I know that does unconditional quantile regression in R is uqr. Unfortunately, it's been removed from CRAN. Even though I can still use it, its functionality is limited (e.g., does ...
0
votes
1
answer
668
views
How to have multiple independent value columns using statsmodels quantreg
Right now I'm trying to use statsmodels.formula.api's quantreg by putting in the formula and the dataframe by doing smf.quantreg('<independant values> ~ <dependant values>', df).fit(q=0.9) ...