Hello,
I am having trouble figuring out the correct commands when I try to compare the seasonal naive method with Holt-Winters' additive seasonal exponential smoothing method using time series cross-validation. I have 280 observations of two variables: t = quarterly time (i.e. 2001q1, 2001q2, 2001q3, 2001q4, etc.) and v90 which are random numbers. I'm trying to make one year ahead forecast of v90 and I'm to use all except the last two years of data for my first training set. I'll then use MAE to measure the forecast performance. Lastly, the number of iterations needs to be limited to 15.
Here are the commands I have entered so far, and although they run, it doesn't seem right. (Stata/IC 16.1)
gen f_add = .
gen f_nai = .
forvalues e = 272/276 {
noi di "`e'"
tssmooth shwinters tmp1 = v90 in 1/`e', replace iter(15) forecast(4) add
replace f_add = tmp1 in `=`e'+4'
replace f_nai = l4.v31 in -5/l
}
drop tmp1
gen abserr_fss = abs(v90-f_add)
gen abserr_fsn = abs(v90-f_nai)
noi su abserr*
Any kind of help would be greatly appreciated. Thanks.
Related Posts with Comparing the seasonal naive method with Holt-Winters' additive seasonal exp. smoothing method using ts cross-validation
Foreach and string variablesI have a panel data set with country, years, and the following three (relevant) variables: C (float…
Problem with hausman testIm using stata 12 and I have a result like this Code: . hausman fe re ---- Coef…
xtabond2 Hansen testHello I'm using system GMM to estimate TFP growth (gtfp_100) at regional level . I've a problem with…
Static (not dynamic) panel data using xtabond2.Dear All, This is a question more about econometric concept rather than Stata code. While (ssc insta…
Help in dealing with messy longitudinal line graphGreetings, I'm running Stata 15.1 on OSX. Using data from the general social survey, I'm attempting…
Subscribe to:
Post Comments (Atom)
0 Response to Comparing the seasonal naive method with Holt-Winters' additive seasonal exp. smoothing method using ts cross-validation
Post a Comment