This repository has been archived by the owner on Aug 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MotorThresholdDetermination.h
54 lines (46 loc) · 1.84 KB
/
MotorThresholdDetermination.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
47
48
49
50
51
52
53
54
#ifndef MOTORTHRESHOLDDETERMINATION_H
#define MOTORTHRESHOLDDETERMINATION_H
#include <vector>
#include <stdlib.h>
#include <iostream>
class MotorThresholdDetermination
{
static const uint16_t kPowerArraySize = 1001;
public:
MotorThresholdDetermination();
virtual ~MotorThresholdDetermination();
double GetConfidenceInterval() const;
void GetPosteriorStatistics(double& outMean, double& outStandardDeviation);
std::vector<double> GetPosteriorFunction();
std::vector<double> GetLikelihoodFunction();
std::vector<double> GetPriorFunction();
std::vector<double> GetMotorThresholdVector();
void UpdateMotorThresholdCandidate();
uint16_t GetNumberOfPulses() const;
bool MotorThresholdSimulation(double inMTCandidate, double inTrueMT);
void AddPowerCandidate(double inPowerCandidate);
void AddMEPResult(bool inMEPResult);
void UpdateBayesianFunctions();
void SetPriorMT(double inPriorMT);
double GetMotorThresholdCandidate();
void ChangeAlgorithm(bool inIsPEST);
std::vector<double> GetLogLikelihoodFunction();
private:
std::vector<double> GetCumulativeProbabilityFunction(double inMT);
void UpdateLikelihoodFunction();
void UpdateConfidenceInterval();
void UpdatePriorFunction();
double _numberOfPulses;
double _motorThreshold;
double _confidenceInterval;
double _priorMean;
double _priorStandardDeviation;
bool _isPEST;
std::vector<double> _logLikelihoodFunction;
std::vector<bool> _MEPResults;
std::vector<double> _powerCandidates;
std::vector<double> _priorFunction;
std::vector<double> _likelihoodFunction;
std::vector<double> _posteriorFunction;
};
#endif // MOTORTHRESHOLDDETERMINATION_H