Example: dental hygienist

SUGI 24: The Time Series Forecasting System

The time Series Forecasting SystemCharles Hallahan, Economic Research Service/USDA, Washington, DCRenee Samy, SAS Institute Inc., Cary, NCINTRODUCTIONThe time Series Forecasting System (TSFS) is acomponent of SAS/ETS that provides a menu-basedfront-end for Forecasting activities. The tasks ofcreating a date variable, graphing a data Series andquickly seeing the results of differencing and/orapplying a log transformation, testing for unit roots,examining autocorrelation and partial autocorrelationplots, performing seasonality tests, and, finally,estimating models and producing forecasts are just amouse click away. This Hands-on Workshop is anintroduction to the TSFS. Part 1 shows how to accessthe System and generate Forecasting models forseveral variables through automatic selection from adefault list of models provided with the TSFS.

The Time Series Forecasting System (TSFS) is a ... From the Time Series Forecasting Menu (see Figure 2), click on the Generate Models button. From the Generate Forecasting Models screen (see Figure 4) click on the down arrow on the line Series to Process: and select the two variables EEGP and

Tags:

  Series, System, Time, Forecasting, Time series forecasting, The time series forecasting system

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of SUGI 24: The Time Series Forecasting System

1 The time Series Forecasting SystemCharles Hallahan, Economic Research Service/USDA, Washington, DCRenee Samy, SAS Institute Inc., Cary, NCINTRODUCTIONThe time Series Forecasting System (TSFS) is acomponent of SAS/ETS that provides a menu-basedfront-end for Forecasting activities. The tasks ofcreating a date variable, graphing a data Series andquickly seeing the results of differencing and/orapplying a log transformation, testing for unit roots,examining autocorrelation and partial autocorrelationplots, performing seasonality tests, and, finally,estimating models and producing forecasts are just amouse click away. This Hands-on Workshop is anintroduction to the TSFS. Part 1 shows how to accessthe System and generate Forecasting models forseveral variables through automatic selection from adefault list of models provided with the TSFS.

2 Part 2shows how to override the defaults of the TSFS andtake control of specifying a model. Part 3 shows howto add explanatory variables to the Forecasting modeland control the period of evaluation and fit of a paper is written using the SAS System 1: USING THE TSFS IN AUTOMATIC MODEThe first step is to make sure a libname statementhas been executed to point to the directory containingthe SAS data set to be analyzed. In the workshop,you will use SAS data sets found in the SASHELP directory. The TSFS can be accessed either throughmenu choices (see Figure 1) as Globals Analyze Forecastingor by entering the command forecast on thecommand line or by assigning the command forecastto a function 1 Accessing the TSFSYou will be using two variables from the CITIMONSAS data set found in the SASHELP library. Whenthe initial TSFS screen appears (see Figure 2), namethe project with a descriptionof SUGI 24 TSFS Hands-on Workshop: Part 1 (noquotes).

3 Click on the down arrow beside Data Set:and select Note that a datevariable was found in the data set with the nameDATE and with a periodicity of MONTH. Figure 2 Starting a ProjectYou will be working with two variables in this data set:EEGP = (retail gasoline price) and RCARD = (retailsales of new domestic cars). To view a Series , clickon the View Series button and select RCARD (seeFigure 3).Figure 3 Viewing a SeriesHands-on WorkshopsClicking on a point on the graph produces the actualdata value in a box on the upper right. The buttonsalong the upper left are for zooming andtransformations. For example, clicking on the keycreates the first difference and immediately graphs keys down the upper right produce the sampleautocorrelation and partial autocorrelation functionsand also carry out white noise and unit root tests.

4 Youwill be looking at these buttons later when you fitspecific on the return arrow along the top brings youback to the main menu. Your first task will be to let thesoftware find the best fitting model for the twovariables by selecting from a preset list of models andusing RMSE, the root mean square error, as thedefault goodness-of-fit the time Series Forecasting Menu (see Figure2), click on the Generate Models button. From theGenerate Forecasting Models screen (see Figure 4)click on the down arrow on the line Series toProcess: and select the two variables EEGP andRCARD from the eighteen variables available in thedata set. Hold down the CTRL key while clicking onthe two selected 4 The Generate Models ScreenBefore clicking on the Generate button to have thebest model selected on the basis of the default ModelSelection Criterion of the Root Mean Square Error,look at some of the other default options.

