*! version 1.0.0 30Jan2026

Title

ses_forecast -- simple exponential smoothing forecasts with confidence intervals

Syntax

ses_forecast varname [if] [in] [, forecast(#)
level(#)
replace
figure
prefix(string)
twowayopts(string)
model_options]

forecast(#) number of periods to forecast; default is forecast(2)

level(#) set confidence level; default is level(95)

replace replace existing forecast variables and added observations

figure display forecast graph

prefix(string) prefix for forecast variable names

twowayopts(string) options to pass to twoway graph

model_options any tssmooth exponential options

You must tsset your data before using ses_forecast; see [TS] tsset.

Description

ses_forecast generates point forecasts, standard errors, and confidence intervals
for simple exponential smoothing (SES) models. The procedure uses tssmooth exponential
to fit the SES model and then computes forecast standard errors based on the innovation variance.
The implementation mirrors the method used in the R forecast package
ses function.

Options

forecast(#) use # periods for the out-of-sample forecast; default is forecast(2).

level(#); see [R] Estimation options.

prefix(string) specifies a prefix for the forecast variable names.
If not specified, variables will be named forecast, se, ll#,
and ul# (where # is the confidence level). For example, with
prefix(my) and level(95), variables will be named
myforecast, myse, myll95, and myul95.

figure generates a forecast plot showing the original series,
point forecasts, and confidence intervals. The plot is styled to resemble
the forecast
package's (in R) output.

twowayopts(string) specifies options to pass to the twoway graph
when the figure option is used. This allows customization of the graph
appearance, such as changing colors, adding titles, modifying legends, etc.

model_options are any options allowed by tssmooth exponential.

Examples

Setup

. webuse sales1, clear

. tsset t

Basic usage

. ses_forecast sales, forecast(3)

Same as above but replace added variables and produce figure

. ses_forecast sales, forecast(3) replace fig

Same as above but change level to 99%

. ses_forecast sales, forecast(3) replace fig lev(99)

Saved Results

ses_forecast saves the following results:

Scalars

r(forecast) forecast horizon

r(alpha) alpha smoothing parameter

r(sigma2) innovation variance

Matrices

r(results) matrix of forecasts

References

Hyndman, R.J., Koehler, A.B., Ord, J.K., & Snyder, R.D. (2008).
Forecasting with Exponential Smoothing: The State Space Approach.
Springer-Verlag.

Hyndman, R.J., & Athanasopoulos, G. (2021).
Forecasting: Principles and Practice (3rd ed.). OTexts.

Citation of ses_forecast

ses_forecast is not an official Stata command. It is a free contribution
to the research community, like a paper. Please cite it as such:

Linden A. (2026). SES_FORECAST: Stata module to compute simple exponential smoothing forecasts with confidence intervals

Author

Ariel Linden

Linden Consulting Group, LLC

alinden@lindenconsulting.org

Also See

tssmooth exponential, arima_forecast (if installed), shwinters_forecast (if installed)