SlideShare a Scribd company logo
1 of 20
TIME SERIES
FORECASTING USING
TBATS MODEL
Team Members:
• D22017 – P Gowtham Kumar
• D22041 – R Sai Sasi Sekhar
• D22049 – B Vinay Kumar
Course: TF
Introduction
TBATS is a forecasting method to
model time series data
• TBATS is an Acronym for key
features of the model
• The main aim of this is to forecast
time series with complex seasonal
patterns using exponential
smoothing
• There can be many types of
seasonality's present (e.g., time of
day, daily, weekly, monthly, yearly).
2
ADVANTAGES OF TBATS
• Many time series exhibit complex and multiple seasonal patterns (e.g., hourly data that
contains a daily pattern, weekly pattern and an annual pattern).
• The most popular models (e.g. ARIMA and exponential smoothing) can only account for
one seasonality.
• TBATS model has the capability to deal with complex seasonality's (e.g., non-integer
seasonality, non-nested seasonality and large-period seasonality) with no seasonality
constraints, making it possible to create detailed, long-term forecasts.
3
How to Forecast Time Series With Multiple Seasonality's
• We often encounter seasonality in time
series. Seasonality is the periodical
variation in our series. It is a cycle that
occurs over a fixed period in our series.
• Here, we can clearly see seasonal cycle,
as every year, the number of air
passengers peaks around the month of
July and falls down again.
• To forecast this series, we can simply use
a SARIMA model, since there is only one
seasonal period with a length of one
year.
4
Monthly total number of air passengers for an airline, from
January 1949 to December 1960. We notice a clear
seasonal pattern in the series, with more people travelling
during the months of June, July, and August
• Now, things get complicated when we are working with high frequency data.
• For example, an hourly time series can exhibit a daily, weekly, monthly and yearly
seasonality, meaning that we now have multiple seasonal periods.
• Take a look at the hourly traffic volume on the Interstate 94 shown below.
5
Hourly traffic volume,
westbound, on the interstate
94 in Minneapolis, Minnesota.
Here we can see both a daily
seasonality (more cars are on
the road during the day than
during the night),
But also a weekly seasonality
(more car are on the road
Monday to Friday, than during
the weekends).
6
• Looking at the data above, we can see that we have two seasonal periods!
• First, we have a daily seasonality, as we see that more cars travel on the road during the
day than during the night.
• Second, we have a weekly seasonality, as traffic volume is higher during weekdays than
during the weekend.
• In this case, a SARIMA model cannot be used, because we can only specify one seasonal
periods, whereas we definitely have two seasonal periods in our data: a daily seasonality
and a weekly seasonality.
• Using BATS and TBATS models, we can fit and forecast time series that have more than
one seasonal period.
7
BATS Model
• Exponential smoothing is a family of forecasting methods. The general idea behind these forecasting
methods is that future values are a weighted average of past values, with the weights decaying
exponentially as we go back in time. Forecasting methods include SES, DES and TES.
• State-space modelling is a framework in which a time series is seen as a set of observed data that is
influenced by a set of unobserved factors. The state-space model then expresses the relationship
between the two sets. Again, this must be seen as a framework, as an ARMA model can be expressed as a
state-space model.
• Box-Cox transformation is a power transformation that helps make the series stationary, by stabilizing the
variance and mean over time.
• ARMA errors is a process in which we apply an ARMA model on the residuals of the time series in order
to find any unexplained relationship. Usually, the residuals of a model should be totally random, unless
some information was not captured by the model. Here, we use an ARMA model to capture any
remaining information in the residuals.
• Trend is a component of a time series that explains the long-term change in the mean value of the series.
When we have a positive trend, then our series is increasing over time. With a negative trend, the series
decreases over time.
• The seasonal component is what explains the periodical variation in the series.
8
• To summarize, BATS is an extension of exponential smoothing methods that combines
a Box-Cox transformation to handle non-linear data and uses an ARMA model to
capture autocorrelation in the residuals.
• The advantage of using BATS is that it can treat non-linear data, solve the
autocorrelation problem in residuals since it uses an ARMA model, and it can take into
account multiple seasonal periods.
• However, the seasonal periods must be integer numbers, otherwise BATS cannot be
applied. For example, suppose that you have weekly data with a yearly seasonality,
then your period is 365.25/7 which is approximately 52.2. In that case, BATS is ruled
out.
• Furthermore, BATS can take a long time to fit if the seasonal period is very large,
meaning that it is not suitable if you have hourly data with a monthly (the period would
be 730).
• Thus, the TBATS model was developed to address that situation.
TBATS
• It uses the same components as the BATS model, however it represents each seasonal
period as a trigonometric representation based on Fourier series. This allows the model to
fit large seasonal periods and non-integer seasonal periods.
• It is thus a better choice when dealing with high-frequency data and it usually fits faster
than BATS.
• Applying the models to forecast the next seven days of hourly traffic volume.
9
First, double-seasonal Holt–Winters (DSHW) exponential smoothing equation with additive
trend and additive seasonality is shown below. This model (Eqs. 7 to 11), developed by Taylor
(2003), was an extension of the Holt–Winters exponential smoothing.
10
BATS
The following equations show the extension of double-seasonal Holt–Winters (DSHW),
called Box–Cox transformation, ARMA errors, trend, and multiple seasonal patterns (BATS).
These are expressed by Eqs. 12 to 17 (De Livera 2010).
11
TBATS
The following equations show the extension of BATS model by adapting Eqs. (12) to (17) with
the following expressions. This adaptation is called TBATS model (Eqs. 18 to 21) (De Livera
et al. 2011).
12
• Of course, we recognize the plot from the beginning of this article and notice that the
traffic volume is indeed lower during the weekend than during the weekdays. Also, we
see a daily seasonality, with traffic being heavier during the day than at night.
• Therefore, we have two periods: the daily period has a length of 24 hours, and the weekly
period has a length of 168 hours. Let’s keep that in mind as we move on to modeling.
13
14
Modeling
• For modeling of data. Here, we use the sktime package. This framework which brings many
statistical and machine learning methods for time series. It also uses a similar syntax
convention to scikit-learn, making it easy to use.
• The first step is to define our target and define the forecast horizon.
• Here, the target is the traffic volume itself.
• For the forecast horizon, we wish to predict one week of data.
• Since we have hourly data, we must then predict 168 timesteps (7 * 24) into the future.
Inference
• That’s a bit anticlimactic, but let’s understand why this happened.
• It is possible that our dataset is too small.
• It might be that the sample that we used for testing turns out to favor the baseline model.
One way to verify would be to forecast multiple 168 hour-horizon, to see if the baseline
model still outperforms the rest.
• Also, it can be that we were too strict with the models’ parameters. Here, we forced both
models to use Box-Cox transformations and remove the trend component. However, we
could have not specified those parameters, and the model would have tried both
possibilities for each parameter and select the one with the lowest AIC (Akaike’s
Information Criterion). While this makes the training process longer, it might also result in
better performance from BATS and TBATS.
• Nevertheless, a key takeaway is that a building a baseline model is very important for any
forecasting project.
15
Conclusion
• BATS and TBATS models, were used to forecast time series that have more than one
seasonal period, in which case a SARIMA model cannot be used.
• We applied both models to forecast the hourly traffic volume, but it turned out that our
baseline remained the best performing model.
• Nevertheless, we saw that BATS and TBATS can indeed model time series with complex
seasonality's.
16
Potential improvements
•Forecast multiple 168 hour-horizon and check if the baseline is indeed the most performant
model. the entire dataset original dataset can be used, which contains much more data than
what we worked with.
•Do not specify the parameters use_box_cox, use_trend, and use_damped_trend, and allow the
model to make the best selection based on the AIC.
17
Key takeaways
•Always build a baseline model when forecasting
•BATS and TBATS can be used for modeling time series with complex seasonality
•BATS works well when the periods are short and integer numbers
•TBATS trains faster than BATS and works with seasonal periods that are not integers
18
References
• https://towardsdatascience.com/how-to-forecast-time-series-with-multiple-
seasonalities-23c77152347e
• https://www.sktime.org/en/stable/api_reference/auto_generated/sktime.forecasting.tba
ts.TBATS.html
• https://blog.tenthplanet.in/time-series-forecasting-tbats/
• https://medium.com/intive-developers/forecasting-time-series-with-multiple-
seasonalities-using-tbats-in-python-398a00ac0e8a
• https://otexts.com/fpp2/complexseasonality.html
19
Thanks!
20