5 The defaultis to keep just the Best Model. Clicking on theOptions pull-down menu along the top, click on theoption Automatic and change the default tokeep the Best 5 Models based on RMSE. Note thatthe option to have the TSFS automatically performdiagnostics on the variables is checked. Thesediagnostics will be discussed later. See Figure 5 forthis 5 The Automatic Model Selection OptionsAnother option you will look at now is to see exactlywhich models are in the selection list as candidatesfor best fitting model. Again click on the Options pull-down menu and select Model Selection . Theresult is Figure 6 Model Selection ListThe models in this list are characterized by threefactors: trend - either none, deterministic orstochastic (that is, first or seconddifference) log or not seasonality or example, Winter s method is a smoothing modelfor data exhibiting a trend and seasonality; no log istaken.

6 The TSFS documentation clearly explains allthe available models. Favorite models not included inthis list can be added, as you will see in Part 2. Sinceyou have selected the option to automatically haveTSFS perform the preliminary diagnostics, the list ofmodels actually fit to a data Series is much WorkshopsClicking on the Generate button leads to themessage box stating Models will be fit automaticallyfor 2 Series . Based on the results of the diagnostictests, a status box identifies each candidate model asit is being fit. If the diagnostic tests are inconclusive,then, for example, models both with and withoutlogging are fit. For this example 10 models are fit toEEGP and 20 models to RCARD. Upon completion ofthe model fitting, the 5 best models (as previouslydesignated) for each Series are summarized in theGenerate Models Results window (see Figure 7).

7 Figure 7 Generate Models Results WindowSince the object of all this work is to produceforecasts, at this point you could accept the bestfitting model as found by TSFS and find forecasts forthe next 12 months (the default).Figure 8 Produce ForecastsPress the Goback key until the main menu reappears(see Figure 2), and click on the Produce Forecastsbutton to get the Produce Forecasts screen (seeFigure 8). To stay with the defaults, click on the Forecast buttonand a note appears stating that Forecasts for 2series were written to output data There are three output formatsavailable. Since context sensitive help is only an F1function key click away, click F1 to see that the threeoutput types are simple, interleaved, andconcatenated. The default is simple and is explainedon the Help screen asSimplespecifies the simple format for the output data data set contains the time ID variable and theforecast variables and contains one observation pertime period.

8 Observations for earlier time periodscontain actual values copied from the input data set;later observations contain the concludes Part 1 on using the TSFS in automaticmode. Return to the main screen (see Figure 2) byclicking on the Goback key. In Part 2, you will take amore proactive 2: USING THE TSFS TO DEVELOP MODELSYou will use the SAS data set, ,as in Part 1. Click on the Develop Models buttonfrom the main screen to display the Series SelectionFigure 9 Series Selectionscreen (see Figure 9).Start with the variable EEGP. The first step is to lookat a graph of the data, so click the View Series button(see Figure 10). The Series does not appear to have aHands-on WorkshopsFigure 10 Plot of EEGP trend. If you click on the high and low points on thegraph, low prices seem to occur generally during thewinter months and most peaks are in the summermonths.

9 There could be seasonality in the this point, you could run the three diagnostic testsby selectingLocals Diagnose Seriesfrom the menu pull-down along the top. The result isFigure 11 Series DiagnosticsFigure on the Automatic Series Diagnostics boxyieldsLog Transform: MaybeTrend: YesSeasonality: NoOther transformations available when developing amodel are the logistic, square root, and Box Coxtransformations. Trends can be modeled by first orsecond differences or by deterministic curves, suchas a linear or quadratic trend. Seasonality can bemodeled deterministically with seasonal dummies orvia seasonal ARIMA models. Smoothing models canalso incorporate trends and seasonality. Thedocumentation spells out the details of all the possiblemodels. The documentation also states that Theseries diagnostic tests are intended as a heuristic toolonly, and no statistical validity is claimed for them.

10 Asof Release 7, the diagnostic tests are as follows: Log transform test. A high-order autoregressivemodel is fit to the original Series , and its log andgoodness-of-fit measures for prediction errors arecompared. Trend test. An augmented Dickey-Fuller testand random walk with drift tests are performed. Seasonality test. A seasonal dummy modelwith AR(1) errors is fit and an F-test performedon the seasonal taking first differences of EEGP, you will closethe Series Diagnostics window and click the ViewSeries button. Clicking on the Tests button on theright (designated as p=.05 ), displays graphicalresults for the Trend tests discussed above. You cansee numerical p-values by clicking on one of the bluebars for any of the tests. For example, clicking on thebar for lag 1 of the Unit Root Tests yields Figure 12 p-value for Unit Root TestThe p-value of leads to the recommendationthat the Series be indicator of the need for first differencingcomes from examination of the autocorrelationfunction.


Related search queries