0% found this document useful (0 votes)
5 views12 pages

Arima

The document discusses ARIMA, SARIMA, and SARIMAX models for time series forecasting, detailing their components and how to determine optimal parameters using ACF, PACF, and ADF tests. It also compares these models with alternative forecasting methods and outlines key performance indicators for retail merchandising dashboards. Additionally, it provides examples of dashboard components and metrics for sales performance, inventory management, and customer engagement.

Uploaded by

ajeshaju269
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views12 pages

Arima

The document discusses ARIMA, SARIMA, and SARIMAX models for time series forecasting, detailing their components and how to determine optimal parameters using ACF, PACF, and ADF tests. It also compares these models with alternative forecasting methods and outlines key performance indicators for retail merchandising dashboards. Additionally, it provides examples of dashboard components and metrics for sales performance, inventory management, and customer engagement.

Uploaded by

ajeshaju269
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

ARIMA, SARIMA, SARIMAX Models

These are popular time series forecasting models used to predict future values based on past
data.

1. ARIMA (AutoRegressive Integrated Moving Average)

○ Used for univariate time series forecasting.

○ Consists of three components:

■ AR (AutoRegressive, p): Uses past values to predict future values.

■ I (Integrated, d): Differencing is applied to make the series stationary.

■ MA (Moving Average, q): Uses past forecast errors to improve


predictions.

2. SARIMA (Seasonal ARIMA)

○ An extension of ARIMA that includes seasonal components.

○ Adds seasonal parameters: (P, D, Q, s)

■ P: Seasonal autoregressive order

■ D: Seasonal differencing order

■ Q: Seasonal moving average order

■ s: Seasonality period (e.g., 12 for monthly data, 7 for weekly data)

3. SARIMAX (Seasonal ARIMA with Exogenous Variables)

○ SARIMA with an additional exogenous variable (X).

○ Useful when external factors influence the time series.

Finding Optimal p, q, d values in ARIMA


1. Identify d (Differencing Order)

● Check stationarity using the Augmented Dickey-Fuller (ADF) test:

○ If p-value > 0.05, the series is non-stationary → Apply differencing.


○ If p-value < 0.05, the series is stationary.

● Start with d = 1, then check ADF again after differencing.

● If necessary, increase d until stationarity is achieved.

2. Identify p (AR Order) using PACF (Partial Autocorrelation Function)

● Plot PACF and look for the first significant lag (where PACF cuts off).

● This lag gives an estimate of p.

3. Identify q (MA Order) using ACF (Autocorrelation Function)

● Plot ACF and look for the first significant lag (where ACF cuts off).

● This lag gives an estimate of q.

Finding P, Q, D, s in SARIMA
● D: Seasonal differencing order (check seasonal stationarity using ADF test).

● P & Q: Identify seasonal AR & MA orders using seasonal lags in PACF & ACF plots.

● s: Seasonal period (e.g., 12 for monthly data, 7 for weekly data).

Example Workflow
1. Check stationarity (ADF test).

2. Determine d (Apply differencing if needed).

3. Plot ACF & PACF to identify p and q.

4. Fit ARIMA(p, d, q) and evaluate residuals.

5. If seasonality exists, use SARIMA with (P, D, Q, s).

6. Optimize parameters using AIC/BIC values.


ACF, PACF, and ADF Test: Detailed Explanation
When working with time series forecasting using ARIMA, SARIMA, and SARIMAX models, three
key statistical tools help determine model parameters:

1. ACF (Autocorrelation Function)

2. PACF (Partial Autocorrelation Function)

3. ADF (Augmented Dickey-Fuller) Test

1. ACF (Autocorrelation Function)


● Measures correlation between a time series and its past values (lags).

● Helps identify q (Moving Average order) in ARIMA.

● Interpreting ACF Plot:

○ If the ACF plot gradually declines → The series is not stationary (trend
exists).

○ If the ACF plot cuts off sharply at lag q → That’s the best estimate for q in
ARIMA(p, d, q).

○ If there’s a seasonal pattern in the ACF → You may need seasonal


differencing.

Example ACF Plot Analysis


Lag ACF Value Interpretation

1 0.8 Strong correlation with previous value

2 0.6 Moderate correlation

3 0.2 Weak correlation

4+ Close to 0 No correlation

