Skip to content

Commit

Permalink
Added a fix for bug #220. force all model components to have reasonab…
Browse files Browse the repository at this point in the history
…le values.
  • Loading branch information
antoinecarme committed Jan 30, 2023
1 parent 54e694d commit 84abbd0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyaf/TS/TimeSeriesModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ def compute_model_forecast(self, iTrendValue, iCycleValue, iARValue):
if(self.mDecompositionType in ['TS+R']):
return iTrendValue * iCycleValue + iARValue
if(self.mDecompositionType in ['TSR']):
return iTrendValue * iCycleValue * iARValue
lTrendValue = iTrendValue.clip(-100, 100)
lCycleValue = iCycleValue.clip(-100, 100)
lARValue = iARValue.clip(-100, 100)
return lTrendValue * lCycleValue * lARValue
return iTrendValue + iCycleValue + iARValue

def forecastOneStepAhead(self , df , horizon_index = 1, perf_mode = False):
Expand Down

0 comments on commit 84abbd0

Please sign in to comment.