Function Design: Elastic Classifier Functions

Comments None

Writing can be a very creative process and I've been fortunate enough to experience this several times: with my PhD thesis, papers, books, ideas journals… and now blog posts.

The new elastic classifier functions are an example of flash inspiration that just came to me while I was writing the post "Function Design: New 3-6 Output Functions". I had just finished describing how the mapper functions worked when another new class of functions just came to me almost without conscious effort, and I just kept writing and thinking: "Now I just need to check how they work."

I had to postpone my post and wait for the next day to implement and test these new functions. I ended up designing four new 3-output elastic classifiers, that are elastic versions of the 3-output classifier functions described in the posts "Function Design: The BUY-SELL-WAIT Function" and "Function Design: More 3-Output Classifier Functions".

So, the first elastic classifier function in the series – ECL3A – is a function of 3 arguments and implements an elastic version of the BUY-SELL-WAIT function (implemented as CL3A in GeneXproTools). And its performance is even better than the BUY-SELL-WAIT function, with 98% vs 96%! And here's the C++ code for this new function:

    // ECL3A(x0,x1,x2): 3-Output Elastic Classifier Function
    if (x[1] > x[0] && x[2] < x[0])
        return 1.0;
    else if (x[1] < x[0] && x[2] > x[0])
        return -1.0;
    else return 0.0;

The second function in the series – ECL3B – is the elastic counterpart of the CL3C function. Both these functions perform quite well, both of them with a high hit rate of 98%:

    // ECL3B(x0,x1,x2): 3-Output Elastic Classifier Function
    if (x[1] > x[0] && x[2] > x[0])
        return 1.0;
    else if (x[1] < x[0] && x[2] < x[0])
        return -1.0;
    else return 0.0;

The third function in the series – ECL3C – is an elastic implementation of the CL3B function and it performs slightly worse than the inelastic form, with 95% vs 97%:

    // ECL3C(x0,x1,x2): 3-Output Elastic Classifier Function
    if (x[1] >= x[0] && x[2] >= x[0])
        return 1.0;
    else if (x[1] <= -x[0] && x[2] <= -x[0])
        return -1.0;
    else return 0.0;

And finally, the fourth function in the series – ECL3D – is also an elastic version of the CL3B function, with the difference that it uses the first 2 arguments as anchoring points that work as reference for the mapping. This function performs slightly better than the CL3B function (98% vs 97%) and also better than the ECL3C described above (98% vs 95%):

    // ECL3D(x0,x1,x2,x3): 3-Output Elastic Classifier Function
    // evaluate min(x,y) and max(x,y)
    double min = x[0];
    double max = x[1];
    if (min > x[1])
        min = x[1];
        max = x[0];

    if (x[2] >= max && x[3] >= max)
        return 1.0;
    else if (x[2] <= min && x[3] <= min)
        return -1.0;
    else return 0.0;

Over the next posts I'll start talking about the implementation of all these new math functions in all the programming languages supported by GeneXproTools.



There are currently no comments on this article.


Enter your comment below. Fields marked * are required. You must preview your comment first before finally posting.

← Older Newer →