Time Series Forecasting: Meaning, Methods, Models, and Examples

By Rahul Singh

Updated on Nov 26, 2026

Share:

Quick Overview:

  • Time series forecasting is a method that makes use of the observations gathered in the past over time to forecast future values.

  • Some of the important elements of time series forecasting are trend, seasonality, cycles, level, and irregularities affecting forecasts.

  • Various time series forecasting techniques include ARIMA, SARIMA, exponential smoothing, machine learning, deep learning, and foundation models.

  • Foundation models like Chronos, TimesFM, and Moirai can forecast unseen time series data without any need for further training.

  • In this blog you will learn what time series forecasting is, its working, methods, models, Python examples, benefits, and drawbacks.

Time series forecasting is a key skill in applied data science. IIT Kharagpur's Applied Data Science & Agentic AI Course – Executive Post Graduate Certificate helps you apply statistical and machine learning techniques to real business problems.

What Is Time Series Forecasting?

It's the practice of predicting future values of a variable using observations of that same variable collected over time, in order. The data points are taken at regular intervals, such as every hour, day, or month, and their order matters. Shuffle the rows and the information is gone.

Time series analysis and forecasting are related but not identical. 


Time series forecasting infographic showing how historical data collected at regular intervals helps predict future values, highlighting the difference between analysis and forecasting and the importance of preserving chronological order.
  • Analysis looks backward. It asks what patterns exist, such as a rising trend, a weekly cycle, or a sudden break. 

  • Forecasting looks forward and uses those patterns to estimate what comes next. 

In practice, time series analysis forecasting projects always start with analysis, because you can't predict a pattern you haven't understood.

Suppose a bakery records daily sales of cakes for two years. The data probably shows busier weekends, a bump before holidays, and slow growth as the shop gets known. A forecast uses those patterns to say how many cakes to bake next Saturday, ideally with a range, such as "between 118 and 140," so the baker can plan for both outcomes.

Key Components of Time Series Data

Most time series can be described as a mix of a few building blocks. Let’s explore those key components:

Component

What It Is

Example

Trend

The long-term direction of the series, upward, downward, or flat

Steady growth in monthly subscribers

Seasonality

A pattern that repeats over a fixed period

Ice cream sales peaking every summer

Cyclic pattern

Rises and falls without a fixed period, often tied to the economy

Housing activity across business cycles

Irregular component (noise)

Random variation that no pattern explains

A one-off supply glitch or a freak weather day

Level

The baseline value around which the series moves

Average daily demand of 500 units

Seasonality and cycles are often confused. Seasonal patterns have a known, fixed length such as 7 days or 12 months. Cycles vary in length and are much harder to predict. Splitting a series into these parts is called decomposition, and it's usually the first thing a forecaster does with new data.

Mathematical and Statistical Concepts Behind Time Series Forecasting

Time Series Forecasting makes use of various mathematical and statistical concepts to find out patterns in past data to forecast future values.

Concept

Meaning

Why It Matters

Stationarity

A series whose mean, variance, and correlation structure don't change over time

Many classical models, such as ARIMA, assume it

Differencing

Replacing each value with its change from the previous one

A common way to remove trend and make a series stationary

Autocorrelation (ACF)

How strongly a value relates to its own past values at different lags

Reveals seasonality and memory in the data

Partial autocorrelation (PACF)

The relationship with a lag after removing the effects of shorter lags

Helps choose how many past values a model needs

Lag

A past value used as an input, such as sales one week ago

The basic building block of both statistical and machine learning models

Forecast horizon

How far ahead you predict

Accuracy usually falls as the horizon grows

Backtesting

Testing a model on past data it hasn't seen, moving forward through time

The honest way to estimate real accuracy

Two decompositions cover most cases. In the additive form, the components add up, which suits series whose seasonal swings stay the same size. In the multiplicative form, they multiply, which suits series whose swings grow with the level:

Additive:        y(t) = Trend(t) + Seasonal(t) + Noise(t)

Multiplicative:  y(t) = Trend(t) x Seasonal(t) x Noise(t)

Accuracy is measured by comparing forecasts with what actually happened:

MAE  = average of |actual - forecast|

RMSE = square root of the average of (actual - forecast)^2

MAPE = average of |actual - forecast| / |actual|

MASE = MAE of the model / MAE of a naive forecast

MASE is especially useful. A value below 1 means the model beats the simple baseline, and a value above 1 means you'd have done better by just repeating the last value or last season.

Different Types of Time Series Data

By knowing about the various forms of time-series data, one can select an appropriate forecasting method for it.

Type

Description

Example

Univariate

One variable tracked over time

Daily closing price of one stock

Multivariate

Several related variables tracked together

Sales, price, and weather together

Regular

Observations at fixed intervals

Hourly meter readings

Irregular

