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

 

One of the directions could be to search not for the best, but for the most stable parameters of the TS. i.e., to discard those variants that have variability of results in different parts of history.

One way is to include indicators of stability of results in the evaluation criteria.

 

There is a great package on Bayesian optimisation...

You can do multi-criteria optimisation, optimisation on functions with noise and many other things, very interesting package.

I made a toy example of how the algorithm searches for a minimum in a one-dimensional vector.

library(mlrMBO)

set.seed(123)
xx <- cumsum(rnorm(1000))
par(mar=c(2,2,2,2))
plot(xx,t="l")

fun = function(i){
  plot(xx,t="l",col=8)
  points(i,xx[i],col=4,lwd=4)
  return(xx[i])
}

obj.fun = makeSingleObjectiveFunction(name = "noisy_parable", 
                                      fn = fun,
                                      has.simple.signature = TRUE, 
                                      par.set = makeNumericParamSet("i", 1, 1, length(xx)),
                                      noisy = F)


ctrl = makeMBOControl(final.method = "best.true.y", final.evals = 10)
ctrl = setMBOControlInfill(ctrl, crit = crit.eqi)
ctrl = setMBOControlTermination(ctrl, iters = 40)

configureMlr(on.learner.warning = "quiet", show.learner.output = F)
res = mbo(obj.fun, control = ctrl, show.info = T)

points(res$x$i, xx[res$x$i] , col=2,lwd=5, pch=10)
Bayesian Optimization and Model-Based Optimization of Expensive Black-Box Functions
  • mlrmbo.mlr-org.com
Flexible and comprehensive R toolbox for model-based optimization (MBO), also known as Bayesian optimization. It implements the Efficient Global Optimization Algorithm and is designed for both single- and multi- objective optimization with mixed continuous, categorical and conditional parameters. The machine learning toolbox mlr provide dozens of regression learners to model the performance of the target algorithm with respect to the parameter settings. It provides many different infill criteria to guide the search process. Additional features include multi-point batch proposal, parallel execution as well as visualization and sophisticated logging mechanisms, which is especially useful for teaching and understanding of algorithm behavior. mlrMBO is implemented in a modular fashion, such that single components can be easily replaced or adapted by the user for specific use cases.
 
mytarmailS #:

I still don't get it, there is no way to say with certainty whether the fin. res. is statistically significant or not. or not?

Don't mix two things that are related to the use of the same indicator:

1) Evaluating the result of one TS by this indicator.

2) Selection of one TS from a large number of options by maximising this indicator.

In the first case, the value of the indicator may be statistically significant, but in the second case, it is unlikely.

 
mytarmailS #:

I still don't get it, there is no way to say with certainty whether the fin. res. is statistically significant or not. or not?

1) Are the data the same as in the example?

2) Maybe in the new R the names of the function arguments have changed

1. yes

2. Maybe - switched on 3.5.0 - requested the library - installed it and again some errors.

installing the source package ‘inTrees’

trying URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/inTrees_1.3.tar.gz'
Content type 'application/octet-stream' length 16771 bytes (16 KB)
downloaded 16 KB

ERROR: dependency 'arules' is not available for package 'inTrees'
* removing 'C:/Users/S_V_A/Documents/R/win-library/3.5/inTrees'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘inTrees’ had non-zero exit status
 
Aleksey Vyazmikin #:

1. yes

2. Maybe - switched on 3.5.0 - requested the library - installing and again some errors.

see what arguments the function takes

?embed

in the version that had the error with this function.

I wrote it!

 
Aleksey Nikolayev #:

Don't mix two things that involve using the same indicator:

1) Evaluation of the result of one TC on this indicator.

2) Selection of one TS from a large number of options by maximising this indicator.

In the first case, the value of the indicator can speak about statistical significance, but in the second case - hardly.

In simple words, if I evaluate one TS by statistical significance, it is good,

if I have 100 TS and I choose the best one by the same criterion, it's bad?


I must have misunderstood something? It can't be right either?

 
Andrey Dik #:

One of the directions may be to search not for the best, but for the most stable parameters of the TS. i.e., to discard those variants that have variability of results in different parts of history.

One way is to include indicators of stability of results in the evaluation criteria.

What is your variant of stability evaluation? We've been discussing two options recently.
 
mytarmailS #:

see what arguments the function takes

in the version in which there was an error with this function.

I wrote it!

embed {stats}   R Documentation
Embedding a Time Series

Description

Embeds the time series x into a low-dimensional Euclidean space.

Usage

embed (x, dimension = 1)
Arguments

x       
a numeric vector, matrix, or time series.
dimension       
a scalar representing the embedding dimension.
Details

Each row of the resulting matrix consists of sequences x[t], x[t-1], ..., x[t-dimension+1], where t is the original index of x. If x is a matrix, i.e., x contains more than one variable, then x[t] consists of the tth observation on each variable.

Value

A matrix containing the embedded time series x.

Author(s)

A. Trapletti, B.D. Ripley

Examples

x <- 1:10
embed (x, 3)
[Package stats version 4.0.2 Index]
 
Aleksey Vyazmikin #:

It's fine, it should work.

Are you sure you didn't change the code? Show me the code where the error occurs.

 
mytarmailS #:

It's okay, it should work.

Are you sure you didn't change the code? Show me the code where the error occurs.

No, I didn't change it.