🔹 Key Takeaway:
ACF tells us if past forecast errors (q values) should be included in the model.
2. PACF (Partial Autocorrelation Function)
● Measures correlation between a time series and its past values, but removes indirect
effects.

● Helps identify p (AutoRegressive order) in ARIMA.

● Interpreting PACF Plot:

○ If PACF sharply cuts off at lag p, this suggests p for ARIMA(p, d, q).

○ If PACF gradually declines, it suggests an MA process.

Example PACF Plot Analysis


Lag PACF Value Interpretation

1 0.9 Strong direct correlation

2 0.4 Moderate direct correlation

3 0.05 No direct correlation (cut-off)

🔹 Key Takeaway:
PACF helps determine the number of past values to include in the AR component.

3. ADF Test (Augmented Dickey-Fuller Test)


● Used to check stationarity of a time series.

● Null Hypothesis (H₀): The series is not stationary (it has a trend).

● Alternative Hypothesis (H₁): The series is stationary (no trend).

● Interpreting ADF Test Results:

○ p-value < 0.05 → Reject H₀, meaning the series is stationary.

○ p-value > 0.05 → Fail to reject H₀, meaning the series is not stationary.

Steps to Use ADF Test


1. Run ADF test on original series.
2. If p-value > 0.05, apply differencing (d = 1) and test again.

3. Continue until the series becomes stationary.

🔹 Key Takeaway:
If ADF test shows the series is non-stationary, apply differencing d times until it becomes
stationary.

Finding p, q, and d Using These Methods


1. Find d:

○ Use ADF test → If series is non-stationary, apply differencing.

○ Keep differencing until p-value < 0.05.

2. Find p:

○ Use PACF plot → The lag where PACF cuts off is the value of p.

3. Find q:

○ Use ACF plot → The lag where ACF cuts off is the value of q.

Why Use ARIMA Over Other Models?


The ARIMA (AutoRegressive Integrated Moving Average) model is widely used for time
series forecasting due to its ability to capture trend, seasonality (with SARIMA), and noise in
data. It is particularly effective when dealing with stationary time series data with strong
temporal dependence.

However, other models exist, and choosing the right model depends on the nature of the data.

Alternative Time Series Forecasting Models


1. ARIMA (AutoRegressive Integrated Moving Average)
● Best for: Univariate time series with trends and patterns but without strong
seasonality.

● Weakness: Does not handle exogenous variables or deep seasonality well.


2. SARIMA (Seasonal ARIMA)
● Best for: Time series data with seasonality.

● Why use it? Extends ARIMA with seasonal differencing and seasonal components (P,
D, Q, s).

● Example Use Case: Monthly sales forecasting where patterns repeat yearly.

3. SARIMAX (Seasonal ARIMA with Exogenous Variables)


● Best for: Time series data influenced by external factors (e.g., promotions, holidays).

● Why use it? Includes exogenous variables (X) to improve accuracy.

● Example Use Case: Sales prediction considering ad campaigns.

4. Exponential Smoothing (ETS – Error, Trend, Seasonality)


● Best for: Data with trend and seasonality.

● Why use it? Assigns exponentially decreasing weights to older observations.

● Example Use Case: Inventory forecasting with demand spikes.

5. Prophet (Developed by Facebook)


● Best for: Business forecasting with multiple seasonal patterns and missing data.

● Why use it? Handles holiday effects and missing values better than ARIMA.

● Example Use Case: Website traffic forecasting.

6. LSTM (Long Short-Term Memory – Deep Learning)


● Best for: Complex patterns in time series, especially with non-linear trends.

● Why use it? Can handle long-term dependencies and large datasets.

● Weakness: Requires large training data and computational power.

● Example Use Case: Stock price prediction.

7. XGBoost / Random Forest Regressor


● Best for: When external factors play a major role in time series.

● Why use it? Captures complex relationships between variables.

● Weakness: Requires feature engineering.

● Example Use Case: Demand forecasting considering weather, promotions, and past
sales.

Advantages of ARIMA
✅ Handles Trend & Noise: Captures underlying patterns by differencing (d).
✅ Works Well on Small Datasets: Unlike deep learning, it does not need large training
data.
✅ Interpretable & Explainable: Unlike black-box models like LSTM.
✅ Combines AR & MA: Handles both past values (AR) and past forecast errors (MA).
✅ Widely Used & Tested: Proven effectiveness across industries.