Observations at uneven intervals

Sensor readings sent only when something changes

Stationary

Statistical properties stay constant

Noise around a fixed average

Non-stationary

Trend or changing variance

Revenue of a growing company

Panel or many series

Many related series, such as one per product or store

Weekly sales for 10,000 products

Hierarchical

Series that add up to higher-level totals

Store sales that sum to regional and national sales

How Does Time Series Forecasting Work?

A forecasting project follows a loop of understanding the data, trying models, checking them honestly, and then watching them in production.

  1. Define the goal and the horizon. Decide what is being predicted, how far ahead, and how the forecast will be used. A forecast for next week's staffing needs a different horizon and accuracy than one for next year's budget.

  2. Collect and clean the data. Fix missing timestamps, duplicates, and obvious errors, and put the data on a regular schedule if needed.

  3. Explore and decompose. Plot the series, look for trend, seasonality, and breaks, and check autocorrelation.

  4. Transform and engineer features. Apply differencing or a log transform if needed, and add helpful inputs such as lags, rolling averages, holidays, and prices.

  5. Choose models and backtest them. Start with simple baselines, then try stronger models, and compare them on held-out time periods.

  6. Forecast, monitor, and retrain. Produce forecasts, track the error as real data arrives, and refresh the model when accuracy slips.

One habit separates good forecasting projects from weak ones: they treat accuracy as something measured against a baseline, not in isolation. An error of 8% sounds fine until you learn a naive forecast scores 6%. Build the baseline first in step 5, record its score, and require every later model to beat it on the same backtest windows. 

This also keeps time series analysis and forecasting honest, because it makes it obvious when a complicated model adds nothing over a simple rule.

Time Series Forecasting Methods and Models

Time series forecasting methods fall into four broad families: classical statistical methods, machine learning with engineered features, deep learning, and pretrained foundation models. 

The most popular time series forecasting models differ mainly in how much structure they assume.

Time Series Forecasting Methods at a Glance

Method

Idea

Strengths

Weaknesses

Naive and seasonal naive

Repeat the last value or the value from one season ago

Free, fast, and a necessary baseline

Ignores trend and any other signal

Moving average

Average of the most recent values

Simple and smooths noise

Lags behind trends, no seasonality

Exponential smoothing (ETS, Holt-Winters)

Weighted averages that favor recent data, with trend and seasonal terms

Strong on regular seasonal data, easy to explain

One series at a time, limited extra inputs

ARIMA and SARIMA

Combines past values, past errors, and differencing

Flexible and well understood, gives intervals

Needs stationarity and tuning, slow across many series

Decomposable models (such as Prophet)

Fits trend, seasonality, and holiday effects separately

Handles holidays and missing data, easy to use

Can underfit sharp short-term dynamics

Machine learning (XGBoost, LightGBM, random forest)

Predicts from lag, rolling, and calendar features

Uses many inputs, scales to many series

Needs feature engineering and careful validation

Deep learning (LSTM, N-BEATS, Temporal Fusion Transformer, PatchTST)

Neural networks learn patterns across series

Strong on large, complex datasets

Needs lots of data, tuning, and compute

Foundation models (Chronos, TimesFM, Moirai)

Pretrained on huge collections of series and applied directly

No training needed, handles short histories

Large, harder to explain, results vary by dataset

Time Series Forecasting Using Foundation Models

Time series foundation models learn from large collections of historical data, such as retail sales, sensor logs, and web traffic. They can forecast unseen time series without additional training, a process known as zero-shot forecasting.

Popular time series foundation models include:

  • Chronos-2 (Amazon): Supports multiple related time series and external variables with around 120 million parameters.

  • TimesFM 2.5 (Google): Contains around 200 million parameters and processes historical sequences of up to 16,384 data points.

  • Moirai (Salesforce): Supports forecasting across different datasets and domains.

  • Toto (Datadog) and TiRex: Other foundation models designed for time series forecasting.

The GIFT-Eval benchmark evaluates forecasting models across 97 tasks from 55 datasets.

Time Series Forecasting in Python

Python has the most comprehensive set of tools available for time series prediction. Generally, time series forecasting in Python would begin with pandas for the dataset and statsmodels for the first models. The statsmodels package provides classical models such as Holt-Winters and SARIMA.

In the example below, the dataset consists of 10 years of artificially generated monthly sales data, where the last 12 months will be used for testing purposes, and there are four different methods to forecast based on MAE.

Python Code Example

import numpy as np

import pandas as pd

from statsmodels.tsa.holtwinters import ExponentialSmoothing

from statsmodels.tsa.statespace.sarimax import SARIMAX

# 1. Build a monthly series: trend + yearly seasonality + noise

rng = np.random.default_rng(42)

dates = pd.date_range("2016-01-01", periods=120, freq="MS")

t = np.arange(120)

