Moving linear regression indicator with numba #292
Unanswered
andreas-vester
asked this question in
Q&A
Replies: 1 comment
-
|
@andreas-vester sorry, don't have time to help with that, better ask on Numba forum: https://numba.discourse.group |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to create a moving linear regression indicator and I wanted to utilize
numba. However, I am struggling with the latter part.Here's what I have so far. It is working, however, without applying
numbait is quite slow once you throw large arrays at it.The indicator is actually computing a linear regression applying
np.linalg.lstsqfunction (https://numpy.org/doc/stable/reference/generated/numpy.linalg.lstsq.html) for a givenwindowlength. It than basically outputs the very last point of the regression line and moves on to the next range and computes the linear regression again. At the end of the day,ols_1doutputs the last point of every individual regression line putting it into an array.Now, I need help in order to apply
numbaon top of it. I am not familiar withnumba, but as far as my own trial and error goes, there might be an issue utilizingnb.lib.stride_tricks.sliding_window_view().Beta Was this translation helpful? Give feedback.
All reactions