question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Results of linreg does not match talib.LINEARREG()

See original GitHub issue

Which version are you running? The lastest version is on Github. Pip is for major releases.

import pandas_ta as ta
print(ta.version)

0.2.45b0 Upgrade.

$ pip install -U git+https://github.com/twopirllc/pandas-ta

Describe the bug I compared the results of ta.linreg() and talib.LINEARREG(). There is a significant difference. Are you doing it differently? For comparison, talib.LINEARREG() matches what is on tradingview (Pinescript linreg function). This is commonly used for the histogram of the TTM squeeze indicator

To Reproduce df[“hist_talib”] = talib.LINEARREG(df[“donchian_midline”], timeperiod=20) df[“hist_pandas_ta”] = ta.linreg(df[“donchian_midline”], length=20)

Expected behavior I except the output of ta.linreg to match the output of talib.LINEARREG and pinescript linreg function

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
drixiecommented, Nov 2, 2021

I just tried the development build again, and it works perfectly. The results match with both TA Lib and TradingView. Probably didn’t work the first time because of issues with Colab.

Once again, thanks for your time and energy working on this great library

0reactions
twopirllccommented, Nov 3, 2021

Thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

how does talib.LINEARREG works? - Stack Overflow
I'm using TA-Lib to calculate technical indicators, but I don't understand the LINEARREG function where only one input array(called close price) ...
Read more >
Regression coefficients do not match conditional means
As can be seen in this jupyter notebook, I cannot get these two methods to match. How come the linear regression results do...
Read more >
Incorrect output is returned when you use the Linear ...
Discusses a problem in which the incorrect output is returned when you use Linear Regression (LINEST) function in Excel.
Read more >
Python Examples of talib.LINEARREG - ProgramCreek.com
The following are 5 code examples of talib.LINEARREG(). You can vote up the ones you like or vote down the ones you don't...
Read more >
Interpret Linear Regression Results - MATLAB & Simulink
Fit a linear regression model by using fitlm . lm = fitlm(X,MPG). lm = Linear regression model: y ~ 1 + x1 +...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found