Skip to content

Commit 75d9c4a

Browse files
committed
Fixing a bug with ts() indices
1 parent 6b89b8b commit 75d9c4a

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

R/adam.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -8053,7 +8053,7 @@ forecast.adam <- function(object, h=10, newdata=NULL, occurrence=NULL,
80538053
# ts structure
80548054
yForecastStart <- time(actuals(object))[obsInSample]+deltat(actuals(object));
80558055
yFrequency <- frequency(actuals(object));
8056-
yForecastIndex <- yIndex[obsInSample]+as.numeric(diff(tail(yIndex,2)))*c(1:h);
8056+
yForecastIndex <- yIndex[obsInSample]+deltat(yIndex)*c(1:h);
80578057
}
80588058
else{
80598059
# zoo

R/adamGeneral.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ parametersChecker <- function(data, model, lags, formulaToUse, orders, constant=
180180
yIndexDiff <- diff(tail(yIndex,2));
181181
yForecastStart <- yIndex[obsInSample]+yIndexDiff;
182182
if(any(yClasses=="ts")){
183-
yForecastIndex <- yIndex[obsInSample]+as.numeric(yIndexDiff)*c(1:max(h,1));
183+
yForecastIndex <- yIndex[obsInSample]+deltat(yIndex)*c(1:max(h,1));
184184
}
185185
else{
186186
yForecastIndex <- yIndex[obsInSample]+yIndexDiff*c(1:max(h,1));

smooth.Rproj

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Version: 1.0
2+
ProjectId: f8f33844-318a-42de-9bed-71e43b9ac780
23

34
RestoreWorkspace: Default
45
SaveWorkspace: Default

0 commit comments

Comments
 (0)