@@ -1619,6 +1619,11 @@ void CUnivariateTimeSeriesModel::reinitializeStateGivenNewComponent(
1619
1619
// re-weight so that the total sample weight corresponds to the sample
1620
1620
// weight the model receives from a fixed (shortish) time interval.
1621
1621
1622
+ // We can't properly handle periodicity in the variance of the rate if
1623
+ // using a Poisson process so remove it from model detectio if we detect
1624
+ // seasonality.
1625
+ m_ResidualModel->removeModels (
1626
+ maths::CPrior::CModelFilter ().remove (maths::CPrior::E_Poisson));
1622
1627
m_ResidualModel->setToNonInformative (0.0 , m_ResidualModel->decayRate ());
1623
1628
1624
1629
if (initialValues.size () > 0 ) {
@@ -1648,16 +1653,6 @@ void CUnivariateTimeSeriesModel::reinitializeStateGivenNewComponent(
1648
1653
}
1649
1654
}
1650
1655
1651
- // Note we can't reinitialize this from the initial values because we do
1652
- // not expect these to be at the bucket length granularity.
1653
- if (m_MultibucketFeature != nullptr ) {
1654
- m_MultibucketFeature->clear ();
1655
- }
1656
- if (m_MultibucketFeatureModel != nullptr ) {
1657
- m_MultibucketFeatureModel->setToNonInformative (
1658
- 0.0 , m_MultibucketFeatureModel->decayRate ());
1659
- }
1660
-
1661
1656
if (m_Correlations != nullptr ) {
1662
1657
m_Correlations->clearCorrelationModels (m_Id);
1663
1658
}
@@ -1670,6 +1665,18 @@ void CUnivariateTimeSeriesModel::reinitializeStateGivenNewComponent(
1670
1665
controller.reset ();
1671
1666
}
1672
1667
}
1668
+
1669
+ // Note we can't reinitialize this from the initial values because we do
1670
+ // not expect these to be at the bucket length granularity.
1671
+ if (m_MultibucketFeature != nullptr ) {
1672
+ m_MultibucketFeature->clear ();
1673
+ }
1674
+ if (m_MultibucketFeatureModel != nullptr ) {
1675
+ m_MultibucketFeatureModel->removeModels (
1676
+ maths::CPrior::CModelFilter ().remove (maths::CPrior::E_Poisson));
1677
+ m_MultibucketFeatureModel->setToNonInformative (0.0 , m_ResidualModel->decayRate ());
1678
+ }
1679
+
1673
1680
if (m_AnomalyModel != nullptr ) {
1674
1681
m_AnomalyModel->reset ();
1675
1682
}
@@ -2987,16 +2994,6 @@ void CMultivariateTimeSeriesModel::reinitializeStateGivenNewComponent(
2987
2994
}
2988
2995
}
2989
2996
2990
- // Note we can't reinitialize this from the initial values because we do
2991
- // not expect these to be at the bucket length granularity.
2992
- if (m_MultibucketFeature != nullptr ) {
2993
- m_MultibucketFeature->clear ();
2994
- }
2995
- if (m_MultibucketFeatureModel != nullptr ) {
2996
- m_MultibucketFeatureModel->setToNonInformative (
2997
- 0.0 , m_MultibucketFeatureModel->decayRate ());
2998
- }
2999
-
3000
2997
if (m_Controllers != nullptr ) {
3001
2998
m_ResidualModel->decayRate (m_ResidualModel->decayRate () /
3002
2999
(*m_Controllers)[E_ResidualControl].multiplier ());
@@ -3008,6 +3005,17 @@ void CMultivariateTimeSeriesModel::reinitializeStateGivenNewComponent(
3008
3005
controller.reset ();
3009
3006
}
3010
3007
}
3008
+
3009
+ // Note we can't reinitialize this from the initial values because we do
3010
+ // not expect these to be at the bucket length granularity.
3011
+ if (m_MultibucketFeature != nullptr ) {
3012
+ m_MultibucketFeature->clear ();
3013
+ }
3014
+
3015
+ if (m_MultibucketFeatureModel != nullptr ) {
3016
+ m_MultibucketFeatureModel->setToNonInformative (0.0 , m_ResidualModel->decayRate ());
3017
+ }
3018
+
3011
3019
if (m_AnomalyModel != nullptr ) {
3012
3020
m_AnomalyModel->reset ();
3013
3021
}
0 commit comments