More Related Content

What's hot

Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet MahanaArima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet MahanaAmrinder Arora
 
KPMG Virtual Internship Task 2.pptx
KPMG Virtual Internship Task 2.pptxKPMG Virtual Internship Task 2.pptx
KPMG Virtual Internship Task 2.pptxVIDHIYA S B
 
Arima model
Arima modelArima model
Arima modelJassika
 
Churn in the Telecommunications Industry
Churn in the Telecommunications IndustryChurn in the Telecommunications Industry
Churn in the Telecommunications Industryskewdlogix
 
Demand forecast process and inventory management
Demand forecast process and inventory managementDemand forecast process and inventory management
Demand forecast process and inventory managementAbhishek Kumar
 
Time Series Analysis.pptx
Time Series Analysis.pptxTime Series Analysis.pptx
Time Series Analysis.pptxSunny429247
 
Lesson 1 introduction_to_time_series
Lesson 1 introduction_to_time_seriesLesson 1 introduction_to_time_series
Lesson 1 introduction_to_time_seriesankit_ppt
 
Data Science - Part X - Time Series Forecasting
Data Science - Part X - Time Series ForecastingData Science - Part X - Time Series Forecasting
Data Science - Part X - Time Series ForecastingDerek Kane
 
Forecasting Models & Their Applications
Forecasting Models & Their ApplicationsForecasting Models & Their Applications
Forecasting Models & Their ApplicationsMahmudul Hasan
 
Lesson 2 stationary_time_series
Lesson 2 stationary_time_seriesLesson 2 stationary_time_series
Lesson 2 stationary_time_seriesankit_ppt
 
Lesson 5 arima
Lesson 5 arimaLesson 5 arima
Lesson 5 arimaankit_ppt
 
Project time series ppt
Project time series pptProject time series ppt
Project time series pptamar patil
 
Forecasting Techniques
Forecasting TechniquesForecasting Techniques
Forecasting Techniquesguest865c0e0c
 

What's hot (20)

Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet MahanaArima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
 
KPMG Virtual Internship Task 2.pptx
KPMG Virtual Internship Task 2.pptxKPMG Virtual Internship Task 2.pptx
KPMG Virtual Internship Task 2.pptx
 
Time Series Analysis/ Forecasting
Time Series Analysis/ Forecasting  Time Series Analysis/ Forecasting
Time Series Analysis/ Forecasting
 
Three Big Data Case Studies
Three Big Data Case StudiesThree Big Data Case Studies
Three Big Data Case Studies
 
Arima model
Arima modelArima model
Arima model
 
Churn in the Telecommunications Industry
Churn in the Telecommunications IndustryChurn in the Telecommunications Industry
Churn in the Telecommunications Industry
 
Demand forecast process and inventory management
Demand forecast process and inventory managementDemand forecast process and inventory management
Demand forecast process and inventory management
 
Time Series Analysis.pptx
Time Series Analysis.pptxTime Series Analysis.pptx
Time Series Analysis.pptx
 
Lesson 1 introduction_to_time_series
Lesson 1 introduction_to_time_seriesLesson 1 introduction_to_time_series
Lesson 1 introduction_to_time_series
 
Data Science - Part X - Time Series Forecasting
Data Science - Part X - Time Series ForecastingData Science - Part X - Time Series Forecasting
Data Science - Part X - Time Series Forecasting
 
