
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
Here is an algorithm for solving a system of linear equations and implementation in the form of polynomial regression.
If m=1, it's a line,
at m=2 it's a parabola,
if m=3, there's a cube, and so on.
Based on that, you can build both RMS and probability levels and optimise length and extrapolation.
Although with reliable extrapolation it's not all clear to me yet, can someone enlighten me?
If someone paid attention to it? Or maybe I bring it all up for nothing?
Rosh, why is everything so complicated? How are you going to find coefficients if you don't know beforehand that this particular sample contains what you need? In fact you can make everything simpler! Vladislav said at the very beginning that approximation errors show the order of approximation. And I've already written about it. I can repeat it once again. If we have an equation of the following form: y=ax^2+bx+c, then by approximating the sample with the linear regression channel y1=b1X+c1 you actually obtain the coefficient b1 equal to the coefficient b of the initial equation. Then subtracting the linear regression equation from the first equation we get an equation of the form y=ax^2+c2. That is, you can tell from this equation that the top of the parabola will be shifted by c2 against the x-axis. Also take into account the fact that the vertex of the parabola will be in the middle of the sample. If we take the vertex of the parabola at (0,c2), that is the origin of the sample at the vertex of the parabola we will deal with the equation (y-c2)=ax^2. But of course we don't know the 2x parameters a and c2 in this equation. But we do know how they depend on each other c2=y-ax^2. We also know the points of intersection of the parabola with the x-axis. So we have three points on the x-axis - the vertex and the intersection with the x-axis, by which we need to find the desired parabola. Here I see no other way to solve the problem than to find by successive approximation such a and consequently such a parameter c2 , at which the RMS error of approximation by a parabola will be minimal. And then by the known c2 we can also get the parameter c from the very first equation, due to which we have the full equation of the quadratic function. I think this is what takes most of Vladislava's computational time, since everything else can take a less significant part in terms of computational time.
Good luck and good trends.
Rosh, why is everything so complicated? How are you going to look for coefficients if you don't know in advance that this particular sample has what you need? In fact, you can make everything simpler! Vladislav said at the very beginning that approximation errors show the order of approximation. And I've already written about it. I can repeat it once again. If we have an equation of the following form: y=ax^2+bx+c, then by approximating the sample with the linear regression channel y1=b1X+c1 you actually obtain the coefficient b1 equal to the coefficient b of the initial equation. Then subtracting the linear regression equation from the first equation we get an equation of the form y=ax^2+c2. That is, you can tell from this equation that the top of the parabola will be shifted by c2 against the x-axis. Also take into account the fact that the vertex of the parabola will be in the middle of the sample. If we take the vertex of the parabola at (0,c2), that is the origin of the sample at the vertex of the parabola, we will deal with the equation (y-c2)=ax^2. But of course we don't know the 2x parameters a and c2 in this equation. But we do know how they depend on each other c2=y-ax^2. We also know the points of intersection of the parabola with the x-axis. So we have three points on the x-axis - the vertex and the intersection with the x-axis, by which we need to find the desired parabola. Here I see no other way to solve the problem than to find by successive approximation such a and consequently such a parameter c2 , at which the RMS error of approximation by a parabola will be minimal. And then by the known c2 we can also get the parameter c from the very first equation, due to which we have the full equation of the quadratic function. I think this is what takes most of Vladislava's computational time, since everything else can take less of a computational time.
I don't understand - what are the problems. The parabola equation is sought from the same considerations as the linear regression channel - via MNC. The solution to this system of equations is unambiguous, and it does not require iterations, it is solved head-on.
Zi=Deti/Det , where Zi is the coefficients of the parabola, Det is the matrix determinant, Deti is the matrix determinant obtained by substituting the column of free terms (Ti) into the i column. Similarly, we can apply the same criteria to the resulting curvilinear channel (described unambiguously in the future) - the RMS of the entire sample in the parabola channel is no greater than the RMS of 2/3 of the sample. I'll keep silent about Hurst for now, because I don't have an answer, but I'm about to get around to it :)
HZ I found a 1986 maths reference book, so I'm very clever :)
(Kolmogorov or Demidovich would have been better).
Thank you, I understand. I don't agree with it, though, and I stand by my opinion.
It's VERY good that there is a simple solution that doesn't require iterations. I'm just a bit rusty on linal too :o(. I'll have to have a look at some books too. Rosh, if you've already worked it out definitively, I think all those interested would also be interested to read the full solution you've already sketched out above. And maybe you can even make it a separate article on Alpari?
And here's a kind of course - http://www.exponenta.ru/educat/class/courses/student/la/examples.asp
Here is the algorithm for solving a system of linear equations and the implementation in polynomial regression form.
If m=1 - a line,
at m=2 it's a parabola,
If m=3 - a cube, etc.
Yes, this is exactly what solandr wanted. However, there was a question - to write such a bit tricky code so quickly using my formulas - you need to be a specialist. But I've looked through the code and I've got my own algorithm, at least indexing of matrix terms mirrors my system of equations. Now I see, that ANG3110 has eaten a dog on such things (a branch on a spider I remember) :)
Indeed, I fully support it!!!
Very nice and a Necessary indicator!
ANG3110, could you explain the code? It's hard to make it out right off the bat. Maybe you have your own blog on the forum, where everything is written about this indicator in detail? Thanks in advance for the information.