When NOT to Use ARIMA?


❌ When data has multiple seasonal patterns → Use SARIMA or Prophet.
❌ When external factors affect predictions → Use SARIMAX or XGBoost.
❌ When relationships are highly non-linear → Use LSTM or Neural Networks.

For a Retail Merchandiser Dashboard, the main KPIs and metrics should provide insights
into sales performance, inventory management, customer behavior, and profitability.
These metrics help clients understand business growth, operational efficiency, and areas
for improvement.

📊 Key KPIs & Metrics for Retail Merchandising


Dashboards
1. Sales Performance Metrics
✅ Total Sales Revenue – Overall revenue generated over a specific period.
✅ Sales Growth (%) – Percentage increase or decrease in sales compared to previous
periods.
✅ Average Order Value (AOV) – Revenue per transaction, calculated as:
AOV=Total RevenueNumber of OrdersAOV = \frac{\text{Total Revenue}}{\text{Number of
Orders}}AOV=Number of OrdersTotal Revenue

✅ Units Sold – Number of products sold within a given period.


✅ Sales by Product Category – Breakdown of sales across different product
categories.
✅ Sales by Location – Identify high-performing stores or regions.
✅ Sales per Employee – Evaluate staff performance in driving sales.

2. Inventory & Supply Chain Metrics


✅ Inventory Turnover Ratio – Measures how quickly stock is sold and replaced:

Inventory Turnover=Cost of Goods Sold (COGS)Average Inventory Value\text{Inventory


Turnover} = \frac{\text{Cost of Goods Sold (COGS)}}{\text{Average Inventory Value}}Inventory
Turnover=Average Inventory ValueCost of Goods Sold (COGS)

✅ Stock-Out Rate (%) – Percentage of times an item is out of stock.


✅ Reorder Point Analysis – Alerts for restocking based on demand forecasts.
✅ Days of Inventory on Hand – Estimates how long current stock will last.
✅ Shrinkage Rate (%) – Measures inventory loss due to theft, damage, or errors.

3. Customer & Engagement Metrics


✅ Customer Retention Rate (%) – Percentage of returning customers.
✅ Customer Lifetime Value (CLV) – Predicts long-term revenue from a customer.
✅ Customer Acquisition Cost (CAC) – Cost of acquiring a new customer:

CAC = \frac{\text{Marketing & Sales Expenses}}{\text{New Customers Acquired}}

✅ Conversion Rate (%) – Percentage of visitors making a purchase.


✅ Cart Abandonment Rate (%) – Percentage of customers leaving without completing a
purchase.

4. Pricing & Profitability Metrics


✅ Gross Profit Margin (%) – Measures profitability before expenses:

Gross Margin=Revenue - COGSRevenue×100\text{Gross Margin} = \frac{\text{Revenue -


COGS}}{\text{Revenue}} \times 100Gross Margin=RevenueRevenue - COGS×100

✅ Net Profit Margin (%) – Profitability after all expenses.


✅ Markdown & Discount Impact – Effect of discounts on revenue and profit.
✅ Price Elasticity of Demand – Impact of price changes on sales volume.

5. Marketing & Promotion Metrics


✅ Return on Ad Spend (ROAS) – Measures effectiveness of marketing campaigns.
✅ Revenue by Marketing Channel – Identify the most profitable channels.
✅ Campaign Performance – Track sales impact from promotions.

6. Store Performance Metrics


✅ Foot Traffic Analysis – Number of people visiting the store.
✅ Sales per Square Foot – Performance of physical stores.
✅ Staff Performance Metrics – Sales per employee, customer service ratings.

📌 Example Dashboard Components


● 📈 Line Charts: Sales Growth, Revenue Trends, Customer Retention.

● 📊 Bar Charts: Best-Selling Products, Sales by Region.

● 📉 Heatmaps: Inventory Levels Across Stores.

● 📌 KPI Cards: Total Revenue, Profit Margins, AOV.

📊 Sales Dashboard: Key KPIs & Metrics (Month-over-Month Analysis)


A Sales Dashboard provides a clear monthly view of business performance, highlighting
growth, revenue trends, and areas for improvement. It helps in tracking sales progress,
optimizing inventory, and making data-driven decisions.

