Unit 6
Unit 6
TIME SERIES
ANALYSIS
Time series data
■ Time series analysis is a specific way of analyzing a sequence of data points
collected over an interval of time. In time series analysis, analysts record data
points at consistent intervals over a set period of time rather than just
recording the data points intermittently or randomly.
■ Time series analysis is a powerful statistical method that examines data
points collected at regular intervals to uncover underlying patterns and
trends. This technique is highly relevant across various industries, as it
enables informed decision making and accurate forecasting based on
historical data.
■ Time series analysis accounts for the fact that data points taken over time
may have an internal structure (such as autocorrelation, trend or seasonal
variation) that should be accounted for.
Examples of Time series data
■ Sensor data: Monitoring and analyzing sensor data from devices, machinery,
or infrastructure to predict maintenance needs, optimize performance, and
detect anomalies.
■ Weather forecasting: Utilizing historical weather data to forecast future
meteorological conditions, such as temperature, precipitation, and wind
patterns.
■ E-commerce and retail: Tracking sales data over time to identify seasonal
trends, forecast demand, and optimize inventory management and pricing
strategies.
■ Healthcare: Analyzing patient vital signs, medical records, and treatment
outcomes to improve healthcare delivery, disease surveillance, and patient
care.
■ Energy consumption: Studying electricity or energy usage patterns to
optimize consumption, forecast demand, and support energy efficiency
initiatives.
■ Manufacturing and supply chain: Monitoring production processes,
inventory levels, and supply chain data to enhance operational efficiency and
Time Series Vs Regression
■ Time series and regression are both methods of predictive analytics, but they
have different assumptions, techniques, and applications.
Time Series Vs Regression
Time series Regression
■ Time series assumes that ■ Regression assumes that
the data is ordered and the data is independent
dependent on time and random.
■ Time series uses methods ■ Regression uses
such as smoothing, methods such as linear,
decomposition, logistic, polynomial, and
autocorrelation, and multivariate models.
ARIMA models
■ Time series is more ■ Regression is more
suitable for forecasting and suitable for estimating
detecting patterns in and explaining the effect
temporal data. of variables on an
outcome.
Components of Time Series
Analysis
■ Trends show the general direction of the data, and
whether it is increasing, decreasing, or remaining
stationary over an extended period of time. Trends
indicate the long-term movement in the data and can
reveal overall growth or decline. For example,
e-commerce sales may show an upward trend over the
last five years.
■ Seasonality refers to predictable patterns that recur
regularly, like yearly retail spikes during the holiday
season. Seasonal components exhibit fluctuations
fixed in timing, direction, and magnitude. For instance,
electricity usage may surge every summer as people
turn on their air conditioners.
Components of Time Series
Analysis
■ Cycles demonstrate fluctuations that do not have a
fixed period, such as economic expansions and
recessions. These longer-term patterns last longer
than a year and do not have consistent amplitudes or
durations. Business cycles that oscillate between
growth and decline are an example.
■ Noise encompasses the residual variability in the data
that the other components cannot explain. Noise
includes unpredictable, erratic deviations after
accounting for trends, seasonality, and cycles.
■ A stationary process has the property that the mean, variance and
autocorrelation structure do not change over time. Stationarity can be
defined as a flat looking series, without trend, constant variance over time, a
constant autocorrelation structure over time and no periodic fluctuations. A
property where the statistical characteristics like mean and variance are
constant over time.
Additive and Multiplicative Models
■ Additive and multiplicative models are two common approaches used to represent the components
of a time series. These models help decompose a time series into its constituent parts, enabling a
better understanding of the underlying patterns and trends.
■ Additive Model: In an additive model, the observed values of a time series are considered as the
sum of the individual components. Mathematically, the additive model can be represented as:
■ Y(t) = Trend + Seasonality + Cyclical Patterns + Irregular Component
■ In this model, the effects of the different components are assumed to be additive, meaning that the
contribution of each component is independent of the others. The additive model is commonly
used when the magnitude of the seasonality and other components does not vary with the level of
the series.
■ Multiplicative Model: In a multiplicative model, the observed values of a time series are
considered as the product of the individual components. Mathematically, the multiplicative model
can be represented as:
■ Y(t) = Trend * Seasonality * Cyclical Patterns * Irregular Component
■ In this model, the effects of the different components are assumed to be multiplicative, meaning
that the contribution of each component is relative to the others. The multiplicative model is
commonly used when the magnitude of the seasonality and other components varies with the level
of the series.
Predictable and Unpredictable
■ Predictable Time Series:
– These are time series data that exhibit a clear pattern or trend that can be modeled
and forecasted with a reasonable degree of accuracy.
– Predictable time series often have identifiable seasonal or cyclical patterns, as well as
a trend component.
– Examples of predictable time series include sales data for seasonal products (e.g., ice
cream sales), stock prices with a discernible trend, or weather patterns in certain
regions.
– Techniques such as autoregressive integrated moving average (ARIMA), seasonal
decomposition, and machine learning algorithms can be effective for modeling and
forecasting predictable time series data.
■ Unpredictable Time Series:
– These are time series data that lack a clear pattern or trend, making them difficult to
model and forecast accurately.
– Unpredictable time series may exhibit random fluctuations, volatility, or irregular
patterns without any discernible trend or seasonality.
– Examples of unpredictable time series include stock prices in highly volatile markets,
random noise signals, or unpredictable events such as earthquakes or financial crises.
– Traditional statistical methods may struggle to provide accurate forecasts for
unpredictable time series. However, advanced techniques such as neural networks
(e.g., recurrent neural networks), ensemble methods, or sophisticated machine
learning algorithms can sometimes capture complex patterns in unpredictable data.
Local and Global
Trend
■ In any time series we can analyze the trend as local or global. This means
local trends are the values between the time series going in either upward or
downward direction and the global trend is an overview of the whole time
series. In the above images, the global trend of the time series is an uptrend
and in some points like around the point 1/88 the local trend is a downtrend
and before 1/88 and 1/85 the local trend is an uptrend.
Autocorrelation
■ Autocorrelation is a mathematical representation of
the degree of similarity between a given time
series and a lagged version of itself over successive
time intervals. It's conceptually similar to the
correlation between two different time series, but
autocorrelation uses the same time series twice: once
in its original form and once lagged one or more time
periods.
■ For example, if it's rainy today, the data suggests that
it's more likely to rain tomorrow than if it's clear today.
When it comes to investing, a stock might have a
strong positive autocorrelation of returns, suggesting
that if it's "up" today, it's more likely to be up tomorrow,
too.
■ Autocorrelation represents the degree of similarity between a given time
series and a lagged version of itself over successive time intervals.
■ Autocorrelation measures the relationship between a variable's current value
and its past values.
■ An autocorrelation of +1 represents a perfect positive correlation, while an
autocorrelation of -1 represents a perfect negative correlation.