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

 
Five pages of arguments about an imaginary error in a function that nobody needs in this thread, in the thread about machine learning, something is clearly wrong in this world...
 
Alexey Burnakov:

There is a dialogue with Quantum, but he is dead set against answering the question of why what he is doing is "Right. Simply because there is no one right point of view on this issue.

We need to figure out how the infinity that dgamma(0,0.5,1) gave out disappeared, why it was there, but the result of its "integration" was finite.

You're saying that you can just take a limit and not zero out the point x=0 by hand in the definition of density, as Mathematica and Matlab do, and get a reasonable result.

How do you work with obtained infinity at point x=0?

Does the obtained result coincide with derivative of incomplete gamma-function at point x=0?
 
Renat Fatkhullin:

Today we'll publish a beta and show another bump with graphical libraries to replace plot in R.

Will it be possible to save graphics? I need batch processing of data with output of graphs for a long time....

Renat, it seems to me that I should have said that you're not creating an R handler, but an alternative with possibilities to catch up with R in the future. I don't use R but I find new functions interesting to use in the future. Couldn't you make a library with sharpening for OpenCL at once?

 
-Aleks-:

Will it be possible to save graphs? I need batch processing of data with output of graphs for a long time....

Renat, it seems to me that I should have said that you're not creating an R handler, but an alternative with possibilities to catch up with R in the future. I don't use R but I find new functions interesting to use in the future. Is it possible to make a library with OpenCL sharpening at once?

We will. The graphics are kanvas-based and we will add saving to a BMP file in the release version.

Today in a couple of hours we will release beta on MetaQuotes-Demo with graphics library and extended statistical. Feel free to try it yourself: https://www.mql5.com/ru/forum/97153/page10#comment_3831485.


Of course, we create our own implementation of math libraries.

Our advantage is that now it will be faster and easier to create complex mathematical robots directly within the platform without any DLL. After all, analytics is not self-valuable and it requires an application domain.

Обсуждение статьи "Статистические распределения в MQL5 - берем лучшее из R и делаем быстрее"
Обсуждение статьи "Статистические распределения в MQL5 - берем лучшее из R и делаем быстрее"
  • www.mql5.com
Опубликована статья Статистические распределения в MQL5 - берем лучшее из R и делаем быстрее: Автор: MetaQuotes Software Corp...
 
Quantum:
What function are you talking about? What parameter?
I'm about that, from the article https://www.mql5.com/ru/articles/2742#Errors_R, section 6. The detected calculation errors in R
> n <- 5
> k <- seq(0,1,by=1/n)
> gamma_pdf<-dgamma(k, 1,1, log = FALSE)

if you make this code more readable, and without vector X, it would look like this

> dgamma(x=0, shape=1, rate=1, log=FALSE)
[1] 1
> dgamma(x=0.2, shape=1, rate=1, log=FALSE)
[1] 0.8187308
> dgamma(x=0.4, shape=1, rate=1, log=FALSE)
[1] 0.67032
> dgamma(x=0.6, shape=1, rate=1, log=FALSE)
[1] 0.5488116
> dgamma(x=0.8, shape=1, rate=1, log=FALSE)
[1] 0.449329
> dgamma(x=1, shape=1, rate=1, log=FALSE)
[1] 0.3678794

The supposed error is that
dgamma(x=0, shape=1, rate=1,log=FALSE)== 1

According to the formula in the R help file, this is calculated using the formula
f(x)= 1/(s^a Gamma(a)) x^(a-1) e^-(x/s)
(shape= a and scale= s,forx ≥ 0,a > 0 ands > 0)
scale is 1/rate by default

The problem is that in this case x^(a-1) = 0^(1-1) = 0^0, which is undefined, i.e. there is no point in calling a function with this parameter and there is no point in comparing results with other software. For 0^0 in different software can be different, depending on the religion of the developers.
 

This is what we do with statistics. We are just users. We can say something, but it will not be statistically significant.

I entered into correspondence with R support (the stats package included in the base). asked them why the values of 1 or inf. And whether it is safe to use it in the work, given that other giants can define a value of zero equal to zero.

If you translate your article into English, it will be much easier for me: I will give you a link to the section where "bugs", real and fictitious, are corrected. You can show this link to the R support team and ask them.

 
Dr.Trader:
I'm about that, from the article https://www.mql5.com/ru/articles/2742#Errors_R, section 6. The detected errors of calculations in R
> n <- 5
> k <- seq(0,1,by=1/n)
> gamma_pdf<-dgamma(k, 1,1, log = FALSE)

if you make this code more readable, and without vector X, it will look like this:

> dgamma(x=0, shape=1, rate=1, log=FALSE)
[1] 1
> dgamma(x=0.2, shape=1, rate=1, log=FALSE)
[1] 0.8187308
> dgamma(x=0.4, shape=1, rate=1, log=FALSE)
[1] 0.67032
> dgamma(x=0.6, shape=1, rate=1, log=FALSE)
[1] 0.5488116
> dgamma(x=0.8, shape=1, rate=1, log=FALSE)
[1] 0.449329
> dgamma(x=1, shape=1, rate=1, log=FALSE)
[1] 0.3678794

The supposed error is that
dgamma(x=0, shape=1, rate=1,log=FALSE)== 1

According to the formula in the R help file this is calculated by the formula
f(x)= 1/(s^a Gamma(a)) x^(a-1) e^-(x/s)
(shape= a and scale= s,forx ≥ 0,a > 0 ands > 0)
scale is 1/rate by default

The problem is that in this case x^(a-1) = 0^(1-1) = 0^0, which is undefined, i.e. there is no point in calling function with such parameter and there is no point in comparing results with other software. For 0^0 in different software can be different, depending on the religion of the developers.
Thank you. I've been trying to make that point for two days now. But, apparently, religious views are dangerous to touch...
 
0^0, which is undefined, i.e. there is no point in calling the function with this parameter, and there is no point in comparing the results with other software. For 0^0 in different software can be different, depending on the religion of the developers.

I'm an amateur, but Vasya Guglin thinks so )) who has longer - Vasya Guglin or wolfram?) just kidding, of course.


 
Renat Fatkhullin:

There will be. The graphs are based on canvas and we will add the function of saving to BMP file in the release version

Today in a couple of hours we will release beta on MetaQuotes-Demo with graphics library and extended statistical. You can try it yourself: https://www.mql5.com/ru/forum/97153/page10#comment_3831485

Great news, thank you!

Renat Fatkhullin:


Of course, we create our own implementation of math libraries.

The advantage of this release is that it will be faster and more convenient to create complex mathematical robots directly in the platform without any DLL. After all, analytics is not self-valuable and requires an application domain.

It's good, but we need more information about the usefulness of these data processing techniques for trading. I max what I apply is linear regression - I understand what it can give in practice, but other clever stuff, how it is applicable to data analysis for decision making - I would like to know.

And, you did not say anything about the possibility of using OpenCL in the library - are there plans to speed up its work by distributing computational tasks within the function - there is always a temptation to increase performance at the expense of the video card?

 
-Aleks-:

Great news, thank you!

And, you didn't answer anything about the possibility of using OpenCL in the library - are there plans to speed it up by distributing computational tasks within the function - there is always a temptation to increase performance at the expense of the video card?

You will probably be offered to use these functions yourself if needed https://www.mql5.com/ru/docs/opencl.

I have an old video card, OpenCL doesn't seem to support it. If they put support right inside the library, what will happen? will there be an error on cards like mine or what?

Документация по MQL5: Работа с OpenCL
Документация по MQL5: Работа с OpenCL
  • www.mql5.com
Работа с OpenCL - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5