Random Flow Theory and FOREX - page 22

 

Prival

Something about the wrong file. Kalman is knocked out. There's no such chart. Send a working one.

Yeah. Excuse me. Here it is:

Files:
 

Here's correcting everything. The input should be the same Y (signal+noise).

In terms of min RMS, the Kalman picks out the original V(k)+a(k) model better. I think you can even see it clearly.

Files:
 

If we calculate the sum of the squares of the difference between the original series and the series constructed by Kalman (FC) and Butterworth (FB) filters, then the largest approximation to the original BP is given by FC, see the figure of differences:

The red line is FB minus the original series, the blue line is FC. Thus, FC does an excellent job using a priori data about the laws that describe the behavior of the object under study.

Unfortunately, we do not have a theory that allows us to build an adequate model of the behavior of BP characteristic of the market. The question remains open.

 

Neutron

There seems to be a theory (called random flows). I think it is impossible to build 1 model for all cases. But it is possible to use several models working in parallel. I.e. at some certain period of time the quotes flow may be presented in the form of an oscillatory link model (analog of a flat), with a trend (straight line equation I think we can manage it :-)) - the second model. By the way, the file I posted has an oscillating link model built in. Try it, put the cursor on rnorm() and press F9, different curves will be generated, not even similar to each other in appearance. But kalman does a very good job with them. If it (the algorithm) outperforms Butterworth in accuracy, and that in turn easily does FATL, SATL and any MA, then using this algorithm gives some statistical advantage in accuracy.

The only thing needed, and what I'm doing now, is a divergence criterion for the filter, i.e. choosing a rule when to switch to another filter (another model).

 
Neutron:

If to calculate the sum of squares of difference of initial series and series constructed by Kalman (FC) and Butterworth (FB) filters, then the greatest approximation to initial VR is given by FC


The sum is the number, in our example obtained from 500 counts.

i.e. almost by one order of magnitude FC is better than FB

Edit.

P/S/ How can the number be reflected by such a beautiful graph? Again not accurate in wording :-)

 

You can't have a number, but you can have a graph! This number is the integral characteristic of the process;-)

There is a knob in FB called filter order. In the subroutine, this value is assigned to the variable K, play with it. Not only smoothness of curve depends on this value, but also FZ.

Если он (алгоритм) превосходит по точности Батерворта, а тот в свою очередь легко делает FATL, SATL и любую MA, то использование этого алгоритма дает некоторое статистическое преимущество по точности.

Yes, it does and not "some" but huge! Assuming you have a theory, which you don't... All your activity is based on the postulate of "inertia" in the dynamics of the exchange rate. Prove it.

 

I can't prove it yet, as I've only made a hypothesis and am testing it. I used to say. That the flow of quotations has energy, made an indicator of strength (energy), coincides well with the direction of the flow. There is a concept of "mass of money", they even suggested a formula for its calculation. That is, there are all the attributes of a material object, we can assume that there is also inertia. It seems to be visually obvious, and it is often said that the price fluctuates around a certain equilibrium state.

I think there is only one correct proof. If we subtract the model from the quote flow and the residue follows the normal distribution law. It will undermine adequacy of the model (its workability). But I haven't got to it yet. But I will certainly carry out these researches to trust the model(s).

 

Sergey, why do you use normality of the distribution as a criterion? What if the distribution of the residuals is symmetric-exponential, it is no longer a subversion of the adequacy of the model?

 
Neutron:

Sergey, why do you use normality of the distribution as a criterion? What if the distribution of the residuals is symmetric-exponential, it is no longer a subversion of the adequacy of the model?


I can't give an exact answer now as checking the adequacy of the model is a serious study. The only thing I remember is if we use Neumann-Pearson criterion in the problem of approximation of some curve by formula or polynomial, the residuals are checked for conformity with the normal law of distribution. If it is symmetric-exponential, you may need to use some other criterion. But it can be simpler: if TS based on this model produces profit, it means it is adequate.)

And concerning adequacy for any time series we can build ACF, it usually lies at the basis of analysis, so earlier in this thread I gave a picture of ACF obtained from the model and ACF of real quotes, look at their appearance can't be distinguished.

 

Here's a tweaked version of FB - removed an unnecessary loop.

Files:
batter.zip  7 kb
Reason: