Lecture 7
Lecture 7
Time Series
z
Modeling
z
Time series modeling is a statistical technique used to analyze and forecast data
points collected over time. It involves studying the patterns, trends, and
dependencies within a dataset to make predictions about future values.
The goal of time series modeling is to capture the underlying patterns and
relationships within the data and use them to make predictions or generate
insights. This is typically done by fitting a mathematical model to the observed
data and using that model to forecast future values.
Common techniques in time series modeling:
z
Autoregressive Integrated Moving Average (ARIMA)
ARIMA models are a popular class of models used for time series forecasting. They combine autoregressive (AR), moving average (MA), and
differencing (I) components to capture the temporal dependencies and trends in the data.
Exponential smoothing methods, such as Simple Exponential Smoothing (SES), Holt's Linear Exponential Smoothing, and Holt-Winters' Seasonal
Exponential Smoothing, are used to forecast time series data by assigning exponentially decreasing weights to past observations.
STL is a method that decomposes a time series into its seasonal, trend, and residual components. This decomposition helps in understanding the
underlying patterns and can be useful for forecasting.
VAR models are used to capture the relationships between multiple time series variables. They allow for modeling the dependencies and
interactions between variables, making them suitable for forecasting multivariate time series data.
LSTM is a type of recurrent neural network (RNN) architecture that is widely used for time series forecasting. LSTM networks can capture long-
term dependencies in the data and have been successful in modeling complex temporal patterns.
z
Time series analysis
and forecasting
There are various Autoregressive (AR) The AR model predicts future values based on a linear combination of the previous observations.
It assumes that the future values depend on the past values with some time lag.
techniques and Autoregressive Integrated Moving Average (ARIMA) ARIMA combines both autoregressive and moving average
models used in time components with differencing to make the time series stationary. It is a popular model for forecasting non-stationary
time series data.
series analysis and Exponential Smoothing (ES) Exponential smoothing models assign exponentially decreasing weights to the past
forecasting: observations, giving more importance to recent observations. Different variations of exponential smoothing models
exist, such as Simple Exponential Smoothing (SES), Holt's Linear Exponential Smoothing, and Holt-Winters' Seasonal
Exponential Smoothing.
Seasonal ARIMA (SARIMA) SARIMA models extend the ARIMA model to incorporate seasonal patterns in the data.
They are suitable for forecasting time series with both trend and seasonal components.
Prophet Prophet is a forecasting model developed by Facebook that is particularly useful for time series data with
multiple seasonality components and non-linear trends. It incorporates seasonality, trend, and holiday effects in the
forecast.
Machine Learning Approaches Machine learning algorithms, such as support vector machines (SVM), random forests,
and neural networks, can also be applied to time series forecasting. These approaches capture complex patterns and
dependencies in the data.
z
When performing time series analysis and forecasting, it is
important to evaluate the performance of the models using
appropriate metrics, such as mean squared error (MSE) or
root mean squared error (RMSE). Model validation
techniques, such as cross-validation or out-of-sample testing,
can be used to assess the accuracy and generalization of the
forecasts.
Differencing
Differencing involves computing the difference between
consecutive observations. Seasonal differencing is performed
to remove the seasonal patterns and make the data stationary.
Trend represents the long-term systematic increase or decrease in the data
over time. It reflects the overall direction or tendency of the time series.
z Identifying and understanding the trend is crucial for uncovering the
underlying growth or decline in the data.
• Moving Averages
Moving averages smooth out short-term fluctuations and highlight the long-
term trend. They involve calculating the average of a fixed number of
consecutive data points.
• Linear Regression
Linear regression can be applied to fit a straight line to the time series data.
The slope of the line represents the trend direction and magnitude.
• Decomposition
Decomposition separates a time series into its trend, seasonality, and residual
components. This technique helps in isolating and analyzing the trend
component.
z
It is important to note that time series data can
exhibit both seasonality and trend
simultaneously. In such cases, it may be
necessary to apply techniques like seasonal
decomposition of time series or modeling
approaches that can capture both components.