Introduction
Pretty straight: this is GMDH implementation in C++ (VS), based on AlgLib. Usage example (test) has been included. The only fully implemented and tested polynom is a sigmoid function. Not the "sensational" Kolmogorov-Gabor polynomial.
This is not my code, but code-writers are OK if I publish it, so here it is. Enjoy!
Background
The whole thing is about Stock Exchange and High Frequency Trading (HFT) (see wiki). GMDH is an algorithm useful for short, fast forecasts. As when "model" gets trained, you have formulae, and get immediate results feeding the input samples! But training itself goes for a long time, so model can't be rebuilt too often.
In my diploma work, I have ~55-60% of succeeded forecasts. Input data is pre-processed (somehow), and GMDH model trained on it. Then forecast goes. Output data should also be filtered, as there are ejections (values too much far from trend).
Maybe, I will publish my diploma work later, but yet I don't want, as it can't pretend to be a "real" scientific work, but it can potentially be proof of concept.
Using the Code
You can see usage example in TestAlgLib
project in TestAlgLib.cpp file.
1. Push Training Data
CDataContainer dc; AIDoubleVector vVals;
vVals.push_back(1.0);
vVals.push_back(1.0);
vVals.push_back(2.0);
dc.Init(vVals.size());
dc.AddSet(vVals, 13.0);
2. Train Model
CAIGMDHAlgorithm Algorithm;
CModel model; Algorithm.Init(2);
Algorithm.Train(dc, model, 20, ePolynomSFunction);
3. Test (use) Model
vVals.clear();
vVals.push_back(7);
vVals.push_back(5);
vVals.push_back(2);
PrintResult(vVals, model.GetResult(vVals));