What is Levinson recursion or Levinson–Durbin recursion?
Is a linear algebra prediction analysis that is performed once per bar using the autocorrelation method with a within a specified asymmetric window. The autocorrelation coefficients of the window are computed and converted to LP coefficients using the Levinson algorithm. The LP coefficients are then transformed to line spectrum pairs for quantization and interpolation. The interpolated quantized and unquantized filters are converted back to the LP filter coefficients to construct the synthesis and weighting filters for each bar.
Source Settings: -Loxx's Expanded Source Types. You typically use "open" since open has already closed on the current active bar
LastBar - bar where to start the prediction
PastBars - how many bars back to model
LPOrder - order of linear prediction model; 0 to 1
FutBars - how many bars you want to forward predict
Things to know
- Normally, a simple moving average is caculated on source data. I've expanded this to 38 different averaging methods using Loxx's Moving Avreages.
- This indicator repaints
- Bar color muting
Implementing the Levinson-Durbin Algorithm on the StarCore™ SC140/SC1400 Cores
LevinsonDurbin_G729 Algorithm, Calculates LP coefficients from the autocorrelation coefficients. Intel® Integrated Performance Primitives for Intel® Architecture Reference Manual
// Original Levinson-Durbin algorithm used to implement Levinson recursion
// where a - coefficients of the model, p - order of the model.
// Here we need to find the autoregressive coefficients by solving directly
// our set of equations with n=2*p by the Levinson-Durbin method. Such method
// of prediction is called Prony Method; however, its disadvantage is the
// instability during the prediction of the future values of the series. That's
// why this method has not been included and instead we use a modified
// Levinson Recursion to calculate the prediction coefficients.
// I've included the origina method so one can compare the differences. You'll
// notice that both methods are very similar but the modified version gives the
// desired results. The difference is that the modified version calculates the
// coefficients a by decreasing the mean-root-square error on the training
// last n-p bars
VIP Membership Info: www.patreon.com/algxtrading/membership
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.