TradingView
loxx
13 авг 2022 г., 00:23

Modified Covariance Autoregressive Estimator of Price [Loxx] 

Australian Dollar/U.S. DollarFXCM

Описание

What is the Modified Covariance AR Estimator?
The Modified Covariance AR Estimator uses the modified covariance method to fit an autoregressive (AR) model to the input data. This method minimizes the forward and backward prediction errors in the least squares sense. The input is a frame of consecutive time samples, which is assumed to be the output of an AR system driven by white noise. The block computes the normalized estimate of the AR system parameters, A(z), independently for each successive input.

Characteristics of Modified Covariance AR Estimator
  • Minimizes the forward prediction error in the least squares sense
  • Minimizes the forward and backward prediction errors in the least squares sense
  • High resolution for short data records
  • Able to extract frequencies from data consisting of p or more pure sinusoids
  • Does not suffer spectral line-splitting
  • May produce unstable models
  • Peak locations slightly dependent on initial phase
  • Minor frequency bias for estimates of sinusoids in noise
  • Order must be less than or equal to 2/3 the input frame size


Purpose
This indicator calculates a prediction of price. This will NOT work on all tickers. To see whether this works on a ticker for the settings you have chosen, you must check the label message on the lower right of the chart. The label will show either a pass or fail. If it passes, then it's green, if it fails, it's red. The reason for this is because the Modified Covariance method produce unstable models

H(z)= G / A(z) = G / (1+. a(2)z −1 +…+a(p+1)z)

You specify the order, "ip", of the all-pole model in the Estimation order parameter. To guarantee a valid output, you must set the Estimation order parameter to be less than or equal to two thirds the input vector length.

The output port labeled "a" outputs the normalized estimate of the AR model coefficients in descending powers of z.

The implementation of the Modified Covariance AR Estimator in this indicator is the fast algorithm for the solution of the modified covariance least squares normal equations.

Inputs
x - Array of complex data samples X(1) through X(N)
ip - Order of linear prediction model (integer)

Notable local variables
v - Real linear prediction variance at order IP

Outputs
a - Array of complex linear prediction coefficients
stop - value at time of exit, with error message
false - for normal exit (no numerical ill-conditioning)
true - if v is not a positive value
true - if delta and gamma do not lie in the range 0 to 1
true - if v is not a positive value
true - if delta and gamma do not lie in the range 0 to 1
errormessage - an error message based on "stop" parameter; this message will be displayed in the lower righthand corner of the chart. If you see a green "passed" then the analysis is valid, otherwise the test failed.

Indicator inputs
LastBar = bars backward from current bar to test estimate reliability
PastBars = how many bars are we going to analyze
LPOrder = Order of Linear Prediction, and for Modified Covariance AR method, this must be less than or equal to 2/3 the input frame size, so this number has a max value of 0.67
FutBars = how many bars you'd like to show in the future. This algorithm will either accept or reject your value input here and then project forward

Further reading
Spectrum Analysis-A Modern Perspective 1380 PROCEEDINGS OF THE IEEE, VOL. 69, NO. 11, NOVEMBER 1981

Related indicators

Levinson-Durbin Autocorrelation Extrapolation of Price [Loxx]
tradingview.com/script/mvUdLxSg-Levinson-Durbin-Autocorrelation-Extrapolation-of-Price-Loxx/

Weighted Burg AR Spectral Estimate Extrapolation of Price [Loxx]
tradingview.com/script/G3VyvCoH-Weighted-Burg-AR-Spectral-Estimate-Extrapolation-of-Price-Loxx/

Helme-Nikias Weighted Burg AR-SE Extra. of Price [Loxx]
tradingview.com/script/8YbmmPCn-Helme-Nikias-Weighted-Burg-AR-SE-Extra-of-Price-Loxx/

Itakura-Saito Autoregressive Extrapolation of Price [Loxx]
tradingview.com/script/BKC6dFUY-Itakura-Saito-Autoregressive-Extrapolation-of-Price-Loxx/

Modified Covariance Autoregressive Estimator of Price [Loxx]
tradingview.com/script/u0r2gpti-Fourier-Extrapolator-of-Price-w-Projection-Forecast-Loxx/

Информация о релизе

Updated lines calculation.
Комментарии
gouiferdam
Ok
Yelian
From a purely Bayesian statistical inference point of view, how should we interpret a pass or a fail?
loxx
@Yelian, The failures don't speak to anything more than being unable to compute given the current settings. I wouldn't think outside this for now. I'll write up a better explanation later, but that pass/fail could have been coded out so that the entire indicator fails, but I decided to keep the failures on screen. So you'd adjust the settings on the current asset until it doesn't fail. However, if I have time this week, I'll write something up about why it's failing on X settings.
Yelian
@loxx, ok great! This seems like a rather interesting indicator. From my point of view and thru a Bayesian lens I think it can be worked out such that a "pass" means that an AR model was able to fit the time series and so if the shoe fits you may consider a finite mean reverting level and a "fail" imply that the AR shoe doesn't fit the time series and thus you may consider the absence of a finite mean reverting level. Of course, markets are complex adaptive dynamics systems and thus they can only ever "appear" to be AR or give you the statistical illusion of an AR process without ever being one in reality. Markets can only ever reveal an apparently finite mean reverting level which may easily disappear in the very next candle
loxx
@Yelian, Yep, and in the mean time, If you want to dive deeper right now, check out this book.

"Digital Spectral Analysis Second Edition", S. Lawrence Marple Jr., Dover Books on Electrical Engineering,

But yeah, I'll be updating most of the stuff I've published with more details here shortly.
Yelian
@loxx, Awesome!! Thank you for being so kind with your thoughts and insights, it is much much appreciated!
mukhi3
Error negative or zero
loxx
@mukhi3, maybe read the instructions. not all analysis will pass, if it doesnt pass. too bad
mukhi3
@loxx,
Appreciated
Ещё