Discussion of article "Kernel Density Estimation of the Unknown Probability Density Function" - page 2

 
tol64:

The wishes are accepted here: https://www.mql5.com/ru/forum/6505. Write whatever you want. :)


Thank you. I read it. Once again I am convinced of the correctness of my post to the author of the article.
 

victorg:

And what is important in this case, no interval partitioning is required. The input sequence values themselves are used.


Great, but still I am confused by the rigid binding to the shape of the kernel, and this is a limitation, which does not have, for example, the same splines. And in general, I personally have regression on splines - a hit for the last three years)).

Anyway, thanks for the article, it's useful.

 
alsu:

Great, but still I am confused by the rigid binding to the shape of the kernel, and this is a limitation that does not have, for example, the same splines. And in general, I personally have regression on splines - a hit for the last three years)).

Anyway, thanks for the article, it is useful.

Thanks for appreciation of the article.

Speaking of splines. People always find several different approaches to the same real phenomenon. A typical example is light and its quantum and wave model. The models do not contradict each other, but use absolutely different approaches to representation of process. The light itself does not care how it is described, it shines as it shines.

The situation is similar with splines. Here is a well-known idea of a cubic smoothing spline

Minimise this estimate by any method available to us and we get a smoothing curve. (I'm exaggerating a lot further. Don't hit me.) Different approaches can be used to realise this idea, for example:

  1. Minimising the reduced function can be done, as is often done, by computing a regression on a third degree polynomial for each of the groups of sequence points.
  2. By choosing an appropriate kernel, kernel smoothing (variable kernel shape) can produce the same results.
  3. By representing the expressions describing the cubic smoothing spline in state-space form and using a two-pass Kalman smoothing algorithm for the solution, we again get a realisation of the same idea(Hodrik-Prescott).

It seems to me that the notion of "local nonparametric regression" summarises the above approaches in the best possible way. In this case cubic splines turn out to be only a special case. Of course, this does not in any way diminish the useful properties of splines, it is just interesting that one and the same phenomenon can be approached from different sides.

Unfortunately, in the vast majority of cases the algorithms based on MNC are proposed for use. I'd like to try, for example, the same splines but with quantile regression. It is a pity that I have neither mind nor time for it.

 
victorg:

Thanks for your appreciation of the article.

Speaking of splines. To the same real phenomenon people always find several different approaches. A typical example is light and its quantum and wave models. The models do not contradict each other, but use absolutely different approaches to representation of process. The light itself does not care how it is described, it shines as it shines.

The situation is similar with splines. Here is a well-known idea of a cubic smoothing spline

Minimise this estimate by any method available to us and we get a smoothing curve. (I'm exaggerating a lot further. Don't hit me.) Different approaches can be used to realise this idea, for example:

  1. Minimising the reduced function can be done, as is often done, by computing a regression on a third degree polynomial for each of the groups of sequence points.
  2. By choosing an appropriate kernel, kernel smoothing (variable kernel shape) can produce the same results.
  3. By representing the expressions describing the cubic smoothing spline in state-space form and using a two-pass Kalman smoother for the solution, we again get a realisation of the same idea(Hodrik-Prescott).

It seems to me that the notion of "local nonparametric regression" summarises the above approaches in the best possible way. In this case cubic splines turn out to be only a special case. Of course, this does not in any way diminish the useful properties of splines, it is just interesting that one and the same phenomenon can be approached from different sides.

Unfortunately, in the vast majority of cases the algorithms based on MNC are proposed for use. I'd like to try, for example, the same splines but with quantile regression. Too bad I don't have the mind or time for that.

I don't remember which publication put it into my head that cubic splines have a special place in solving smoothing problems, which (problems) are understood as follows.

Let's take a quotient and start smoothing. The problem with almost any result is that there are breaks (breakpoints) in the original quotient, which lead to changes in the model parameters and often in the functional form. In particular, this manifests itself in the fact that at the resulting junction points of models fitted on different samples, the smoothing function turns out to be undifferentiable on the right-hand side. This leads to the doubtfulness of the prediction one step forward, beyond the boundary of differentiability of the smoothing function. This is a preamble for the next thought. If you smooth with cubic splines, the function will be differentiable both left and right at the junction points.

Regarding the implementation of your idea.

In R, which I know poorly, the table of contents has both splines and Kalman and a variety of estimation methods.

 
victorg:

Unfortunately, in the vast majority of cases the algorithms based on MNC are proposed for use. I would like to try, for example, the same splines, but with quantile regression. It is a pity that I have neither mind nor time for it.

Yep, the differences are there in the results (MNC and quantile I mean). QR is more complicated in calculations, for example, simplex method is exponential, and this is unacceptable. I remember for a long time looking for realisations of polynomial algorithms QR from an internal point, and I found them, posted in the forum on the four somewhere in the old threads. But in terms of regression spline - I do not think it will help much. All the same, the main difference between these methods is the degree of response to single emissions, and here the main trick is the penalty on the integral of the second derivative, and the regression method will not significantly affect the result here.

upd By the way, the ALGLIB mentioned here has a wonderful implementation of the very idea that is in this formula with lambda, if it and a couple of other algorithms are ported to MQL5, this library will be worthless.

 

It turned out that when using Internet Explorer, the example attached to the article does not display graphs. Attached to this message is a corrected version of the example given in the article. This variant was tested with IE-8.0, Opera 11.64, Chrome 19.0.1084.56 and Firefox 13.0(Windows XP SP 3).

Files:
 
Thanks, the article is quite comprehensive on the topic. However, the concept of chaos or spontaneous probability cannot be applied to the market 100% of the time. The only reason is that the main mass of unknowns lies in the graphical candlestick model of the market. It is more important to be able to clearly track and evaluate tick market changes taking into account the real volumes involved in price changes.
 

So what is a practical part from trading point of view of this article ??

Krzysztof

 

This is a very usefull and good article, thanks, however I don't think that the code works properly even the first and simplest example.

I wonder if the author or somebody could recheck the code or someone would recommend any kind of 1D kernel density estimation code on C or MQL?