Stata 15 help for tssmooth exponential

[TS] tssmooth exponential -- Single-exponential smoothing

Syntax

tssmooth exponential [type] newvar = exp [if] [in] [, options]

options Description ------------------------------------------------------------------------- Main replace replace newvar if it already exists parms(#a) use #a as smoothing parameter samp0(#) use # observations to obtain initial value for recursion s0(#) use # as initial value for recursion forecast(#) use # periods for the out-of-sample forecast ------------------------------------------------------------------------- You must tsset your data before using tssmooth exponential; see [TS] tsset. exp may contain time-series operators; see tsvarlist.

Menu

Statistics > Time series > Smoothers/univariate forecasters > Single-exponential smoothing

Description

tssmooth exponential models the trend of a variable whose change from the previous value is serially correlated. More precisely, it models a variable whose first difference follows a low-order, moving-average process.

Options

+------+ ----+ Main +-------------------------------------------------------------

replace replaces newvar if it already exists.

parms(#a) specifies the parameter alpha for the exponential smoother; 0 < #a < 1. If parms(#a) is not specified, the smoothing parameter is chosen to minimize the in-sample sum-of-squared forecast errors.

samp0(#) and s0(#) are mutually exclusive ways of specifying the initial value for the recursion.

samp0(#) specifies that the initial value be obtained by calculating the mean over the first # observations of the sample.

s0(#) specifies the initial value to be used.

If neither option is specified, the default is to use the mean calculated over the first half of the sample.

forecast(#) gives the number of observations for the out-of-sample prediction; 0 < # < 500. The default is forecast(0) and is equivalent to not forecasting out of sample.

Examples

Setup . webuse sales1

Perform single-exponential smoothing on sales . tssmooth exponential double sm2a=sales

Same as above, but use .4 as smoothing parameter . tssmooth exponential double sm2b=sales, p(.4)

Same as above, but perform out-of-sample forecast using 3 periods . tssmooth exponential double sm2c=sales, p(.4) forecast(3)

Stored results

tssmooth exponential stores the following in r():

Scalars r(N) number of observations r(alpha) alpha smoothing parameter r(rss) sum-of-squared prediction errors r(rmse) root mean squared error r(N_pre) number of observations used in calculating starting values r(s1_0) initial value for S_t

Macros r(method) smoothing method r(exp) expression specified r(timevar) time variable specified in tsset r(panelvar) panel variable specified in tsset


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index