ARIMA Models - [Lab 3]
ARIMA Models - [Lab 3]ARIMA Models - [Lab 3]
ARIMA Models - [Lab 3]
 
Seasonal ARIMA
Seasonal ARIMASeasonal ARIMA
Seasonal ARIMA
 
Time Series FORECASTING
Time Series FORECASTINGTime Series FORECASTING
Time Series FORECASTING
 
Forecasting Models & Their Applications
Forecasting Models & Their ApplicationsForecasting Models & Their Applications
Forecasting Models & Their Applications
 
ARIMA
ARIMA ARIMA
ARIMA
 
Lesson 2 stationary_time_series
Lesson 2 stationary_time_seriesLesson 2 stationary_time_series
Lesson 2 stationary_time_series
 
Lesson 5 arima
Lesson 5 arimaLesson 5 arima
Lesson 5 arima
 
Methods of data collection
Methods of data collectionMethods of data collection
Methods of data collection
 
Project time series ppt
Project time series pptProject time series ppt
Project time series ppt
 
Forecasting Techniques
Forecasting TechniquesForecasting Techniques
Forecasting Techniques
 

Similar to Time Series Forecasting Using TBATS Model.pptx

Large Scale Automatic Forecasting for Millions of Forecasts
Large Scale Automatic Forecasting for Millions of ForecastsLarge Scale Automatic Forecasting for Millions of Forecasts
Large Scale Automatic Forecasting for Millions of ForecastsAjay Ohri
 
IRJET- Mining Frequent Itemset on Temporal data
IRJET-  	  Mining  Frequent Itemset on Temporal dataIRJET-  	  Mining  Frequent Itemset on Temporal data
IRJET- Mining Frequent Itemset on Temporal dataIRJET Journal
 
Module 3 - Time Series.pptx
Module 3 - Time Series.pptxModule 3 - Time Series.pptx
Module 3 - Time Series.pptxnikshaikh786
 
Mining Transactional and Time Series Data
Mining Transactional and Time Series DataMining Transactional and Time Series Data
Mining Transactional and Time Series DataBrenda Wolfe
 
Weather forecasting model.pptx
Weather forecasting model.pptxWeather forecasting model.pptx
Weather forecasting model.pptxVisheshYadav12
 
IBM SPSS Forecasting
IBM SPSS ForecastingIBM SPSS Forecasting
IBM SPSS ForecastingLuciano Saia
 
Performance OR Capacity #CMGimPACt2016
Performance OR Capacity #CMGimPACt2016 Performance OR Capacity #CMGimPACt2016
Performance OR Capacity #CMGimPACt2016 Alex Gilgur
 
3.3 Forecasting Part 2(1) (1).pptx
3.3 Forecasting Part 2(1) (1).pptx3.3 Forecasting Part 2(1) (1).pptx
3.3 Forecasting Part 2(1) (1).pptxMBALOGISTICSSUPPLYCH
 
ANAP 2020 Presentation
ANAP 2020 PresentationANAP 2020 Presentation
ANAP 2020 Presentationhela ben amor
 
prediction of_inventory_management
prediction of_inventory_managementprediction of_inventory_management
prediction of_inventory_managementFEG
 
Hadoop secondary sort and a custom comparator
Hadoop secondary sort and a custom comparatorHadoop secondary sort and a custom comparator
Hadoop secondary sort and a custom comparatorSubhas Kumar Ghosh
 
Business Analytics Foundation with R Tools - Part 3
Business Analytics Foundation with R Tools - Part 3Business Analytics Foundation with R Tools - Part 3
Business Analytics Foundation with R Tools - Part 3Beamsync
 
Hrug intro to forecasting
Hrug intro to forecastingHrug intro to forecasting
Hrug intro to forecastingegoodwintx
 
Forecasting_CO2_Emissions.pptx
Forecasting_CO2_Emissions.pptxForecasting_CO2_Emissions.pptx
Forecasting_CO2_Emissions.pptxMOINDALVS
 
