Bayesian regression - Has anyone made an EA using this algorithm? - page 29

 
Yuri Evseenkov:

A kind of multiplayer, computer-based online simulator

It's in sync with futures, so not really.

 
Комбинатор:

With futures going in sync, so not really.

What kind of futures? RTS ? On one forum of traders there was a discrepancy between the game outline of the Moscow Exchange and the real outline of the same exchange. And if it is synchronous with forex, it means that we have an excellent simulator.
 
Yuri Evseenkov:
CME ))
 
Yuri Evseenkov:

Convinced. Almost. There remains a shadow of doubt that coefficients a and b of lines y=ax+b will be numerically or approximately equal when calculated by different methods. Here you should either painstakingly compare formulas of two methods or write a program. The main thing is that formulas, algorithm and code itself should be adequate to the theory. The program must:

-calculate the coefficients of a and b of the linear regression y=ax+b using the method of least squares

-obtain the coefficients of a and b, at which the probability by Bayes' theorem is maximal when applying the normal distribution with mathematical expectation equal to ax+b

Then we need to compare those coefficients and, in case of a considerable difference, look at the behavior of the two lines based on those a and b in dynamics. For example, in the strategy tester in visualization mode.

The program can be further used using other models, regressions, distributions with the Bayes formula. Maybe something will shoot really well.


It is unlikely that the result of trading on the regression model will strongly depend on the method of selecting parameters a and b. The inputs are much more important. And choose the simpler (least squares) method for calculating a and b.
 
Комбинатор:
CME ))
Oh yeah! Chicago stock exchange is awesome! Can't argue with that.
 
Vladimir:
It is unlikely that the result of trading on a regression model will depend much on the method of choosing the a and b parameters. Inputs are much more important. And choose the simpler (least squares) method for calculating a and b.

Thanks for the advice. But the Bayesian methodology gives you something that other methods don't. Namely, probability. The probability that the coefficients a and b correspond to x and y, time and price. This can be used in making entry and exit decisions. Or am I wishful thinking?

 

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)

The probability function P(x,y|a,b) is taken as the 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.


Files:
 
Yury Reshetov:

Throw out the normal distribution, because it is not observed anywhere in financial instruments. And instead build a histogram of the real density of the distribution and approximate it.


It is possible to construct it. But how can it be applied to the Bayes formula?


 
Yuri Evseenkov:

It is possible to construct it. Only how can it be applied to the Bayes formula?


And instead of it, build a histogram of the real density of the distribution by yourself.

The density is not the prices themselves, but their increments.

 
Yuri Evseenkov:

I checked. I made a program which obtains coefficients a and b at which the probability according to Bayes' theorem is maximal when applying normal distribution with expectation equal to ax+b.

...

Cool! Absolutely.

Worth a look, compare at the trend start points, there may be a difference there.

Reason: