Statistics · June 9, 2024

Time Series Introduction

What is time series analysis?

  • As the name suggest its an analysis done from the perspective of time.
  • Time series analysis is a prediction technique.
  • It is used to understand the behavior and pattern of data from the perspective of time. Based on this pattern we will predict future.
  • Time series data is a data collected over a period of time. This data will be in chronological order and will follow sequences.
  • Instead of time series prediction we can call it time series forecasting as well. In this forecasting we will forecast future values.
  • Examples:
    • Business and Finance
      • Sales Forecasting: Businesses can analyze past sales data to predict future demand for products. This helps with better inventory management, production planning, and marketing strategies.
      • Stock Market Analysis: By identifying trends and patterns in historical stock prices, time series analysis aids investors in making informed investment decisions.
      • Website Traffic Analysis: Analyzing website traffic data over time helps businesses understand user behavior, optimize website design, and improve marketing campaigns.
    • Science and Technology
      • Weather Forecasting: Meteorologists rely on historical weather data (temperature, pressure, humidity) to predict future weather patterns.
      • Climate Change Analysis: Time series analysis helps us track changes in global temperatures, sea levels, and other climate indicators over extended periods.
      • Sensor Data Analysis: The “Internet of Things” generates vast amounts of sensor data. Time series analysis helps identify anomalies, predict equipment failures, and optimize performance.
    • Healthcare and Public Health
      • Disease Outbreaks: Public health officials can identify trends and predict potential outbreaks by analyzing historical disease data, allowing for early intervention.
      • Patient Monitoring: Vital signs like heart rate and blood pressure are often collected in time series. This data can be analyzed to monitor patient health and identify potential complications.
      • Epidemiological Studies: Time series analysis is used to study the spread of diseases and identify factors that influence transmission rates.

Components of Time Series

Time series data, which is a sequence of data points collected or recorded at specific time intervals, can be decomposed into several fundamental components.These components are very important for effective analysis and forecasting. The main components of a time series are:

Trend

  • Definition: The long-term movement or direction in the data.
  • Characteristics: Indicates the overall increase, decrease, or stability over a long period.
  • Examples: A steady upward trend in the stock market index, a long-term decline in the sales of a product.
  • Visualization: Typically represented by a smooth line that captures the underlying direction of the data when plotted over time.

Seasonality

  • Definition: The repeating short-term cycle or pattern in the data.
  • Characteristics: Regular and predictable patterns that occur at specific intervals such as daily, weekly, monthly, or yearly. It can occur at specific festivals as well.
  • Examples: Higher ice cream sales during summer months, increased retail sales during the holiday season.
  • Visualization: Represented by peaks and troughs at regular intervals when plotted over time.

Cyclic Patterns

  • Definition: The long-term oscillations or wave-like patterns in the data.
  • Characteristics: Irregular intervals that are not as predictable as seasonal patterns; often influenced by economic or business cycles.
  • Examples: Economic expansions and contractions, business cycles with periods of growth and recession.
  • Visualization: Represented by undulating curves with varying periods and amplitudes when plotted over time.

Noise (Irregular Component)

  • Definition: The random variation or fluctuations in the data that cannot be attributed to trend, seasonality, or cyclic patterns.
  • Characteristics: Unpredictable and random in nature; often considered as the residual component after other components are removed.
  • Examples: Sudden spikes in sales due to an unexpected event, random fluctuations in temperature readings.
  • Visualization: Appears as random scatter around the trend and seasonal components when plotted over time.

Decomposing Time Series

Time series decomposition is the process of separating a time series into its individual components. This can be done using various methods such as additive and multiplicative decomposition.

Each term in below equation represents a specific component of the time series:

  • Y(t) – The Observed Value at Time t
    • Definition: The actual value of the time series at a specific time point t.
    • Example: If you are analyzing daily sales data, Y(t) could be the sales figure for a particular day or date.
  • T(t) – The Trend Component
    • Definition: The trend component captures the long-term progression or general direction of the data over time.
    • Characteristics: Reflects the overall upward, downward, or stable movement in the time series.
    • Example: Over several years, the overall increase in sales due to market expansion.
  • S(t) – The Seasonal Component
    • Definition: The seasonal component represents the repeating short-term cycle in the data.
    • Characteristics: Accounts for regular and predictable patterns that occur at specific intervals (e.g., monthly, quarterly, yearly, festivals).
    • Example: Higher sales during the holiday season every year.
  • E(t) – The Irregular (Error or Noise) Component
    • Definition: The irregular component captures the random variation or noise in the data that cannot be explained by the trend or seasonal components.
    • Characteristics: Includes all unpredictable and random influences that affect the time series.
    • Example: Unexpected sales spikes due to a promotional event.

Additive Decomposition

  • ModelY(t) = T(t) + S(t) + E(t)
  • Usage: Used when the seasonal variations are roughly constant over time.
  • Example: Daily temperature data where seasonal variations do not change significantly over the years.
    It means in summer there wont be much temperature difference between different days. There will be minimum changes in temperature between days.

Multiplicative Decomposition

  • ModelY(t) = T(t) × S(t) × E(t)
  • Usage: Used when the seasonal variations change proportionally with the trend.
  • Example: Daily temperature data where seasonal variations change significantly over the years. It may be due to global warming or any other natural phenomenon.
    For example, if seasonal variations become more extreme over time, with summers getting hotter and winters becoming colder, this could indicate a multiplicative relationship between the trend and seasonal variations in temperature data.
    It means in summer there will be noticeable temperature difference between different days. One day it will be higher compared to another day.