Hello, I'm learning time series and I want to perform a simple exponential smoothing on my data. Below is my data set:
data ds;
input time Target;
datalines;
1 539.577
2 224.675
3 129.412
4 317.12
5 210.517
6 207.364
7 263.043
8 248.958
9 344.291
10 248.428
11 281.42
12 243.568
13 308.178
14 363.402
15 336.872
16 246.992
17 308.88
18 233.126
19 404.38
20 298.56
21 229.249
22 236.304
23 297.174
24 409.401
25 231.035
26 238.826
27 235.598
28 242.112
29 490.79
30 289.657
31 298.459
32 323.603
33 616.453
34 346.035
35 307.645
36 253.847
37 530.944
38 333.359
39 306.356
40 416.83
41 415.187
42 268.002
43 234.503
44 234.724
45 230.064
46 357.394
47 259.246
48 244.235
49 402.607
50 255.061
51 342.606
52 268.64
53 188.601
54 202.022
55 213.509
56 316.849
57 286.412
58 303.447
59 304.95
60 331.9
;
run;
This data set has 60 observations. I'm using the first 45 to build the model and the last 15 to test the model. Below is my code:
proc esm data=ds out=out_ses back=15 lead=15 print=all;
id time interval=day format=best.;
forecast target;
run;
Three questions:
1. The alpha estimate that I got is 0.04576. For some reason, this is different than the result my coworker got from R. Is it normal that SAS and R generate different results because of the different algorithm? Or could someone do a quick check and see if my code is correct?
2. Is there a way to perform the Box-LJung test on the residuals? I understand that you can perform the test using proc ARIMA but I need the residuals for all of the observations. I can't seem to find it from any Proc ESM output.
3. Beside the Box-LJung test, is there another way to check the residuals for model fit? I'm new to time series modeling. What would be the standard way to check model fit when doing simple exponential smoothing?
Thanks!
1. the algorithms are different so u might expect to see some diff
2. you can use OUTFOR = to output the forecast along with the actuals, CI, residuals, etc.
thanks
alex
Hi,
If you are new to time series analysis with SAS, I strongly suggest that you check out the forecasting tasks in SAS Studio. They provide a structure environment for guiding you through data preparation, exploration and modeling and forecasting. And SAS Studio writes the code for you!!
This page has a few short tutorial videos, each about 5-10 minutes long.
Please try it out and let us know how you like it!
Michele
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.