Exploiting Big Data in Time Series Forecasting: A Cross-Sectional Approach
Exploiting Big Data in Time Series Forecasting: A Cross-Sectional ApproachExploiting Big Data in Time Series Forecasting: A Cross-Sectional Approach
Exploiting Big Data in Time Series Forecasting: A Cross-Sectional ApproachMolham Al-Maleh
 

Similar to Time Series Forecasting Using TBATS Model.pptx (20)

Large Scale Automatic Forecasting for Millions of Forecasts
Large Scale Automatic Forecasting for Millions of ForecastsLarge Scale Automatic Forecasting for Millions of Forecasts
Large Scale Automatic Forecasting for Millions of Forecasts
 
Time series analysis
Time series analysisTime series analysis
Time series analysis
 
IRJET- Mining Frequent Itemset on Temporal data
IRJET-  	  Mining  Frequent Itemset on Temporal dataIRJET-  	  Mining  Frequent Itemset on Temporal data
IRJET- Mining Frequent Itemset on Temporal data
 
Module 3 - Time Series.pptx
Module 3 - Time Series.pptxModule 3 - Time Series.pptx
Module 3 - Time Series.pptx
 
Mining Transactional and Time Series Data
Mining Transactional and Time Series DataMining Transactional and Time Series Data
Mining Transactional and Time Series Data
 
Weather forecasting model.pptx
Weather forecasting model.pptxWeather forecasting model.pptx
Weather forecasting model.pptx
 
IBM SPSS Forecasting
IBM SPSS ForecastingIBM SPSS Forecasting
IBM SPSS Forecasting
 
Performance OR Capacity #CMGimPACt2016
Performance OR Capacity #CMGimPACt2016 Performance OR Capacity #CMGimPACt2016
Performance OR Capacity #CMGimPACt2016
 
3.3 Forecasting Part 2(1) (1).pptx
3.3 Forecasting Part 2(1) (1).pptx3.3 Forecasting Part 2(1) (1).pptx
3.3 Forecasting Part 2(1) (1).pptx
 
ARIMA.pptx
ARIMA.pptxARIMA.pptx
ARIMA.pptx
 
ANAP 2020 Presentation
ANAP 2020 PresentationANAP 2020 Presentation
ANAP 2020 Presentation
 
prediction of_inventory_management
prediction of_inventory_managementprediction of_inventory_management
prediction of_inventory_management
 
Forecasting Examples
Forecasting ExamplesForecasting Examples
Forecasting Examples
 
Time series
Time seriesTime series
Time series
 
Time series
Time seriesTime series
Time series
 
Hadoop secondary sort and a custom comparator
Hadoop secondary sort and a custom comparatorHadoop secondary sort and a custom comparator
Hadoop secondary sort and a custom comparator
 
Business Analytics Foundation with R Tools - Part 3
Business Analytics Foundation with R Tools - Part 3Business Analytics Foundation with R Tools - Part 3
Business Analytics Foundation with R Tools - Part 3
 
Hrug intro to forecasting
Hrug intro to forecastingHrug intro to forecasting
Hrug intro to forecasting
 
Forecasting_CO2_Emissions.pptx
Forecasting_CO2_Emissions.pptxForecasting_CO2_Emissions.pptx
Forecasting_CO2_Emissions.pptx
 
Exploiting Big Data in Time Series Forecasting: A Cross-Sectional Approach
Exploiting Big Data in Time Series Forecasting: A Cross-Sectional ApproachExploiting Big Data in Time Series Forecasting: A Cross-Sectional Approach
Exploiting Big Data in Time Series Forecasting: A Cross-Sectional Approach
 

Recently uploaded

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 

Recently uploaded (20)

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 

