Machine learning in trading: theory, models, practice and algo-trading - page 2453

 
Andrey Dik #:
absolutely.
However, no one forbids the use of more complex and/or complex metrics. the main idea is to add to the fitness function a metric for weights and NS outputs.

I don't know, but in my opinion it will work if the input data are qualitatively normalized (uniformly ) and only for a regular multilayer Perspectron

and if you use ready-made NS packages, your new metrics will be dropout spoiled


although maybe you are looking for something similar to annealing optimization, but again, the techniques are described, the purpose of creating a bicycle is not clear, and even more so how reliable it is and how to evaluate it, imho

 
It is better to start reinventing the wheel for simpler small models, for example linear regression. Only first you should look carefully at already available options for adding coefficients to the loss function (comb and lasso regression, Akaike's criterion, etc.)
 
Andrey Dik #:

on a test...? the test is the same as the derivative of a function, can be the same curve, tangent at the same point but to two different functions.


Did you understand what you said? The set of words makes no sense.

 
Vladimir Perervenko #:

О !! Hello Vladimir, what is it that you do not hear for a long time was, very much missed your articles, do not write anything new? Maybe on other resources?

There's also a question to you, there is a "Gaussian optimization" (I'm sure you know), it's like the most effective search method for "heavy" fitness functions, but I can not get good results with it here is my example, can you give a comment on my question, why is it so?

mco vs GPareto (Multi-objective optimization)
mco vs GPareto (Multi-objective optimization)
  • 2021.08.23
  • mr.T
  • stackoverflow.com
I am not an expert in this field, I just wanted to compare two search algorithms. ness function is simple, find two minima in vector I almost always get a bad solution from the GPareto algorithm. I understand that these are different algorithms, but Question is Is this normal? it should be?, or am I doing something wrong? I am...
 
Vladimir Perervenko #:

Did you understand what you said? The set of words makes no sense.

don't know what "derivative" means? sorry....

 
Andrey Dik #:don't know what "derivative" means? sympathy....

You should feel sorry for yourself, with your deductive abilities...

 
mytarmailS #:

О !! Hello Vladimir, what is it that you do not hear for a long time, very much missed your articles, do you write anything new? Maybe on other resources?

There is another question to you, there is a "gauss optimization" (I'm sure you know), it seems to be the most effective method of searching for "heavy" fitness functions, but I can not get good results with it here is my example, can you give a comment on my question, why so get.

Greetings. Articles using R are taboo on this site. That's why it won't be.

Concerning your question, do you want to get an answer here or at Stoke? There are a lot of mistakes and one of them is fundamental.

 
Vladimir Perervenko #:

1) Greetings. Articles using R on the site are taboo. That's why there won't be any.

2) For your question, do you want an answer here or on Stoke? There are many mistakes and one of them is fundamental.

1) Too bad.

2) Where is more convenient for you, it is interesting to know about all my mistakes, both principal and not so...

P.S. That I applied continuous approximation to the discrete optimization problem, I know.


=====

There is a relatively new packet in conjunction with mt5, have you tried it?

https://github.com/Kinzel/mt5R

GitHub - Kinzel/mt5R: Easy integration between R and MT5 using socket connection, tailored to fit Machine Learning users and traders needs
GitHub - Kinzel/mt5R: Easy integration between R and MT5 using socket connection, tailored to fit Machine Learning users and traders needs
  • github.com
Easy integration between R and MT5 using socket connection, tailored to fit Machine Learning users and traders needs - GitHub - Kinzel/mt5R: Easy integration between R and MT5 using socket connecti...
 
mytarmailS #:

1) Too bad.

2) Where is more convenient for you, it is interesting to know about all my mistakes, both fundamental and not so much...

P.S. That I applied continuous approximation to the problem for discrete optimization I know.


=====

There is a relatively new packet in conjunction with mt5, have you tried it?

https://github.com/Kinzel/mt5R

