-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrepareRawData.h
30 lines (27 loc) · 1.07 KB
/
PrepareRawData.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
#pragma once
#include "ComputeReturns.h"
namespace MeanVarianceFrontier
{
struct RawData
{
std::string financialDataName;
std::vector<std::pair<boost::gregorian::date, double>> rawData;
};
class PrepareRawData
{
public:
/*PrepareRawData(std::vector<std::vector<std::pair<boost::gregorian::date, double>>> rawDataVector);*/
PrepareRawData(std::vector<RawData> rawDataVector);
void limitDataByDate();
boost::gregorian::date findMaxEarliestDateAmongReturnsData();
void removeAllMissingValues();
std::vector<MeanVarianceFrontier::ComputeDailyReturns> getDailyReturns();
private:
bool allReturnDataSizesMatch();
void removeMissingValues();
std::vector<std::pair<boost::gregorian::date, double>> getIntersectionOfDateReturns
(const std::vector<std::pair<boost::gregorian::date, double>>& reference,
const std::vector<std::pair<boost::gregorian::date, double>>& toModify);
std::vector<MeanVarianceFrontier::ComputeDailyReturns> m_dailyReturnsData;
};
}