Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Is the formula of the tssmooth exponential command wrong?

From   Oliver Jones <>
Subject   st: Is the formula of the tssmooth exponential command wrong?
Date   Mon, 06 Sep 2010 17:37:43 +0200

Dear list members,
regarding the Time Series Manual (page 336) the formula of the exponential smoother is
S_t = alpha * X_t + (1-alpha) * S_{t-1},
where X_t represents the original data.
Is this equation correct?
Or must it use X_{t-1} instead of X_t?

The software is implemented using X_{t-1}. Here is a little example showing the difference between the a smoothed series using the -tssmooth exp- command and the formula from the manual:

************* begin example **************

set obs 4

local alpha = 0.2
local s_initial = 1

gen time = _n
gen x = _n*5
tsset time

tssmooth exponential s = x, replace s0(`s_initial') parm(`alpha')


gen s_manual = .

replace s_manual = `s_initial' in 1
forvalues i = 2/4 {
	local past = `i' - 1
	replace s_manual = `alpha'*x[`i'] + (1-`alpha')*s_manual[`past'] in `i'


************* end example **************

Kind regards,

Universität Bielefeld
Fakultät für Wirtschaftswissenschaften
Lehrstuhl für Ökonometrie und Statistik
- - -
Bielefeld University
Department of Business Administration and Economics
Chair of Econometrics and Statistics
- - -
Raum / room:  V9-110
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index