Time Series Forecasting Using TBATS Model.pptx

  • 1. TIME SERIES FORECASTING USING TBATS MODEL Team Members: • D22017 – P Gowtham Kumar • D22041 – R Sai Sasi Sekhar • D22049 – B Vinay Kumar Course: TF
  • 2. Introduction TBATS is a forecasting method to model time series data • TBATS is an Acronym for key features of the model • The main aim of this is to forecast time series with complex seasonal patterns using exponential smoothing • There can be many types of seasonality's present (e.g., time of day, daily, weekly, monthly, yearly). 2
  • 3. ADVANTAGES OF TBATS • Many time series exhibit complex and multiple seasonal patterns (e.g., hourly data that contains a daily pattern, weekly pattern and an annual pattern). • The most popular models (e.g. ARIMA and exponential smoothing) can only account for one seasonality. • TBATS model has the capability to deal with complex seasonality's (e.g., non-integer seasonality, non-nested seasonality and large-period seasonality) with no seasonality constraints, making it possible to create detailed, long-term forecasts. 3
  • 4. How to Forecast Time Series With Multiple Seasonality's • We often encounter seasonality in time series. Seasonality is the periodical variation in our series. It is a cycle that occurs over a fixed period in our series. • Here, we can clearly see seasonal cycle, as every year, the number of air passengers peaks around the month of July and falls down again. • To forecast this series, we can simply use a SARIMA model, since there is only one seasonal period with a length of one year. 4 Monthly total number of air passengers for an airline, from January 1949 to December 1960. We notice a clear seasonal pattern in the series, with more people travelling during the months of June, July, and August
  • 5. • Now, things get complicated when we are working with high frequency data. • For example, an hourly time series can exhibit a daily, weekly, monthly and yearly seasonality, meaning that we now have multiple seasonal periods. • Take a look at the hourly traffic volume on the Interstate 94 shown below. 5 Hourly traffic volume, westbound, on the interstate 94 in Minneapolis, Minnesota. Here we can see both a daily seasonality (more cars are on the road during the day than during the night), But also a weekly seasonality (more car are on the road Monday to Friday, than during the weekends).
  • 6. 6 • Looking at the data above, we can see that we have two seasonal periods! • First, we have a daily seasonality, as we see that more cars travel on the road during the day than during the night. • Second, we have a weekly seasonality, as traffic volume is higher during weekdays than during the weekend. • In this case, a SARIMA model cannot be used, because we can only specify one seasonal periods, whereas we definitely have two seasonal periods in our data: a daily seasonality and a weekly seasonality. • Using BATS and TBATS models, we can fit and forecast time series that have more than one seasonal period.
  • 7. 7 BATS Model • Exponential smoothing is a family of forecasting methods. The general idea behind these forecasting methods is that future values are a weighted average of past values, with the weights decaying exponentially as we go back in time. Forecasting methods include SES, DES and TES. • State-space modelling is a framework in which a time series is seen as a set of observed data that is influenced by a set of unobserved factors. The state-space model then expresses the relationship between the two sets. Again, this must be seen as a framework, as an ARMA model can be expressed as a state-space model. • Box-Cox transformation is a power transformation that helps make the series stationary, by stabilizing the variance and mean over time. • ARMA errors is a process in which we apply an ARMA model on the residuals of the time series in order to find any unexplained relationship. Usually, the residuals of a model should be totally random, unless some information was not captured by the model. Here, we use an ARMA model to capture any remaining information in the residuals. • Trend is a component of a time series that explains the long-term change in the mean value of the series. When we have a positive trend, then our series is increasing over time. With a negative trend, the series decreases over time. • The seasonal component is what explains the periodical variation in the series.
  • 8. 8 • To summarize, BATS is an extension of exponential smoothing methods that combines a Box-Cox transformation to handle non-linear data and uses an ARMA model to capture autocorrelation in the residuals. • The advantage of using BATS is that it can treat non-linear data, solve the autocorrelation problem in residuals since it uses an ARMA model, and it can take into account multiple seasonal periods. • However, the seasonal periods must be integer numbers, otherwise BATS cannot be applied. For example, suppose that you have weekly data with a yearly seasonality, then your period is 365.25/7 which is approximately 52.2. In that case, BATS is ruled out. • Furthermore, BATS can take a long time to fit if the seasonal period is very large, meaning that it is not suitable if you have hourly data with a monthly (the period would be 730). • Thus, the TBATS model was developed to address that situation.
  • 9. TBATS • It uses the same components as the BATS model, however it represents each seasonal period as a trigonometric representation based on Fourier series. This allows the model to fit large seasonal periods and non-integer seasonal periods. • It is thus a better choice when dealing with high-frequency data and it usually fits faster than BATS. • Applying the models to forecast the next seven days of hourly traffic volume. 9
  • 10. First, double-seasonal Holt–Winters (DSHW) exponential smoothing equation with additive trend and additive seasonality is shown below. This model (Eqs. 7 to 11), developed by Taylor (2003), was an extension of the Holt–Winters exponential smoothing. 10
  • 11. BATS The following equations show the extension of double-seasonal Holt–Winters (DSHW), called Box–Cox transformation, ARMA errors, trend, and multiple seasonal patterns (BATS). These are expressed by Eqs. 12 to 17 (De Livera 2010). 11
  • 12. TBATS The following equations show the extension of BATS model by adapting Eqs. (12) to (17) with the following expressions. This adaptation is called TBATS model (Eqs. 18 to 21) (De Livera et al. 2011). 12
  • 13. • Of course, we recognize the plot from the beginning of this article and notice that the traffic volume is indeed lower during the weekend than during the weekdays. Also, we see a daily seasonality, with traffic being heavier during the day than at night. • Therefore, we have two periods: the daily period has a length of 24 hours, and the weekly period has a length of 168 hours. Let’s keep that in mind as we move on to modeling. 13
  • 14. 14 Modeling • For modeling of data. Here, we use the sktime package. This framework which brings many statistical and machine learning methods for time series. It also uses a similar syntax convention to scikit-learn, making it easy to use. • The first step is to define our target and define the forecast horizon. • Here, the target is the traffic volume itself. • For the forecast horizon, we wish to predict one week of data. • Since we have hourly data, we must then predict 168 timesteps (7 * 24) into the future.
  • 15. Inference • That’s a bit anticlimactic, but let’s understand why this happened. • It is possible that our dataset is too small. • It might be that the sample that we used for testing turns out to favor the baseline model. One way to verify would be to forecast multiple 168 hour-horizon, to see if the baseline model still outperforms the rest. • Also, it can be that we were too strict with the models’ parameters. Here, we forced both models to use Box-Cox transformations and remove the trend component. However, we could have not specified those parameters, and the model would have tried both possibilities for each parameter and select the one with the lowest AIC (Akaike’s Information Criterion). While this makes the training process longer, it might also result in better performance from BATS and TBATS. • Nevertheless, a key takeaway is that a building a baseline model is very important for any forecasting project. 15
  • 16. Conclusion • BATS and TBATS models, were used to forecast time series that have more than one seasonal period, in which case a SARIMA model cannot be used. • We applied both models to forecast the hourly traffic volume, but it turned out that our baseline remained the best performing model. • Nevertheless, we saw that BATS and TBATS can indeed model time series with complex seasonality's. 16
  • 17. Potential improvements •Forecast multiple 168 hour-horizon and check if the baseline is indeed the most performant model. the entire dataset original dataset can be used, which contains much more data than what we worked with. •Do not specify the parameters use_box_cox, use_trend, and use_damped_trend, and allow the model to make the best selection based on the AIC. 17
  • 18. Key takeaways •Always build a baseline model when forecasting •BATS and TBATS can be used for modeling time series with complex seasonality •BATS works well when the periods are short and integer numbers •TBATS trains faster than BATS and works with seasonal periods that are not integers 18
  • 19. References • https://towardsdatascience.com/how-to-forecast-time-series-with-multiple- seasonalities-23c77152347e • https://www.sktime.org/en/stable/api_reference/auto_generated/sktime.forecasting.tba ts.TBATS.html • https://blog.tenthplanet.in/time-series-forecasting-tbats/ • https://medium.com/intive-developers/forecasting-time-series-with-multiple- seasonalities-using-tbats-in-python-398a00ac0e8a • https://otexts.com/fpp2/complexseasonality.html 19