From d49850cd8824a5e3ad3b7e38d4d63994a592fb9b Mon Sep 17 00:00:00 2001 From: Ivan Svetunkov Date: Tue, 2 May 2023 17:28:43 +0100 Subject: [PATCH] Fix for an issue with interval type --- DESCRIPTION | 4 ++-- NEWS | 5 +++-- R/smoothCombine.R | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 933cda86..573e7aae 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: smooth Type: Package Title: Forecasting Using State Space Models -Version: 3.2.1.41008 -Date: 2023-04-02 +Version: 3.2.1.41009 +Date: 2023-05-02 Authors@R: person("Ivan", "Svetunkov", email = "ivan@svetunkov.ru", role = c("aut", "cre"), comment="Lecturer at Centre for Marketing Analytics and Forecasting, Lancaster University, UK") URL: https://github.com/config-i1/smooth diff --git a/NEWS b/NEWS index 2309b631..9fc1a219 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -smooth v3.2.1 (Release data: 2023-04-02) +smooth v3.2.1 (Release data: 2023-05-02) ======= Changes: @@ -13,7 +13,8 @@ Bugfixes: * sma() with order selection would not work on data with number of observations lower than the frequency. * Fix in simulate.adam(), which would ignore the states of the model. * sm() now works with pure regression and regressors="select". But we now rely on greybox 1.0.8. -* formula is now properly used in adam() in regressors="select" +* formula is now properly used in adam() in regressors="select". +* smoothCombine() wouldn't work because of the wrong interval type. smooth v3.2.0 (Release data: 2023-01-18) diff --git a/R/smoothCombine.R b/R/smoothCombine.R index 785c3014..7432c1ba 100644 --- a/R/smoothCombine.R +++ b/R/smoothCombine.R @@ -115,6 +115,7 @@ smoothCombine <- function(y, models=NULL, persistenceX <- transitionX <- NULL; occurrence <- "none"; oesmodel <- "MNN"; + intervalOriginal <- interval; # Add all the variables in ellipsis to current environment thisEnvironment <- environment(); @@ -203,7 +204,7 @@ smoothCombine <- function(y, models=NULL, icBest <- min(ICs); icWeights <- exp(-0.5*(ICs-icBest)) / sum(exp(-0.5*(ICs-icBest))); - modelsForecasts <- lapply(models,forecast,h=h,interval=interval, + modelsForecasts <- lapply(models,forecast,h=h,interval=intervalOriginal, level=0,holdout=holdout,cumulative=cumulative, xreg=xreg);