Exponential Forecasting System

From GM-RKB
Jump to navigation Jump to search

An Exponential Forecasting System is a forecasting system that implements an exponential forecasting algorithm.



References

2018

  • https://stackoverflow.com/a/48684063
    • QUOTE: Forecasts are calculated using weighted averages where the weights decrease exponentially as observations come from further in the past, the smallest weights are associated with the oldest observations:
simple exponential smoothing go back to last N values
y_t = a * y_t + a * (1-a)^1 * y_t-1 + a * (1-a)^2 * y_t-2 + ... + a*(1-a)^n *  y_t-n

def exponential_smoothing(panda_series, alpha_value): ouput=sum([alpha_value * (1 - alpha_value) ** i * x for i, x in enumerate(reversed(panda_series))]) return ouput panda_series=mydata.y smoothing_number=exponential_smoothing(panda_series,0.6) # use a=0.6 or 0.5 your choice, which gives less rms error estimated_values=testdata.copy() # replace testdata with your test dataset estimated_values['SES'] = smoothing_number error=sqrt(mean_squared_error(testdata.y, estimated_values.SES)) print(error)