Kendall Rank Correlation NET on SMA [Loxx]Kendall Rank Correlation NET on SMA is an SMA that uses Kendall Rank Correlation to form a sort of noise elimination technology to smooth out trend shifts. You'll notice that the slope of the SMA line doesn't always match the color of the SMA line. This is behavior is expected and is the NET that removes noise from the SMA.
What is Kendall Rank Correlation?
Also commonly known as “Kendall’s tau coefficient”. Kendall’s Tau coefficient and Spearman’s rank correlation coefficient assess statistical associations based on the ranks of the data. Kendall rank correlation (non-parametric) is an alternative to Pearson’s correlation (parametric) when the data you’re working with has failed one or more assumptions of the test. This is also the best alternative to Spearman correlation (non-parametric) when your sample size is small and has many tied ranks.
Kendall rank correlation is used to test the similarities in the ordering of data when it is ranked by quantities. Other types of correlation coefficients use the observations as the basis of the correlation, Kendall’s correlation coefficient uses pairs of observations and determines the strength of association based on the patter on concordance and discordance between the pairs.
Concordant: Ordered in the same way (consistency). A pair of observations is considered concordant if (x2 — x1) and (y2 — y1) have the same sign.
Discordant: Ordered differently (inconsistency). A pair of observations is considered concordant if (x2 — x1) and (y2 — y1) have opposite signs.
Kendall’s Tau coefficient of correlation is usually smaller values than Spearman’s rho correlation. The calculations are based on concordant and discordant pairs. Insensitive to error. P values are more accurate with smaller sample sizes.
Included:
-Toggle on/off bar coloring
Kendall
RSI With Noise Elimination Technology (John Ehlers)Indicator translation to Pinescript requested by cookie_crusher on Twitter. The "RSI With Noise Elimination Technology" (NET) is an indicator developed by John Elhers.
The indicator is simply a rolling Kendall rank correlation coefficient of a normalized momentum oscillator (a version of the RSI introduced by Elhers in the May 2018 issue of Stocks & Commodities). It can be interesting to note that the absolute value of this oscillator is equal to the efficiency ratio used in the Kaufman adaptive moving average (KAMA).
Even if both the normalized momentum oscillator and rolling Rank correlation are scale-invariant oscillators, they do not have the same behaviors when increasing their settings, that is the normalized momentum oscillator scale range will become lower while the Kendall correlation will stay close to 1/-1, here is a closed-form approximation of the mean of the absolute value of the normalized momentum oscillator absolute value (efficiency ratio):
E (er) ≈ 1/√p
Where E (er) is the mean of the efficiency ratio er while p is the period of the efficiency ratio, as such the scale of the normalized momentum oscillator will shrink with a higher period, maybe that both are not intended to be plotted at the same time but that's what the original code does.
It's still a coll indicator. The link to J. Elhers article is in the code.
Kendall Rank Correlation CoefficientKendall Rank Correlation Coefficient script.
This way to measure the ordinal association between two measured quantities described by Maurice Kendall (1938, Biometrika, 30 (1–2): 81–89, "A New Measure of Rank Correlation").
In this script I compare Kendall Coefficient and Pearson Coefficient (using built-in "correlation" function).