Discussion of article "R-squared as an estimation of quality of the strategy balance curve" - page 3
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
In the paper, linear regression is considered with an error - via CLinReg::LRLine.
Proof
Result
The sign is incorrect. The alternative LR implementation (CAlglib::LRBuild + CAlglib::LRUnpack) counts correctly:
This is where I was wrong. For me it is not an obvious statement at all
So I decided to experimentally confirm it through animation (I can't just take your word for it).
It looks like it's true.
This is really cool. This animation should be inserted into the article! If you don't mind, I'll do it.
In general, all statistics is a field for hoolivar.
But, the article is interesting in two directions:
I don't know, I checked for equality, the system LR squared is exactly equal to R^2. As for the sign - it seems to be difficult to make a mistake here.
You have to run this code several times until you can see the difference in sign. The chart specially displays a graph for self-checking - R2. And R is your calculation algorithm.
You can see that R differs sometimes from the exactly correct R2. It would be necessary to adjust somehow your way of calculating regression so that the sign coincides, because it is an order of magnitude faster than the check one.
Probably, you should provide the source array, which shows the error. Then it will become obvious at once.
This is very cool. This animation should be inserted into the article! If you don't mind, I will do it.
Then the code of animation would be good to finish you to a normal state, because I did it myself on a hastily hand in bush conditions. And gifku, respectively, to make more visual.
Equity for R^2 calculation should be calculated not as AccountEquity ( == AccountBalance + Sum(Profit[i])), but as Sum(Profit[i] / Lots[i]) (for one-character TS).
What if the MM of the strategy is based on the SL size, and the SL itself is dynamic?
Two neighbouring trades can have different lots and, accordingly, profit when taking the same number of pips.
Although the risk per trade will be the same.
What if the MM of the strategy is based on the SL size, and the SL itself is dynamic?
Two neighbouring trades can have different lots and, accordingly, profit when taking the same number of pips.
Although the risk per trade will be the same.
I don't understand what changes in this situation.
I don't see what makes a difference in this situation.
Yeah, I'm dumb. Dividing by lot would give the same result.
The author shows a complete lack of understanding of chance processes. All conclusions of the article have nothing to do with the very concept of chance and mislead people.
Let me explain this opinion.
At the very beginning of the article, a definition is given:
Linear regression is a linear dependence of one variable y on another independent variable x, expressed by the formula y = ax+b. In this formula, a is the multiplier and b is the bias coefficient
Linear regression is NOT expressed by the formula
y = ax+b is a linear equation formula,
but is expressed by the formula
y = ax+b + error
The error must be NORMALLY DISTRIBUTED, and if it is not, there are many nuances that arise that very much limit the application of linear regression.
It is extremely important to realise that linear regression coefficients, unlike linear equation, are NOT constants, they are chance values and if you take a standard linear regression fit, e.g. in R, then always for linear regression coefficients the deviation from that value of coefficients, as well as the probability (probability in the null hypothesis of NOT EVIDENCE OF THIS COEFFICIENT) is specified. Once again: unlike a linear equation, linear regression coefficients may not exist at all. That is why the R2 coefficient discussed in the article makes sense only for regressions in which the probability of non-existence of the regression coefficients is below 10%. On financial series, I have never seen that the coefficients of linear regression are significant and, therefore, it is possible to use this very linear regression.
In the paper, linear regression is considered with an error - via CLinReg::LRLine.
Proof
Result
The sign is incorrect. The alternative LR implementation (CAlglib::LRBuild + CAlglib::LRUnpack) counts correctly:
Yes, with an error, you are correct, the best result is determined among lossy sets, although there are positive ones with the same R2
Everything is OK with your version:
the criterion for finding a linear function called "Linear Regression" is the MNC of variances or which is the same thing - maximising the absolute value of Pearson's RQ, which is MathAbs(LR). And maximising MathAbs(LR) is the same as maximising R^2, since MathAbs(LR) = MathSqrt(R^2).
The MNC of the outliers is MathMin((Sum(X[i] - LR[i])^2)).
What is desired is quite different - MathMin((Sum(X[i] - LR[i])^2 * (i / Length)^2)). That is, even a large error at the beginning of the interval may have a smaller effect on the result than a small error at the end of the interval.
Classical LR does not take this into account, all errors are "equal" there.
Please suggest a function in R that gives different weights to errors.