Machine learning in trading: theory, models, practice and algo-trading - page 3257
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I'm wrong somewhere, but I don't see it.
But it works with this string
const matrix<double> matrix1 = {{2, 2, 3}, {3, 2, 3}, {1, 2, 1}};
[0,0,0]
[0.8660254037844387,0,1]]
Apparently, if all the data in a column are the same, the calculation is skipped.
In the 2nd column I left all the data in 2 and the 2nd row of the matrix remained zero. Although it is probably correct to fill the diagonal with 1s.
PS. At first I thought it was a bug with Alglib.
In the old code the values of elements were set through
m[row].Set(col, val);
And now
m.Set(row,col, val);
It's a pity that there is no backward compatibility. Well, it doesn't matter to me. I'm not working through Alglib now. If someone's old codes stop working, it will be necessary to fix it.
The saddest thing is that the old version of
m[row].Set(col, val);
doesn't write error messages, it just doesn't do anything. People just won't replace and won't know they need to change the code. It will count something, but with unchanged matrices.
Apparently, if all data in a column are the same, the calculation is skipped.
Pearson does not calculate between rows, but between columns?
Looks like it. It gives a single matrix.Pearson does not calculate between rows, but between columns?
ZY It seems so. It produces a unit matrix.Alglib is a good library, it has everything for MO. Neural networks are super slow there, it was so in early versions.
in statistics.mqh.
PearsonCorrM - Correlation of all rows to all rows is the fastest.
On its basis I calculated the correlation matrix.
Measured the performance.
Result.
It is well seen that Alglib calculates the matrix faster than the standard matrix method.
However, for pattern search, calculating the correlation matrix is insane in terms of RAM consumption.
How long does it take Python to read the same size of the original matrix as in the example above?
However, it is RAM-consuming madness to read a correlation matrix to find patterns.
My inbuilt one worked faster on my i7-6700
It's strange that the native one is slower, they could have just copied it. It is unlikely that Alglibe has some unique accelerated algorithm under licence.
Have you tried the other 2 variants from Alglib?
If you count in loops every row to every row or every row to all rows, memory will be more economical (2 rows or 1 row + matrix). But it will take longer, I don't remember exactly, but I think it will be slower than the built-in function.
However, it is RAM-consuming madness to read a correlation matrix to find patterns.
It's worse with memory.
Before launching
And during the work of Alglibov PearsonCorrM memory is growing all the time: I saw 5 gg and 4.6 on the screen.
and during the work of standard Matrix.CorrCoef.
Apparently, the standard one is optimised for minimum memory usage, and the Alglibov one is optimised for speed.
I got the built in one to work faster: on an i7-6700.
And while running Alglib's PearsonCorrM, the memory keeps growing: and 5 gg was seen, 4,6 got on the screen
Forum on trading, automated trading systems and testing trading strategies
Machine learning in trading: theory, models, practice and algo-trading
fxsaber, 2023.09.25 18:01
This is just a transition from CMatrixDouble to matrix<double>. I even had to do this matrix comparison because of memory.
Forum on trading, automated trading systems and testing trading strategies
Machine learning in trading: theory, models, practice and algo-trading
fxsaber, 2023.09.25 18:01
Almost double the amount of consumption due to this line.
It is just a transition from CMatrixDouble to matrix<double>. I even had to do this matrix comparison because of memory.
And the time is increased by 40% by this conversion. Commented // Res = MatrixOut.ToMatrix();
I.e. if you work only with Alglibov fnctional (without converting its matrices into terminal matrices), it will be faster.