Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[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 <[email protected]>
To   [email protected]
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 **************

clear
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')

list

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'
}

list

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

Kind regards,
Oliver

--
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:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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