Edge effect on the way to the GRAAL - page 2

 
And what wavelets were used, I used Matlab wavelets. The edge effects seem to be less visible there, but of course they are there (they can't help it) I also tried decompositions (approximations) and a neural network. On the data on which the network learned very cool. and learns mesh seems easy, but on the new ones - hell. I have come to a conclusion that wavelets are a good thing, especially if lag space is applied. But so far I haven't applied it in practice.
 
vladevgeniy писал(а) >>
And what kind of wavelets did you use, I used Matlab ones. There seems to be less edge effects, but of course they are there (they can't help it) I also tried to apply decompositions (approximations) and a neural network. On the data on which the network learned very cool. and learns mesh seems easy, but on the new ones - hell. I have come to a conclusion that wavelets are a good thing, especially if lag space is applied. But so far I haven't applied it in practice.

Used Dobeshi wavelets. They say that Meyer wavelets are less prone to edge effects, but I haven't tried it yet.

The thing is, it costs a lot of time to program each method.

What are the Matlab wavelets? I've never worked in Matlab.

Do you mean polynomials? How well did it work?

 
Desperado писал(а) >>

Crossing levels doesn't give a very attractive result. This has also occurred to me.

In the indicator the distribution of highs and lows follows a Gaussian law, only with different MO.

Highs have approximately 0.3, lows -0.3.

The higher the bar is, the more reliable the signals are and the fewer they are.

And it is not interesting to earn 200 points per month :)

Yes, unfortunately either distortions or lags.

I do not like normal Gaussian distribution. I prefer Lognormal. But that, unfortunately, does not suit everybody. I came to a conclusion that it is reasonable to approximate by fitting (as I wrote above). And if there will be a result, or something interesting, then I will adjust the distribution function. In general deviations are not big, so it can be trusted.

 
Desperado, matlab any matlab toolbox on wavelets. You can get the necessary decomposition and detail and approximation. M function is written, then a transitive dll is used and connected to the metric through a dll. I think there is also a Mayer function, or maybe not, I don't remember. But you can save time on programming, although I had a lot of trouble translating matrixes from Matlab to regular variables and back. I've tried to rewrite the renowned library written in Delphi into C++ (there's plenty of them on the Net). That's where the strongest edge distortions were observed. But Matlab has none of that, although it curves too (it likes to draw hooks at the edges when trending). Try to simply build the required wavelet in Matlab, and if you like the result, you can connect it to Mt through a dll.
 
vladevgeniy писал(а) >>
Desperado, any matlab ones you can find in Matlab's toolbox on wavelets. You can get the decomposition you need and the detail and approximation. M function is written, then a transitive dll is used and connected to the metric through a dll. I think there is also a Mayer function, or maybe not, I don't remember. But you can save time on programming, although I had a lot of trouble translating matrixes from Matlab to regular variables and back. I've tried to rewrite the renowned library written in Delphi into C++ (there's plenty of them on the Net). That's where the strongest edge distortions were observed. But Matlab has none of that, although it curves too (it likes to draw hooks at the edges when trending). Try to simply build the required wavelet in Matlab, and if you like the result, you can connect it to Mt through a dll.

Thank you very much. Actually, that's the delph I used :) Only there was a module, I recycled it into a library.

I'll try to find Matlab first.

 
infinum13 писал(а) >>

I don't like the normal Gaussian distribution. Lognormal is better. But that, unfortunately, doesn't suit everyone either. I came to the conclusion that it is reasonable to approximate by fitting (as I wrote above). And if there will be a result, or something interesting, then I will adjust the distribution function. In general, the deviations are not large, so I can trust this one too.

I tried your algorithm. As expected in principle it removes fine noise. It works well with small periods and large TFs.

I will see what I can do with it.

His result is shown with red line. And I need something like green line.

 

That's the kind of green line you get in Matlab, with large decomposition levels. It's all done with one line of code. There is a special mode of wavelet denoising, where you select the type of wavelet, and there are a few more parameters. The main task is to make a transient dll. That Delph module has very strong edge effects, yes. I don't know how, but in Matlab they are very much reduced - sometimes it even seems that there are none at all.

The latest Matlab is almost 4 gigs on a torrent. )))) Better to use it. Checked and dll compiles well and docks well.

 

From the article in the attachment:

Our application - prediction - points to the critical importance for us of the final values. Our time series is finite, and values n, n-1, n-2, ..., are of greatest interest for us. Any symmetric wavelet function is problematic for the handling of such a boundary (or edge). We also cannot use wavelet coefficients if these coefficients have been calculated from "future" data values. An asymmetric filter can allow us to get around this problem. Such a wavelet function can deal properly with the edge of importance to us. The first values of our time series, which also constitute a boundary, may be arbitrarily treated as a result, but this is of no practical consequence.

An asymmetric function, as I understand it, is based only on previous values of the time series.

Symmetric - on past and future values. For example, here from the CDF 9/7 algorithm:

// Predict 1

a=-1.586134342;

for (i=1; i<n-2; i+=2) {

x[n-1]+=2*a*x[n-2];

}

x[i]+=a*(x[i-1]+x[i+1]);

The edge effects the last line creates.

According to the article, by the way, an indyuke wrote it:

Here each wavelet coefficient is only calculated on the previous values of the row.

It is possible to align, of course:

The unknown region is symmetric functions and filled with something like x[n-1]+=2*a*x[n-2]

It's supposed to be redrawn.

If you want to play with it, click here.

 
vladevgeniy писал(а) >>

That's the kind of green line you get in Matlab, with large decomposition levels. It's all done with one line of code. There is a special mode of wavelet denoising, where you select the type of wavelet, and there are a few other parameters. The main task is to make a transient dll. That Delph module has very strong edge effects, yes. I don't know how, but in Matlab they are very much reduced - sometimes it even seems that there are none at all.

The latest Matlab is almost 4 gigs on a torrent. )))) Better to use it. I checked it and the dll compiles well and docks well.

Sorry for the RTFM style question, but could you please describe in a nutshell,

how to create dll in MathLab and call it from MT4?

If possible, with an example.

 

Oh, I would have had it easy a couple of months ago. I've forgotten all about it. But it's standard in Matlab, there's a description in the manual. In general, you'll find a very good quality help in Matlab. After the compilation a .dll and lib file are created along with a couple of other less important ones. In m file you will have a function in matlab language and this function is called from the intermediate dll. You just need to call the initialization there first, well the helpe has it. However, there is a "but". We need to overload variables double string, etc. into mxArray and then call the function in Matlab and then back into C.

Here is an example of working with mxArray in C

mxArray *inm = mxCreateDoubleMatrix(1,size,mxREAL); mxArray variable with size is created for the input array
memcpy(mxGetPr(inm), &in[0], size*sizeof(double)); it is filled with variables from the input array

then the matlab function is called

then the output array of mxArray is converted into a doble

// ---------------------- convert mxArray to double ------
memcpy(out, mxGetPr(outm), size*sizeof(double))


This is about right now, it's hard to remember exactly.

Inclusions for working with mxArray

#include "mex.h"

are located in the matlab folder

Reason: