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

 
Alexander Ivanov:
Did Reshetov introduce himself to God?

There are such rumors, I was not present at the funeral.

 

This is not related to trading, just an interesting experiment.


The Principal Component Approach (PCA) can be used to suppress noise in the data, and I wanted to see how it would work to clean up noisy images.

I took the image http://sites.psu.edu/siowfa15/wp-content/uploads/sites/29639/2015/10/Fall-beautiful-nature-22666764-900-562.jpg, added noise to it.

This image can be represented as a matrix. The height of the matrix is equal to the height of the picture, and the width of the matrix = width of the picture x3 (since the 3 color channels are red, blue, green).
And then you can use the common R tools to find the main components, leave only the most important ones, and from them try to reconstruct the original image. The idea is that information about noise will be stored in less important components, and by discarding them, we will discard noise too.

This is what happened.

Although the image quality has suffered, there is no more grain. And for some algorithms for object recognition, the second image may be more suitable.

Files:
 

A less coarse filter. You can change the filter values in the script(SIZE_REDUCTION)


 
Dr. Trader:

A less coarse filter. You can change the filter values in the script(SIZE_REDUCTION)


Replacing one noise with another :D

Such grainy images, by the way, are very easily fooled by NS of computer vision. I've seen somewhere an article about noisy road signs which confuses the computer vision system with recognition of signs :)

You are good at R, what prevents you from trying Recurrence plots https://en.wikipedia.org/wiki/Recurrence_plot

let's say, convert the graphs to recurrence plots and teach the convolutional NS to these images, then after learning feed a piece of the graph in the converted form, get the resulting image (prediction) and then do the reverse conversion to the normal form

Intuitively, recurrence plots will be recognized by computer vision much easier than time series, without loss of meaningful features.

But you have to check it.

 
Dr. Trader:

Although the image quality has suffered, there is no more grain. And for some algorithms for object recognition, the second image may well be more suitable.

In my opinion, the picture shows overoptimization - the loss of data for making the right decision.
 
Maxim Dmitrievsky:

You are good at R, what prevents you from trying Recurrence plots https://en.wikipedia.org/wiki/Recurrence_plot

let's say, convert graphs into recurrence plots and teach convolutional NS to these images, then after training give a piece of graph in transformed form, get the resulting image (forecast) and then do the reverse transformation to the normal form

Intuitively, recurrence plots will be recognized by computer vision much easier than time series, without loss of meaningful features.

But I have to check.

I haven't tried Recurrence plot, but its description is very similar to Arima, that model also looks for recurrence dependencies.

Also you can draw the autocorrelation graph with functions acf() and pacf(), it will be somewhat similar to Recurrence plot, but the graph will have a vector instead of the plane.

 
Dr. Trader:

Recurrence plot has not been tried, but according to the description it is very similar to Arima, this model also looks for recurrence dependencies.

You can also draw the autocorrelation graph with functions acf() and pacf(), it will be somewhat similar to Recurrence plot, but the graph will have a vector instead of the plane.


well the main advantage here is that the entire space is always filled with the plot, not like a regular top-down or bottom-up plot there. It will be easier to identify for the machine genius, and the peculiarities of the drawings will talk about certain patterns of a particular pattern
 
Maxim Dmitrievsky:

Intuitively, recurrence plots will be recognized by computer vision much easier than time series, without loss of meaningful features.

But it is necessary to check.

I tried and I think I even wrote about it, the result is the same as with BP.



The problem is that the market constantly generates different BPs, the past signals will never repeat in the future if we look at the market through BPs or any BP transformations, it means that working with such signs is useless for IRs and for humans too, by the way...

 
Dr. Trader:

It has nothing to do with trading, just an interesting experiment.

Thank you! This method can also be used to clean sounds from noise, e.g. old or damaged recordings, by removing their noise components... But these are all tasks of spectral analysis and it can be done not only with PCA but also with Fourier or wavelets
 
Dr. Trader: The principal component method (PCA) can be used to suppress noise in data, I wanted to see how it would work to clean up noisy images....

Leaving aside the existence of a large number of filters for similar tasks,
in Photoshop, etc., try other downsampling algorithms as well.
ICA, NMF, SVD, etc.
But since you are interested in auto approach with DM elements, you can use clustering, for example.
K-Means,EM-c, DBSCAN, t-SNE etc.
1. Try to catch noise.
2. If you manage to do it well, remove it.
3. Replace the voids with the nearest neighbor, etc.
Then we give you pictures with different noises and see how they look.
If you can not - put the girl with pencils, let him retouch)))

Reason: