|
12 | 12 | #include <maths/ImportExport.h> |
13 | 13 | #include <maths/MathsTypes.h> |
14 | 14 |
|
| 15 | +#include <cmath> |
| 16 | + |
15 | 17 | namespace ml { |
16 | 18 | namespace maths { |
17 | 19 |
|
@@ -50,22 +52,39 @@ const double LOG_NORMAL_OFFSET_MARGIN{1.0}; |
50 | 52 | //! reduce the prediction error variance and still be worthwhile |
51 | 53 | //! modeling. We have different thresholds because we have inductive |
52 | 54 | //! bias for particular types of components. |
53 | | -const double SIGNIFICANT_VARIANCE_REDUCTION[]{0.7, 0.5}; |
| 55 | +const double COMPONENT_SIGNIFICANT_VARIANCE_REDUCTION[]{0.6, 0.4}; |
54 | 56 |
|
55 | 57 | //! The minimum repeated amplitude of a seasonal component, as a |
56 | 58 | //! multiple of error standard deviation, to be worthwhile modeling. |
57 | 59 | //! We have different thresholds because we have inductive bias for |
58 | 60 | //! particular types of components. |
59 | | -const double SIGNIFICANT_AMPLITUDE[]{1.0, 2.0}; |
| 61 | +const double SEASONAL_SIGNIFICANT_AMPLITUDE[]{1.0, 2.0}; |
60 | 62 |
|
61 | 63 | //! The minimum autocorrelation of a seasonal component to be |
62 | 64 | //! worthwhile modeling. We have different thresholds because we |
63 | 65 | //! have inductive bias for particular types of components. |
64 | | -const double SIGNIFICANT_AUTOCORRELATION[]{0.5, 0.7}; |
| 66 | +const double SEASONAL_SIGNIFICANT_AUTOCORRELATION[]{0.5, 0.6}; |
| 67 | + |
| 68 | +//! The fraction of values which are treated as outliers when testing |
| 69 | +//! for and initializing a seasonal component. |
| 70 | +const double SEASONAL_OUTLIER_FRACTION{0.1}; |
| 71 | + |
| 72 | +//! The minimum multiplier of the mean inlier fraction difference |
| 73 | +//! (from a periodic pattern) to constitute an outlier when testing |
| 74 | +//! for and initializing a seasonal component. |
| 75 | +const double SEASONAL_OUTLIER_DIFFERENCE_THRESHOLD{3.0}; |
65 | 76 |
|
66 | | -//! The maximum significance of a test statistic to choose to model |
| 77 | +//! The weight to assign outliers when testing for and initializing |
| 78 | +//! a seasonal component. |
| 79 | +const double SEASONAL_OUTLIER_WEIGHT{0.1}; |
| 80 | + |
| 81 | +//! The significance of a test statistic to choose to model |
67 | 82 | //! a trend decomposition component. |
68 | | -const double MAXIMUM_SIGNIFICANCE{0.001}; |
| 83 | +const double COMPONENT_STATISTICALLY_SIGNIFICANT{0.001}; |
| 84 | + |
| 85 | +//! The log of COMPONENT_STATISTICALLY_SIGNIFICANT. |
| 86 | +const double LOG_COMPONENT_STATISTICALLY_SIGNIFICANCE{ |
| 87 | + std::log(COMPONENT_STATISTICALLY_SIGNIFICANT)}; |
69 | 88 |
|
70 | 89 | //! The minimum variance scale for which the likelihood function |
71 | 90 | //! can be accurately adjusted. For smaller scales errors are |
|
0 commit comments