diff options
-rw-r--r-- | sc/source/core/tool/interpr8.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx index 9738c2ce7421..ce4234d0853e 100644 --- a/sc/source/core/tool/interpr8.cxx +++ b/sc/source/core/tool/interpr8.cxx @@ -993,17 +993,18 @@ void ScETSForecastCalculation::GetETSPredictionIntervals( const ScMatrixRef& rTM // fill array with forecasts, with RandDev() added to xScenRange if ( bAdditive ) { + double nPIdx = !bEDS ? mpPerIdx[mnCount - mnSmplInPrd] : 0.0; // calculation based on additive model xScenRange[ 0 ] = mpBase[ mnCount - 1 ] + mpTrend[ mnCount - 1 ] + - mpPerIdx[ mnCount - mnSmplInPrd ] + + nPIdx + RandDev(); aPredictions[ 0 ][ k ] = xScenRange[ 0 ]; - xScenBase[ 0 ] = mfAlpha * ( xScenRange[ 0 ] - mpPerIdx[ mnCount - mnSmplInPrd ] ) + + xScenBase[ 0 ] = mfAlpha * ( xScenRange[ 0 ] - nPIdx ) + ( 1 - mfAlpha ) * ( mpBase[ mnCount - 1 ] + mpTrend[ mnCount - 1 ] ); xScenTrend[ 0 ] = mfGamma * ( xScenBase[ 0 ] - mpBase[ mnCount - 1 ] ) + ( 1 - mfGamma ) * mpTrend[ mnCount - 1 ]; xScenPerIdx[ 0 ] = mfBeta * ( xScenRange[ 0 ] - xScenBase[ 0 ] ) + - ( 1 - mfBeta ) * mpPerIdx[ mnCount - mnSmplInPrd ]; + ( 1 - mfBeta ) * nPIdx; for ( SCSIZE i = 1; i < nSize; i++ ) { double fPerIdx; |