Stata 15 help for tssmooth dexponential

[TS] tssmooth dexponential -- Double-exponential smoothing

Syntax

tssmooth dexponential [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 values for recursion s0(#1 #2) use #1 and #2 as initial values for recursions forecast(#) use # periods for the out-of-sample forecast ------------------------------------------------------------------------- You must tsset your data before using tssmooth dexponential; see [TS] tsset. exp may contain time-series operators; see tsvarlist.

Menu

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

Description

tssmooth dexponential models the trend of a variable whose difference between changes from the previous values is serially correlated. More precisely, it models a variable whose second 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 double-exponential smoothers; 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(#1 #2) are mutually exclusive ways of specifying the initial values for the recursion.

By default, initial values are obtained by fitting a linear regression with a time trend, using the first half of the observations in the dataset; see Remarks and examples in [TS] tssmooth dexponential.

samp0(#) specifies that the first # be used in that regression.

s0(#1 #2) specifies that #1 #2 be used as initial values.

forecast(#) specifies the number of periods for the out-of-sample prediction; 0 < # < 500. The default is forecast(0), which is equivalent to not performing an out-of-sample forecast.

Examples

Setup . webuse sales2

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

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

Same as above, but use 1031 and 1031 as initial values for recursions . tssmooth dexponential double sm2c=sales, p(.7) s0(1031 1031)

Same as above, but perform out-of-sample forecast using 4 periods . tssmooth dexponential double sm2d=sales, p(.7) s0(1031 1031) forecast(4)

Stored results

tssmooth dexponential stores the following in r():

Scalars r(N) number of observations r(alpha) alpha smoothing parameter r(rss) sum-of-squared errors r(rmse) root mean squared error r(N_pre) number of observations used in calculating starting values, if starting values calculated r(s2_0) initial value for linear term, i.e., S_0^[2] r(s1_0) initial value for constant term, i.e., S_0 r(linear) final value of linear term r(constant) final value of constant term r(period) period, if filter is seasonal

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