sales = 200 + 2.0 t + 30 np.sin(2 np.pi t / 12) + rng.normal(0, 8, 120)

series = pd.Series(sales, index=dates)

# 2. Split by time, never at random

train, test = series[:-12], series[-12:]

def mae(actual, forecast):

    return float(np.mean(np.abs(actual.values - np.asarray(forecast))))

# 3. Baselines and models

naive = np.repeat(train.iloc[-1], 12)

seasonal_naive = train.iloc[-12:].values

hw = ExponentialSmoothing(

    train, trend="add", seasonal="add", seasonal_periods=12

).fit()

hw_forecast = hw.forecast(12)

sarima = SARIMAX(

    train, order=(1, 1, 1), seasonal_order=(1, 1, 1, 12)

).fit(disp=False)

sarima_forecast = sarima.forecast(12)

results = {

    "Naive": mae(test, naive),

    "Seasonal naive": mae(test, seasonal_naive),

    "Holt-Winters": mae(test, hw_forecast),

    "SARIMA(1,1,1)(1,1,1,12)": mae(test, sarima_forecast),

}

for name, score in results.items():

    print(f"{name:26s} MAE = {score:6.2f}")

# 4. A forecast interval from SARIMA

interval = sarima.get_forecast(12).conf_int(alpha=0.05)

print("\nFirst forecast month with 95% interval:")

print(f"{sarima_forecast.iloc[0]:.1f}  ({interval.iloc[0, 0]:.1f} to {interval.iloc[0, 1]:.1f})")

A test run printed the following:

Naive                      MAE =  29.98

Seasonal naive             MAE =  25.90

Holt-Winters               MAE =   5.61

SARIMA(1,1,1)(1,1,1,12)    MAE =   7.67

First forecast month with 95% interval:

406.5  (393.2 to 419.8)

Teams that run time series forecasting Python code in production usually wrap this same pattern in a loop, so each product, store, or sensor gets its own backtest. 

The functions stay the same. Only the data changes. Libraries like statsforecast speed this up by fitting thousands of models in parallel, which matters when you forecast an entire catalog every night.

Advantages and Limitations of Time Series Forecasting

The time series method is essential for predicting future trends and aiding in making sound decisions; however, the level of accuracy of the prediction will be determined by various factors.

Advantages

Limitations

Turns past data into numbers you can plan around, such as stock, staffing, and budgets

Assumes the future will resemble the past, so sudden shocks break it

Works with a single variable, so it needs little data collection

Accuracy falls quickly as the forecast horizon grows

Simple methods are cheap, fast, and easy to explain

Strong models need clean, regular data with few gaps

Can include trend, seasonality, holidays, and outside factors

Hard to predict one-off events such as pandemics, strikes, or policy changes

Probabilistic forecasts show the range of likely outcomes

Complex models can overfit and look better in testing than in production

One approach scales from a single series to thousands

Needs regular monitoring and retraining as patterns drift

New foundation models work on short histories with no training

Foundation models are large, costly to run, and sometimes lose to simple baselines

Supports early warnings, such as spotting demand shifts or equipment trouble

Correlation in time isn't cause and effect, so forecasts can mislead if used as explanations

Conclusion

The time series forecast is more than predicting future values; it is about the patterns that lie behind them. The choice of the proper model relies on several factors such as data quality, seasonality, forecasting purpose, and complexity of patterns in history.

It is advisable to start with simple forecasting models, evaluate them through backtesting, and apply advanced approaches if necessary.


Rahul Singh

Rahul Singh

40+ of articles published


Current role in the industry :

Associate - Content Marketing

Education Qualification :

B.Tech in Computer Science & Engineering

Expertise :

Artificial intelligenceMachine Learning (ML)Data ScienceFull-Stack DevelopmentData Structures & Algorithms

Tools & Technologies :

PythonReact.js & Next.jsJavaScript (ES6+)SQLTailwind CSSNode.js & MongoDBGit & GitHubSEO Tools (SEMRush)Google Search ConsoleTableau / Power BIFigma

About

Rahul Singh is an Associate Content Writer, with a strong interest in Generative AI, Agentic AI and AI-Native Software Engineering. He combines technical development skills with data-driven strategies to build scalable applications and optimize digital content. Rahul specializes in simplifying complex concepts across AI, ML and software development into practical, easy-to-understand insights, helping learners understand how AI products, systems and services are built and applied. He focuses on real world applications and explains advanced topics in a clear, step by step manner so you can follow along without confusion. His work connects theory with hands-on examples, covering AI-assisted development, intelligent automation and AI integration in software applications. He aims to help you learn faster, create better projects, and apply your knowledge confidently in real scenarios.

Follow me on :

No blogs published yet.

Frequently Asked Questions

FAQ

Ready to Take the Next Step? Enroll Today!