RicardoSantos

Function Polynomial Regression

Description:
A function that returns a polynomial regression and deviation information for a data set.

Inputs:
_X: Array containing x data points.
_Y: Array containing y data points.

Outputs:
_predictions: Array with adjusted _Y values.
_max_dev: Max deviation from the mean.
_min_dev: Min deviation from the mean.
_stdev/_sizeX: Average deviation from the mean.

Resources:
https://en.wikipedia.org/wiki/Polynomial...
https://rosettacode.org/wiki/Polynomial_...
Versionshinweise: optional colors as input
Open-source Skript

Ganz im Sinne von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es verstehen und überprüfen können. Ein Hoch auf den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Publikation unterliegt den Hausregeln. Sie können das Skript den Favoriten hinzufügen, um es auf dem Chart zu verwenden.

Möchten Sie dieses Skript auf einem Chart verwenden?

Kommentare

500 Coins
Antworten
This is a stunningly beautiful masterpiece in Pine, I must admit. That is some elegant array() work there! I do believe this is exemplary for the necessity for even more line.new(). It's definitely a top honors choice, if we had a yearly spotlight of the year's greatest achievements from adept "mathemagicians" via the "Power of Pine".
+17 Antworten
racer8 midtownsk8rguy
@midtownsk8rguy, I couldn't agree more with you on that note. Great job RicardoSantos! You just made everyone's day. I bet most mathematicians would be proud of this work. This should be implemented into TV's charting tools!!
+1 Antworten
This publication is now featured in our Editors' Picks. In the name of all TradingView traders, thank you for your valuable contribution to the TradingView community, and congrats!
+12 Antworten
This also triggers me thinking how to apply Polynomial regression for TA. Is that possible to make Polynomial regression "adaptive". I understand markets show volatile nature...
+5 Antworten
After testing this out this is 100 times more useful the stock linear regression. Holy this is game changing. Thank you again Ricardo, especially for keeping your scripts free for everyone to use. Truly a good man!
+3 Antworten
An excellent implementation example of array, thanks. Does array support newly introduced variable length?
+2 Antworten
Respect
+1 Antworten
Wow, this script shows how powerful PINE can be with the array function! Before I start the array application, let's learn these excellent cases first. This is what advanced PINE script programming can use: D
+1 Antworten