Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ model state on disk ({pull}89[#89])

Age seasonal components in proportion to the fraction of values with which they're updated ({pull}88[#88])
Persist and restore was missing some of the trend model state ({pull}#99[#99])
Stop zero variance data generating a log error in the forecast confidence interval calculation ({pull}#107[#107])

=== Regressions

Expand Down
3 changes: 3 additions & 0 deletions lib/maths/CTrendComponent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ double scaleTime(core_t::TTime time, core_t::TTime origin) {

//! Get the \p confidence interval for \p prediction and \p variance.
TOptionalDoubleDoublePr confidenceInterval(double prediction, double variance, double confidence) {
if (variance == 0.0) {
return std::make_pair(prediction, prediction);
}
try {
boost::math::normal normal{prediction, std::sqrt(variance)};
double ql{boost::math::quantile(normal, (100.0 - confidence) / 200.0)};
Expand Down