Zero sample correlation does not necessarily mean there is no linear relationship - page 4

 

There is no error there. What you wrote is slightly wrong with ACF(0) because this is the maximum value. By definition ACF at 0 equals 1(the array is compared to itself without an offset QC=1) an offset is made and compared again to the original and so on until it goes beyond. then ACF becomes 0.

To check if I correctly copied the code from Matcad to MQL, I checked using the same data and compared it to what I wrote and what Matcad calculated using the embedded formula and the one I gave there. All three results were the same

 
jartmailru:
Is it possible to do 3D?! o_O
:-)

Easy :-)
 
Prival:


And what are the differences? Give me a proper calculation, then we'll talk. So far, it's just a blanket statement.

1. pierson is wrong.

2. spearman wrong

3. ACF is not understood at all...

4. the discovery was made that it is necessary to correctly understand what correlation means =0

P.S. write it, it's interesting ... terribly interesting ...


1. I didn't get the correct Pearson calculation anywhere in MQL4. That's why I implemented it myself.

2. Spearman did not do it.

3. Selective autocorrelation is also missing in MQL4. Mathcad function is not cited.

4. One has to understand what a linear relationship is.

I'm not copying formulas, I'm getting into their essence. And I ask logical questions.

 
jartmailru:

P.S. 2: I don't know how... but it would probably be cool to see a graph of the correct ACF,
plotted with X=bar, Y=value of ACF, and Z- offset between samples ;-)

The window size is still.

Write the X, Y, Z values into the file. Line by line. And Mathcad will render you at once with rotation, approximation, etc.

 
jartmailru:
Can 3D be there ?! o_O :-)

this was kindly presented by one of the authorities on the forum. 3D examples

I saved - for posterity.

 
hrenfx:


....

I'm not copying formulas, I'm getting to the bottom of them. And I ask logical questions.

That's right. You have to get to the bottom of them. You can't criticize them right away. What, for example, Pearson did not manage to apply.

My conclusion is that correlation (Pearson's coefficient) is a shitty indicator of the presence of a linear relationship in a sample. Not only does correlation not show a direct correlation, it also lies.

Doesn't mean Pearson is lying at all. The formula can't lie, it's just a formula... maybe you're just trying to misapply it. Or you have too high an expectation of it. Pearson's got nothing to do with it. He's good. He wrote the formula. A lot of people use it... thank you.

Z.I. about matkad. look for it exactly there (ACF). unfortunately, on this Windows 7-ku can not put matkad. soon I will demolish. will put. can send in a personal file. where I did all checks.

 
Example 3d graphics in excel.
Files:
3d.zip  3 kb
 
Prival:

To check if I have transferred the code from Matkad to MQL, I checked with the same data and compared what I wrote with what Matkad calculated using the embedded formula and the one I gave there. All three results were the same

Aha! Then it's already a mega-decompilation protection :-). When one has to somehow interpret the shape of the ACF calculated in this way.
And all others (like me :-) ) do not understand what the indicator calculates and shows.

hrenfx:
Window size else. Write X, Y, Z values into the file. One line at a time. And Mathcad will visualize you right away with rotation, approximation, etc.

About the window size - exactly! I wish it were not that in the end it already needs 4D :-)...
Maybe I'll build something interesting sometime.

.

P.S.: Fact: For me the understandable ACF value = -1 to +1, calculated on the B bar by the N window offset S. Wo :-).

Integer:
Example 3d graph in excel.
Thank you.
 
jartmailru:

Aha! Then it's already a mega-decompilation protection :-). When you have to somehow interpret the shape of the ACF calculated in this way.
And everyone else doesn't understand what the indicator calculates and shows.

...


You're probably right. I often come across the fact that people don't understand what it shows. I did my best. I gave the formula. It's the formula that's written there that gets calculated. The only thing they have to do is to remove the trend (linear regression) from the data, and that's it. The function built into Matcad will show the same exact graph.

It has to be understood, that's for sure. ACF is very often used in time series analysis. I was baffled several times by the question how to trade with it if it always =1. And my attempts to explain that this indicator is not for trading but for analysis caused bewilderment, or rather a lack of understanding...

 
jartmailru:

P.S.: Fact: For me, an intelligible ACF value = a value from -1 to +1 calculated on a B bar by an N window offset S. Wo :-).


Look again at the formula https://ru.wikipedia.org/wiki/Автокорреляционная_функция ACF depends only on tau, on the offset, there is no window.

If you introduce an additional variable N, then it turns out that for the same dataset. say 1 2 3 4 5 6 7 8 9 can have different ACF, depending on the chosen N. This is wrong. One dataset has one ACF, a different dataset has a different ACF, etc.

Reason: