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: tssmooth hw smoothing - not synchronised?
From 
 
Dave Mare <[email protected]> 
To 
 
"[email protected]" <[email protected]> 
Subject 
 
st: tssmooth hw smoothing - not synchronised? 
Date 
 
Thu, 21 Jul 2011 19:09:51 +1200 
I have been using the Holt Winter smoothing algorithm available in tssmooth.  The smoothed series that I create seem to be one period out, and slightly inflated relative to the original series.  
The following code reproduces the problem:
webuse bsales, clear
tssmooth hwinters hw1=sales
tsline sales hw1 /* looks unsynchronised */
gen fhw1=f.hw1
tsline sales fhw1 /* looks synchronised, but slightly inflated */
/** The impact of the problem is evident in the following graphs: */
/** I repeatedly smooth the smoothed series */
foreach n of numlist 2 (1) 10 {
	local p=`n'-1
	tssmooth hwinters hw`n'=hw`p', iter(30) /* fails to converge for some - perhaps unsurprisingly! */
	gen fhw`n'=f`n'.hw`n'
	}
/** Here are the smoothed series, showing the increasing misalignment */
tsline sales hw*
/** However, if I use the realigned series, the level is increasingly inflated */
tsline sales fhw*
Am I doing something wrong?
Dave Mare
*
*   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/