Bayesian regression - Has anyone made an EA using this algorithm? - page 30
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Tested. Made a program to get the coefficients a and b at which the probability according to Bayes' theorem is maximal when applying a normal distribution with expectation equal to ax+b.
Cool! Definitely.
It is possible to construct it. But how can it be applied to the Bayesian formula?
I made a similar indicator with close price buffers. I have divided the entire calculated interval into 10 parts. I tried to apply a similar algorithm in my Expert Advisor. I was not very impressed.
How to cook it with what?
The density is not the prices themselves, but their increments.
In Bayesian analysis, as they write, the hardest part is determining the a priori probability. When applied to forex, I think it's like this.
We do not know the properties of data located to the right of the zero bar. What is ahead of it? Unknown price distribution, normal-like distribution, Laplace distribution or something else. Which distribution we take as the a priori probability (likelihood function) will determine the resulting probability according to Bayes' formula. The more plausible the a priori probability, the closer to the truth our calculations are.
Cool! Absolutely.
Worth a look, compare at the trend start points, there could be a difference there.
Thank you. It's rare to hear you say that.
I didn't calculate the least squares coefficients. I took the indicator from the kodobase. The coincidence is almost 100%, despite the fact that that indicator is calculated based on closing prices and my method is "Bayesian". I use OHLC as the average value.
Made a similar indicator with closing price buffers. Divided the whole calculated section into 10 parts. I tried to use a similar algorithm in my Expert Advisor. I was not very impressed.
How to cook it with what?
I used the same program as an Expert Advisor on German DAX. It seems to be OK on a quiet market. But as soon as VW gets caught, Draghi says something, North Koreans test a thermonuclear bomb - Gaussian bells immediately break, price ranges with the largest tick volumes no longer attract the price.
Well, it's not that bad. News like this rarely happens. I will have to try with the volume.
I have another problem: I cannot understand some formulas, I need to understand algebraic signs.
The distribution we take as the a priori probability (likelihood function) will determine the resulting likelihood according to Bayes' formula. The more plausible the a priori probability, the closer to the truth our calculations are.
What about your previous post?
https://www.mql5.com/ru/forum/72329/page14
What about your previous post?
https://www.mql5.com/ru/forum/72329/page14
That post confirms this one. There is a normal distribution, but how the profits are, no one knows.
I have made a program which obtains coefficients a and b at which the probability according to Bayes' theorem is maximal when applying a normal distribution with expectation equal to ax+b.
The algorithm is reduced to enumerating possible values of a and b in lines y=ax+b, substituting into Bayes formula P(a,b|x,y)=P(x,y|a,b)*P(a)*P(b)/P(x,y); (1)
P(x,y|a,b) is taken as the likelihood function P(x,y|a,b), which is a normal distribution formula with expectation ax+b. The maximum likelihood measure of the Bayes formula is inversely proportional to the standard deviation.
Straight line (red line) constructed by coefficients a and b (at which probability according to Bayes' theorem is maximal) almost coincided with the same indicator (yellow line) of the linear regression from the kodobase.
Dmitry Fedoseev, Vladimir and other "Copenhagenists" were right.
We got the same plus a probabilistic measure of fit of a,b x and y by Bayes formula. In this case (linear dependence, normal distribution of y, uniform distribution of a and b) it turned out to be inversely proportional to the standard deviation. Perhaps this measure will come in handy in the analysis.
There is a recent article - perhaps you will find it useful...
https://habrahabr.ru/company/itinvest/blog/277337/