Skip to content

Commit 61a2c6b

Browse files
author
Hendrik Muhs
committed
do not clear periodicity test after detecting a changepoint
1 parent f0f257e commit 61a2c6b

File tree

3 files changed

+0
-32
lines changed

3 files changed

+0
-32
lines changed

include/maths/CTimeSeriesDecompositionDetail.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -213,17 +213,6 @@ class MATHS_EXPORT CTimeSeriesDecompositionDetail {
213213
//! Test to see whether any seasonal components are present.
214214
void test(const SAddValue& message);
215215

216-
//! Clear the test if the shift is large compared to the median
217-
//! absolute deviation in the window.
218-
//!
219-
//! There is no point in continuing to use the historical window
220-
//! if the signal has changed significantly w.r.t. the possible
221-
//! magnitude of any seasonal component. Çonversely, if we detect
222-
//! a small change we don't want to throw a lot of history: since,
223-
//! depending on the false positive rate, we may never accumulate
224-
//! enough history to detect long seasonal components.
225-
void maybeClear(core_t::TTime time, double shift);
226-
227216
//! Age the test to account for the interval \p end - \p start
228217
//! elapsed time.
229218
void propagateForwards(core_t::TTime start, core_t::TTime end);

lib/maths/CTimeSeriesDecomposition.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,6 @@ bool CTimeSeriesDecomposition::addPoint(core_t::TTime time,
249249
bool CTimeSeriesDecomposition::applyChange(core_t::TTime time,
250250
double value,
251251
const SChangeDescription& change) {
252-
m_PeriodicityTest.maybeClear(time, change.s_Magnitude[0]);
253-
254252
bool result{m_Components.usingTrendForPrediction() == false};
255253
m_Components.useTrendForPrediction();
256254

lib/maths/CTimeSeriesDecompositionDetail.cc

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -616,25 +616,6 @@ void CTimeSeriesDecompositionDetail::CPeriodicityTest::test(const SAddValue& mes
616616
}
617617
}
618618

619-
void CTimeSeriesDecompositionDetail::CPeriodicityTest::maybeClear(core_t::TTime time,
620-
double shift) {
621-
for (auto test : {E_Short, E_Long}) {
622-
if (m_Windows[test] != nullptr) {
623-
TDoubleVec values;
624-
values.reserve(m_Windows[test]->size());
625-
for (const auto& value : m_Windows[test]->values()) {
626-
if (CBasicStatistics::count(value) > 0.0) {
627-
values.push_back(CBasicStatistics::mean(value));
628-
}
629-
}
630-
if (shift > MAD_TO_SD_MULTIPLIER * CBasicStatistics::mad(values)) {
631-
m_Windows[test].reset(this->newWindow(test));
632-
m_Windows[test]->initialize(time);
633-
}
634-
}
635-
}
636-
}
637-
638619
void CTimeSeriesDecompositionDetail::CPeriodicityTest::propagateForwards(core_t::TTime start,
639620
core_t::TTime end) {
640621
stepwisePropagateForwards(DAY, start, end, m_Windows[E_Short]);

0 commit comments

Comments
 (0)