ts-aggregator/project_template/Vovk.h

54 lines
1.1 KiB
C
Raw Permalink Normal View History

2022-12-13 12:36:06 +04:00
#ifndef VOVK_H
#define VOVK_H
#include "Method.h"
#include "Preparator.h"
struct AggModel {
char * name;
double weight;
double value;
Method* expert;
};
using namespace std;
class Vovk {
private:
/*int expertsCount = 0;
int activeExpertsCount = 0;
double beta = 0.5;
int step = 0;
double forecast = 0;
double addWeightFromSleepEx = 0.0;*/
int expertsCount;
int activeExpertsCount;
double beta;
int step;
double forecast;
double addWeightFromSleepEx;
vector<double> timeSeria;
Method** models;
void getNewExpertsValues();
void checkExperts();
//ret - log(beta, sum(1..n) weight * pow(beta, L))
double recalculateWeights(double nextRealValue);
//double timeSeriaDiff = 0;
double timeSeriaDiff;
Preparator *prep;
void calculateTimeSeriaDiff(vector<double> timeSeria);
public:
void setBeta(double beta);
bool useSingleTrashhold ;
double forecastHorizont;
double singleTrashhold;
bool useModelTrashhold;
double modelTrashhold;
Vovk(vector<double>, int, Method**);
~Vovk();
double getForecast();
void updateTS(double nextRealValue);
void addMethod(AggModel);
};
#endif