Skip to content

Commit

Permalink
Yet another fix for the issue #191. This should be it.
Browse files Browse the repository at this point in the history
  • Loading branch information
config-i1 committed Feb 6, 2022
1 parent 4c96a50 commit 95e1be1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: smooth
Type: Package
Title: Forecasting Using State Space Models
Version: 3.1.6.41003
Date: 2022-02-01
Version: 3.1.6.41004
Date: 2022-02-06
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
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
smooth v3.1.6 (Release data: 2022-02-01)
smooth v3.1.6 (Release data: 2022-02-06)
=======

Changes:
Expand Down
14 changes: 12 additions & 2 deletions src/ssGeneral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,12 @@ List fitter(arma::mat &matrixVt, arma::mat const &matrixF, arma::rowvec const &r

// This is a failsafe for cases of ridiculously high and ridiculously low values
if(vecYfit(i-lagsModelMax) > 1e+100){
vecYfit(i-lagsModelMax) = vecYfit(i-lagsModelMax-1);
if(i-lagsModelMax==0){
vecYfit(i-lagsModelMax) = 0;
}
else{
vecYfit(i-lagsModelMax) = vecYfit(i-lagsModelMax-1);
}
}

// If this is zero (intermittent), then set error to zero
Expand Down Expand Up @@ -977,7 +982,12 @@ List backfitter(arma::mat &matrixVt, arma::mat const &matrixF, arma::rowvec cons

// This is for cases of ridiculously high and ridiculously low values
if(vecYfit(i-lagsModelMax) > 1e+100){
vecYfit(i-lagsModelMax) = vecYfit(i-lagsModelMax+1);
if(i-lagsModelMax==obs+lagsModelMax){
vecYfit(i-lagsModelMax) = 0;
}
else{
vecYfit(i-lagsModelMax) = vecYfit(i-lagsModelMax-1);
}
}

// If this is zero (intermittent), then set error to zero
Expand Down

0 comments on commit 95e1be1

Please sign in to comment.