1. It is not relevant to 5. Everything works with the standard library MetaTrader5(Py). It may be so for MT4.

2. A fundamental error. Both packages (mco and Gpareto) are designed for multiobjective and multi-criteria optimization of functions. It means finding the optimal parameters for several functions that give them the minimum result. They do it using different methods.

You are trying to use one function to get a Pareto front. Here is your rewritten example (by the way not the best choice of functions using probabilities)

set.seed(4023)
mins <- function(x, n = 1 L) cumsum(rnorm(n, 0, x))
mins1 <- function(x, n = 1 L)cumsum(rnorm(n,0, x*0.5))

up <-  rep(5,2)
dw <- rep(1,2)

Two functions with different sd parameters and upper and lower bounds. The objective function below

#--------------------------------------------
 fit <- function(x){
    y1 <- mins(x[1])#  cumsum(rnorm(1, 0, x[1]))
    y2 <- mins1(x[2])  #    cumsum(rnorm(1,0, x[2]*0.5))
    #y <- cbind(y1, y2)
    return( c(y1, y2) )}

Fn <- fit(c(4,4))
> Fn
[1] 0.4244075 3.5528975

And the optimization proper.

library(mco)

OPT1 <- nsga2(fn = fit,idim = 2,odim = 2,
                   lower.bounds = dw,
                   upper.bounds = up,
                   popsize = 100)
res_OPT1 <- c(floor(tail(OPT1$par,1)))
> res_OPT1
[1] 4 4

Optimal parameters for these functions with(4, 4). Visualization of ParetoFront + ParetoSet

plot(OPT1)

Pareto_front_Set_mco

The blue dots are ParetoFront, i.e. the set of objective function values. The red dots are ParetoSet, i.e. parameter values giving the minimum function value. You can see these values

> paretoFront(OPT1)
            [,1]      [,2]
 [1,] -18.768766 -0.919960
 [2,] -16.563714 -4.075318
 [3,] -11.689811 -4.511709
 [4,]  -2.924055 -6.256807
 [5,]  -1.801073 -9.175708
 [6,]  -5.438790 -5.876476
 [7,]  -9.924184 -5.006235
 [8,]  -9.150563 -5.749592
 [9,]  -2.565944 -8.321299
[10,]  -5.653256 -5.808398

> paretoSet(OPT1)
          [,1]     [,2]
 [1,] 4.651688 4.830462
 [2,] 4.812924 4.374282
 [3,] 4.692132 4.589676
 [4,] 4.998786 4.715230
 [5,] 4.960933 4.696511
 [6,] 4.973955 4.245543
 [7,] 4.708673 4.946008
 [8,] 4.630083 4.242298
 [9,] 3.913589 4.553322
[10,] 4.655140 4.648080

After rounding we obtain the optimal value of c(4,4). The variant with Gpareto in the next post

 
Vladimir Perervenko #:

1. This is not relevant for 5. Everything works with the standard library MetaTrader5(Py). But for MT4 - maybe.

It is just for P5, it is a new package, the very name is mt5R.

Vladimir Perervenko # :

2. There is a fundamental error. Both packages (mco and Gpareto) are designed for multi-objective

Yes, I understand I need a multiobjective optimization.

Vladimir Perervenko #:

You are trying to get a Pareto front using one function. Here's your rewritten example(by the way not the best choice of functions using probabilities)

My simple fitness function just looks for a vector index of a point that is a minimum from the point of view of the algorithm.

Ideally the algorithm should output two indexes, these two indexes will be the indexes of the minimum values in the vector

I thought there is no difference to look for two minima in one vector or one minimum in two vectors

My simple fitness is not a model of my problem, I just wanted to make the most simple and clear comparison of the algorithms work for myself

Vladimir Perervenko #:

Optimal parameters for these functions with(4, 4). ParetoFront + ParetoSet visualization

What does your fitness function do? The code seems to be clear, I know all but I can't understand it)

Reason: