Microsoft ARIMA Algorithm

Overview

The Microsoft ARIMA (AutoRegressive Integrated Moving Average) algorithm is a time‑series forecasting model that predicts future values based on past observations. It is commonly used for forecasting sales, demand, and other sequential data in SQL Server Analysis Services (SSAS) data mining projects.

Key Features

Creating an ARIMA Model

Below is a step‑by‑step example of creating an ARIMA model using DMX in SSAS.

-- Create a mining structure
CREATE MINING STRUCTURE SalesForecast
(
    SalesDate   DATETIME NOT NULL,
    SalesAmount DOUBLE PRECISION
)
USING Microsoft_ARIMA;

-- Populate the mining model
INSERT INTO SalesForecast (SalesDate, SalesAmount)
SELECT OrderDate, TotalAmount
FROM dbo.Sales
WHERE OrderDate >= '2020-01-01';

-- Train the model (auto selects parameters)
CREATE MINING MODEL SalesModel
FROM SalesForecast
WITH
(
    AUTO_SELECTION = TRUE
);

Prediction Example

Query the model to predict sales for the next 12 months.

SELECT
    PREDICTED.SalesAmount,
    PREDICTED.Confidence
FROM
    OPENQUERY([YourCube], '
        SELECT
            [SalesAmount] AS [PredictedSales],
            [Confidence] AS [ConfidenceLevel]
        FROM
            [SalesModel]
        PREDICTION
        SELECT
            NULL AS [SalesDate],
            12 AS [PredictionLength]
    ');

Algorithm Parameters

ParameterData TypeDescriptionDefault
AutoSelectionBOOLEANIf TRUE, the engine automatically determines optimal p, d, q values.TRUE
SeasonalityINTEGERNumber of periods in a season (e.g., 12 for monthly data).0 (none)
MaxLagINTEGERMaximum lag to consider for AR terms.12
ConfidenceLevelDOUBLEConfidence level for prediction intervals (0‑1).0.95

Best Practices

  1. Ensure your time series data is uniformly spaced (e.g., daily, monthly).
  2. Remove outliers and handle missing values before training.
  3. Use AutoSelection=TRUE for initial experiments; fine‑tune parameters for production.
  4. Validate model accuracy with a hold‑out set or cross‑validation.

Related Topics