DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Financial Data Engineering in SAS
  • SAS: Telling a Story With Data

Trending

  • Docker Base Images Demystified: A Practical Guide
  • How Large Tech Companies Architect Resilient Systems for Millions of Users
  • The Modern Data Stack Is Overrated — Here’s What Works
  • A Guide to Container Runtimes
  1. DZone
  2. Coding
  3. Languages
  4. ARIMA Forecasting With SAS

ARIMA Forecasting With SAS

The ARIMA procedure analyzes and forecasts equally spaced univariate time series data, transfer function data, and intervention data.

By 
Jitendra Bafna user avatar
Jitendra Bafna
DZone Core CORE ·
Mar. 08, 17 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
19.6K Views

Join the DZone community and get the full member experience.

Join For Free

ARIMA stands for auto-regressive integrated moving average. It is also known as the Box-Jenkins model, as the ARIMA has been technique popularized by Box and Jenkins. For ARIMA forecasting, data needs to be stationary.

The ARIMA procedure analyzes and forecasts equally spaced univariate time series data, transfer function data, and intervention data by using auto-regressive integrated moving averages.

PROC ARIMA in SAS can be used to forecast.

Identification Stage

The Identification Stage computes auto-correlation, inverse autocorrelations, partial autocorrelations, and cross-correlations. Stationarity tests can be performed to identify whether differencing is necessary. It also provides descriptive statistics.

proc arima data=retail ;
   identify var=sales nlag=22;
run;

nlag controls the number of lags for which autocorrelation is shown. It should be always less than the number of observation in your dataset.

var is used to specify the name of the variable that needs to foreacst.

The identify statement produces panels of plots for auto-correlation and trend analysis.

  • Time series plot of the series.

  • Auto-correlation function plot (ACF).

  • Inverse autocorrelation function plot (IACF).

  • Partial autocorrelation function plot (PACF).

Image title

Differencing

If you plot sales, it seems that sales are changing from period to period. So data is non-stationary.

Now, we need to convert data into stationary data. It can be done as shown below.

proc arima data=LIBREF.FORECAST ;
   identify var=sales(1) nlag=22;
run;

Image title

If we see the sales plot, it is non-stationary.

White Noise Test

In this case, white noise is rejected as a p-value for all lags less than or equal to 0.05. This is considered a good fit model.

Image titleDescriptive Statistics

The identify statement prints descriptive statistics for the sales series.

Image titleEstimation and Diagnostic Stage

The estimate statement is used to specify the ARIMA model to fit to the variable specified in the previous identify statement and to estimate the parameters of that model.

The estimate statement also produces diagnostic statistics to help you judge the adequacy of the model.

proc arima data = LIBREF.FORECAST;
identify var = Sales(1) nlag = 20 ;
estimate p = 1  q = 1;
run;

Image titleForecasting Stage

The FORECAST statement is used to forecast future values of the time series and to generate confidence intervals for these forecasts from the ARIMA model produced by the preceding ESTIMATE statement.

proc arima data = LIBREF.FORECAST;
identify var = Sales(1) nlag = 20 ;
estimate p = 1  q = 1;
run;
forecast lead=12 interval=month id=period out=results;
quit; 
  • lead specifies how many period ahead to forecast. (12 months is our example).

  • id specifies the ID variable (which is generally SAS date, time, and datetime).

  • interval indicates the data are monthly.

  • out allows us to write the forecast data to the datasets results.

Image title

Image title

Now, you know how to use the ARIMA model for forecasting.

SAS (software)

Opinions expressed by DZone contributors are their own.

Related

  • Financial Data Engineering in SAS
  • SAS: Telling a Story With Data

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!