From 4b7d708e35cd878a3fec0ae0f518fad4c9dc6b3f Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Wed, 22 Nov 2023 18:47:25 +1000 Subject: [PATCH] need to sort changepoint times in forecasts --- R/trends.R | 4 ++-- src/mvgam.dll | Bin 1061888 -> 1061888 bytes 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/trends.R b/R/trends.R index bdf6e962..3798117d 100644 --- a/R/trends.R +++ b/R/trends.R @@ -1408,7 +1408,7 @@ forecast_trend = function(trend_model, use_lv, trend_pars, # Combine with changepoints from the history deltas <- c(trend_pars$delta_trend[[x]], deltas_new) - changepoint_ts <- c(trend_pars$changepoints, t_change_new) + changepoint_ts <- sort(c(trend_pars$changepoints, t_change_new)) # Generate a trend draw draw <- piecewise_linear(t = 1:max(time), @@ -1441,7 +1441,7 @@ forecast_trend = function(trend_model, use_lv, trend_pars, # Combine with changepoints from the history deltas <- c(trend_pars$delta_trend[[x]], deltas_new) - changepoint_ts <- c(trend_pars$changepoints, t_change_new) + changepoint_ts <- sort(c(trend_pars$changepoints, t_change_new)) # Get historical capacities oldcaps <- trend_pars$cap[[x]] diff --git a/src/mvgam.dll b/src/mvgam.dll index 2ba0e6e73d946a7d682cb4de93b5756a8e25dbc1..88a2e973e18a7f89bf75d02d2105a5b62e234e5e 100644 GIT binary patch delta 76 zcmV-S0JHyq=s) i+X;o+3WeJXh1(2;+YN==4z=44DcJ&{zPAS25BgbK@gvRv delta 76 zcmV-S0JHyq=s) i+X;o+3WeJXh1(2;+YN==4z=44DcJ(Xt+xi+5Bgbamn0ql