statsmodels: QuantReg runs 30x slower than quantile regression in R
Hi Guys, I face a challenge as following:
Response variables from a pandas DataFrame: endog, 5000 * 90
Explanatory variable: exog, a pandas Series, length = 90
---- session info —
OS: macos
RAM: 16G
CPU: core i7
---------=-----------
from statsmodels.tools import tools
from statsmodels.regression.quantile_regression import QuantReg
for i in range(5000):
mod = QuantReg(endog.iloc[i].values, tools.add_constant(exog.values))
res = mod.fit(q=0.5).params[1]
Execution time is ~106s
------------=-----------
However, using quantile regression (rq function) in R, only spent
user system elapsed
6.249 0.374 3.770
--------=-----------
Is there any method to reduce the execution time of QuantReg in Python to be comparable to R?
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 19 (11 by maintainers)
Sounds good. I will work on this.