Interpolation, approximation and the like (alglib package) - page 10

 
Nikolai Semko:

Honestly - you are talking nonsense.
If the function is periodic with a period equal to the interval of decomposition, then why do we need approximation and extrapolation at all?

Just copy the last 1000 bars and stick them to the right last bar and voila - the forecast is ready.


That's exactly what I wrote about in the first post ;))))))). Concerning rubbish - is it your way to talk to unfamiliar people?

One more thing:


Nikolai Semko:

Do you even understand the meaning of these formulas?

How could a former employee of Applied Mathematics Department and a university mathematics teacher understand such complicated formulas? ;)))))))
Once again, try to understand the physical meaning of what you are doing.

 
Vladyslav Goshkov:

This is exactly what I wrote about in the first post ;))))))). As for the bullshit, is this your way of talking to people you don't know well?

Also:

How can a former employee of a department of applied mathematics and a university mathematics teacher understand such complicated formulas? ;)))))))
Once again, try to understand the physical meaning of what you are doing.

I think I understand the source of your misconception.
In that post I wrote that I do not use the fast Fourier transform, which uses equidistant frequencies.

This type of transform has a different purpose - it is used mainly to compress music. And due to the fact that all the periods of the harmonics are multiples of the total observed period, this type of transform does have a total period, which is what you're talking about. But this type is not suitable for extrapolation, because the extrapolation will simply repeat the previous values. It's a very special case that is aimed at compressing information rather than predicting it.
The price prediction uses a different type of decomposition, which is what I wrote about in this post. That's why I recorded the animated gif and provided the code for you to study. There's no periodicity there equal to the sample size of the data. There the period of each harmonic is calculated optimally and consistently, and the periods are not even always in descending order, the period of the next harmonic may even be greater than the previous one.
Don't be offended for your ramblings. My nerves are bad. :))

 
Nikolai Semko:

No, this algorithm for finding harmonics does not use fast Fourier transform, butuses Queen-Fernandez frequency calculation algorithm. (source code) By the way, aren't you the author? The name is the same, but the profiles are different.

The frequencies are calculated sequentially and are not multiples of each other. This can be seen both from the animated gif and from the code I presented above and now.
Here is an example of harmonic frequency ratios from this example (just printed w):

No, I'm not the author. And a series of trigonometric functions whose frequencies are not multiples of each other is not a Fourier series.
 
Vladimir:
No, I'm not the author. And a series of trigonometric functions whose frequencies are not multiples of each other is not a Fourier series.

You can't find any mention of Fourier series in my posts. I was talking about Fourier transforms.
Fourier series is a particular case of the Fourier transform of a periodic function.

The price graph is not a periodic function. Therefore, a Fourier series is not needed here.

The Fast Fourier Transformation (FFT) calculates Fourier series. I do not use FFT in my examples.

That is your and Vladislav's mistake, that you think that the Fourier series applicable to a periodic function is the Fourier transform.

I have said several times - it is a special case, not applicable to the market.

Study the primary sources.

Here are some quotes from Wikipedia:


Fourier transform is also applicable to functions defined on limited intervals since such functions can be periodically extended on the entire line.

The Fourier series is a particular case of the Fourier transform, if the latter is understood in the senseof generalized functions. For any 2π-periodic function we have


In other words, the Fourier transform of a periodic function is a sum of point loadings at integer points, and equals zero outside them.


 
Nikolai Semko:

No, this algorithm for finding harmonics does not use fast Fourier transform, butuses Queen-Fernandez frequency calculation algorithm. (source code) By the way, aren't you the author? The name is the same, but the profiles are different.

The frequencies are calculated sequentially and are not multiples of each other. This can be seen both from the animated gif and from the code I presented above and now.
Here is an example of harmonic frequencies coefficients from this example (just printed w):

I have to repeat the question about the differences between the method you propose and the Fourier series:

"What is wrong with your method? Do the values of the first decomposition coefficients change when the number of harmonics considered changes?"

I don't know how to find out from an animated graph for 40 frequencies whether the coefficients for the slowest harmonic out of 40 are constant. Please don't refer to the variables in your code. The question about the meaning of the 40-harmonic expansion becomes key if adding the forty-first harmonic to the expansion can even change the coefficients of the first harmonic, for example.

Say Yes or No. Or less strictly, anything at all.

Let the Fourier series have this question solved unambiguously, "No". As well as in Taylor series and other decompositions, which have already brought and continue to bring undoubted benefit. Suppose in your case it is not so unambiguous, but you too should have some idea about the stability of the expansion coefficients by your proposed method.

 
Vladimir:

I have to repeat the question about the differences between the method you are proposing and the Fourier series:

"Why, do you do it differently? Do the values of the first decomposition coefficients change when the number of harmonics considered changes?"

I don't know how to find out from an animated graph for 40 frequencies whether the coefficients for the slowest harmonic out of 40 are constant. Please don't refer to the variables in your code. The question of the meaning of the 40 harmonic expansion becomes key if, when adding the forty-first harmonic to the expansion, the coefficients of the first harmonic can even change sign, for example.

Say Yes or No.

This is not my method, although I have some ideas on how to speed it up. I gave links to the source code and to the authors of this method.

And most importantly, there's code. Are you not a programmer? But you can understand the code, it's simple and transparent.
If you look into MathFourier2 function code, the answer is obvious - of course not. Adding a new harmonic does not change the previous ones.

If you find that the harmonics have changed, it means that the input data has changed. You moved the mouse with shift or ctrl pressed, or a new bar came.

And please do not ask me more questions, which you can answer yourself, having the code and the article of this method.

We are not at the exam. I am sorry for my time.

I am resetting the code once again.

To control this indicator, first click on the chart with the mouse (to activate the window), press Ctrl (and release it) and move the mouse to change the start position, to finish the process, press any key (except Ctrl and Shift). Same with the Shift key to change the period (range of bars to calculate the approximating function)and the number of harmonics.

Files:
7Fourier.mq5  16 kb
 

In general, the task, as I understand it, is that we have data (probably the opening or closing prices of a bar) for a certain period, and we need to describe fluctuations in this sample in some way, but it should be a function, so that at the next fluctuation we can understand which point refers to a new figure. As a result, we should get an additional numerical value to each price, which will show which "part" of the function the fluctuation belongs to, a kind of classification, which will allow to say that the original point belongs to a certain space. Such a method can sometimes have an effect in the case of MO. Since the function is not initially known, but is expected to exist, there is a need to generate different functions to partition the digits in the sample into groups. I.e. it is some method of classification not by features, but by structure and attributes.

This is my guess.

 
Aleksey Vyazmikin:

It should have been clear a long time ago, I gave you the links. The question is implementation. There is a whole layer of fast, efficient algorithms that can be used in conjunction with the cloud

You have only time to learn the basics. R and Python have long had everything, of course.
 
Maxim Dmitrievsky:

It should have been clear a long time ago, the links have been given. The question is implementation. There is a whole layer of fast, efficient algorithms that can be used, including in conjunction with the cloud.

I don't have time to study the code. I've been working in R and Python for a long time now, of course.

After reading the thread, I didn't see any understanding from the audience, so I decided to rephrase, maybe someone will understand the essence of the matter in this presentation.

If this has already been implemented in other languages, why can't we port the code to MQL5?

 
Aleksey Vyazmikin:

After reading the thread, I haven't seen any understanding from the audience, so I decided to rephrase it to see if anyone understands what I'm talking about.

If this has already been implemented in other languages, why can't I port the code to MQL5?

I just asked if anyone has done this to save time.

what a stupid question.

Reason: