/// <summary> /// Aan de hand van de ingevulde kolommen van ImproveSmoothingFactor de prediction berekenen. /// </summary> /// <param name="data">Lijst van Maand waarbij de forecasting data wordt opgeslagen</param> private void AddOptimizePrediction(Dictionary <int, Forecasting> data) { var preditionValue = new PredictionVariables(); var predictionCalc = new SmoothingFormulas(); var factorValues = new FactorsVariables(); factorValues.alpha = bestAlpha; factorValues.delta = bestBeta; factorValues.gamma = bestGamma; foreach (var item in data) { int timeValue = item.Key; if (timeValue == 36) { preditionValue.tLock = item.Key; preditionValue.tTLock = item.Value.Trend; preditionValue.lTLock = item.Value.Level; } else if (timeValue > 36) { preditionValue.t = timeValue; preditionValue.sT = data[int.Parse(timeValue.ToString()) - 12].SeasonalAdjustment; Console.WriteLine("Month: " + timeValue + ", " + "Predicted Demand Value: " + predictionCalc.Prediction(preditionValue, factorValues)); data[int.Parse(timeValue.ToString())].ActualDemand = predictionCalc.Prediction(preditionValue, factorValues); } } }
public float Prediction(PredictionVariables predictionVariables, FactorsVariables factorsVariables) { //(lT - 1 + (t.current - t - 1) * Tt - 1) * S(vorige 12 maanden); //---->($LevelsmoothingBekend + (PredictionT - $lastbekendeTijd) * $LastbekendeTrend) *-12Seasonal float prediction = (predictionVariables.lTLock + (predictionVariables.t - predictionVariables.tLock) * predictionVariables.tTLock) * predictionVariables.sT; return(prediction); }