-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBoost.h
46 lines (45 loc) · 1.46 KB
/
Boost.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#include <vector>
#include "Share.h"
#include "group.h"
#include <stdlib.h>
#include "ExcelDriver\VectorsAndMatrices\Vector.hpp"
#include "ExcelDriver\ExcelDriver.hpp"
#include "ExcelDriver\ExcelMechanisms.hpp"
#include "ExcelDriver\VectorsAndMatrices\Matrix.hpp"
class Boost {
private:
std::vector<Group> ThreeGroups = std::vector<Group>(3);
double threshold = 5;
int times = 30;
Matrix<Vector<double, long>, long> AAR_CAAR = Matrix<Vector<double, long>, long>(3, 2);
public:
Boost() {
for (long r = AAR_CAAR.MinRowIndex(); r <= AAR_CAAR.MaxRowIndex(); ++r) {
for (long col = AAR_CAAR.MinColumnIndex(); col <= AAR_CAAR.MaxColumnIndex(); ++col) {
AAR_CAAR(r, col) = Vector<double, long>(90);
}
}
};
Boost(double thre, int t) {
threshold = thre;
times = t;
for (long r = AAR_CAAR.MinRowIndex(); r <= AAR_CAAR.MaxRowIndex(); ++r) {
for (long col = AAR_CAAR.MinColumnIndex(); col <= AAR_CAAR.MaxColumnIndex(); ++col) {
AAR_CAAR(r, col) = Vector<double, long>(90);
}
}
};
~Boost() {};
Vector<double, long> GetAAR_CAAR(long row, long col);
std::list< Vector<double, long> > GetAARlist();
std::list< Vector<double, long> > GetCAARlist();
const double GetThreshold();
const int GetResampleTimes();
void SetThreshold(double thre);
void SetResampleTimes(int t);
const Group& GetGroup(int index);
Group Sampling(const Group& group);
void WriteGroups(const std::map<std::string, Stock>& allstocks_);
void Bootstrap(const Share& SPY_);
};