📌 Key KPIs & Metrics for a Monthly Sales Dashboard


1. Sales Performance Metrics
✅ Total Sales Revenue – Total income from sales for the month.
✅ Sales Growth Rate (%) – Month-over-month (MoM) change in sales:

Sales Growth Rate=Current Month Sales−Previous Month SalesPrevious Month


Sales×100\text{Sales Growth Rate} = \frac{\text{Current Month Sales} - \
text{Previous Month Sales}}{\text{Previous Month Sales}} \times 100Sales Growth
Rate=Previous Month SalesCurrent Month Sales−Previous Month Sales×100

✅ Units Sold – Total quantity of products sold in the month.


✅ Average Order Value (AOV) – Measures revenue per transaction:
AOV=Total RevenueNumber of OrdersAOV = \frac{\text{Total Revenue}}{\text{Number of
Orders}}AOV=Number of OrdersTotal Revenue

✅ Revenue by Product Category – Identifies high-performing product segments.


✅ Sales per Region/Store – Compares geographic or store-based performance.

2. Customer & Engagement Metrics


✅ New vs. Returning Customers – Helps track customer loyalty.
✅ Customer Retention Rate (%) – Percentage of customers making repeat purchases.
✅ Conversion Rate (%) – Percentage of site visitors who complete a purchase:

Conversion Rate=Total SalesTotal Visitors×100\text{Conversion Rate} = \frac{\text{Total Sales}}


{\text{Total Visitors}} \times 100Conversion Rate=Total VisitorsTotal Sales×100

✅ Cart Abandonment Rate (%) – Percentage of users leaving without completing a purchase.

3. Inventory & Supply Chain Metrics


✅ Stock Availability (%) – Percentage of inventory available to meet demand.
✅ Inventory Turnover Ratio – Measures how quickly stock is sold and replenished:

Inventory Turnover=Cost of Goods Sold (COGS)Average Inventory\text{Inventory Turnover} = \


frac{\text{Cost of Goods Sold (COGS)}}{\text{Average Inventory}}Inventory Turnover=Average
InventoryCost of Goods Sold (COGS)

✅ Out-of-Stock Rate (%) – Identifies products frequently out of stock.

4. Pricing & Profitability Metrics


✅ Gross Profit Margin (%) – Measures profitability before expenses:

Gross Margin=Revenue - COGSRevenue×100\text{Gross Margin} = \frac{\text{Revenue -


COGS}}{\text{Revenue}} \times 100Gross Margin=RevenueRevenue - COGS×100

✅ Net Profit Margin (%) – Overall profitability after expenses.


✅ Discount & Promotion Impact – Effect of discounts on sales volume.

5. Marketing & Campaign Effectiveness Metrics


✅ Sales from Marketing Campaigns – Tracks revenue generated from promotions.
✅ Return on Ad Spend (ROAS) – Efficiency of ad spending.
✅ Revenue by Channel (Online vs. Offline Sales) – Determines the best-performing
channels.
📊 Recommended Graphs & Visualizations
1. Monthly Sales Trend (Line Chart)
● Tracks sales performance over time.

● Helps in identifying seasonal trends.

2. Sales Breakdown by Category (Bar Chart)


● Shows revenue contribution by different product categories.

● Helps in inventory planning and marketing.

3. New vs. Returning Customers (Pie Chart)


● Highlights customer retention trends.

4. Revenue by Region/Store (Heatmap or Bar Chart)


● Shows top-performing locations based on sales.

5. Profitability by Product (Scatter Plot)


● Compares sales volume vs. profit margin for different products.

6. Inventory Turnover (Stacked Bar Chart)


● Shows how quickly stock is being sold and replaced.

7. Marketing Effectiveness (Funnel Chart)


● Displays customer journey from website visit → cart → purchase.

📌 Example Dashboard Components


● 📊 KPI Cards: Total Sales, Sales Growth Rate (%), AOV, Conversion Rate (%).
● 📈 Trend Analysis Section: Monthly Revenue Trend, Units Sold, Profit Margins.

● 📊 Product & Region Analysis: Best-selling Products, Revenue by Location.

● 📉 Marketing & Customer Insights: ROAS, Cart Abandonment Rate, Customer


Retention.

You might also like