Numworks Epsilon  1.4.1
Graphing Calculator Operating System
normal_law.h
Go to the documentation of this file.
1 #ifndef PROBABILITE_NORMAL_LAW_H
2 #define PROBABILITE_NORMAL_LAW_H
3 
4 #include "two_parameter_law.h"
5 
6 namespace Probability {
7 
8 class NormalLaw : public TwoParameterLaw {
9 public:
10  NormalLaw();
11  I18n::Message title() override;
12  Type type() const override;
13  bool isContinuous() const override;
14  float xMin() override;
15  float yMin() override;
16  float xMax() override;
17  float yMax() override;
18  I18n::Message parameterNameAtIndex(int index) override;
19  I18n::Message parameterDefinitionAtIndex(int index) override;
20  float evaluateAtAbscissa(float x) const override;
21  bool authorizedValueAtIndex(float x, int index) const override;
22  void setParameterAtIndex(float f, int index) override;
23  double cumulativeDistributiveFunctionAtAbscissa(double x) const override;
24  double cumulativeDistributiveInverseForProbability(double * probability) override;
25 private:
26  constexpr static double k_maxRatioMuSigma = 1000.0f;
27  /* For the standard norma law, P(X < y) > 0.9999995 with y >= 4.892 so the
28  * value displayed is 1. But this is dependent on the fact that we display
29  * only 7 decimal values! */
30  static_assert(Constant::LargeNumberOfSignificantDigits == 7, "k_maxProbability is ill-defined compared to LargeNumberOfSignificantDigits");
31  constexpr static double k_boundStandardNormalDistribution = 4.892;
32  double standardNormalCumulativeDistributiveFunctionAtAbscissa(double abscissa) const;
33  double standardNormalCumulativeDistributiveInverseForProbability(double probability);
34 };
35 
36 }
37 
38 #endif
bool authorizedValueAtIndex(float x, int index) const override
Definition: normal_law.cpp:79
double cumulativeDistributiveInverseForProbability(double *probability) override
Definition: normal_law.cpp:103
float yMin() override
Definition: normal_law.cpp:59
void setParameterAtIndex(float f, int index) override
Definition: normal_law.cpp:89
float xMin() override
Definition: normal_law.cpp:45
double cumulativeDistributiveFunctionAtAbscissa(double x) const override
Definition: normal_law.cpp:96
Type type() const override
Definition: normal_law.cpp:19
I18n::Message title() override
Definition: normal_law.cpp:15
float evaluateAtAbscissa(float x) const override
Definition: normal_law.cpp:72
bool isContinuous() const override
Definition: normal_law.cpp:23
static constexpr int LargeNumberOfSignificantDigits
Definition: constant.h:6
I18n::Message parameterNameAtIndex(int index) override
Definition: normal_law.cpp:27
I18n::Message parameterDefinitionAtIndex(int index) override
Definition: normal_law.cpp:36
float xMax() override
Definition: normal_law.cpp:52
float yMax() override
Definition: normal_law.cpp:63