What Is Time Series Forecasting?

Time series forecasting is an important area of machine learning that is often neglected.

It is important because there are so many prediction problems that involve a time component. These problems are neglected because it is this time component that makes time series problems more difficult to handle.

In this post, you will discover time series forecasting.

After reading this post, you will know:

  • Standard definitions of time series, time series analysis, and time series forecasting.
  • The important components to consider in time series data.
  • Examples of time series to make your understanding concrete.

Kick-start your project with my new book Time Series Forecasting With Python, including step-by-step tutorials and the Python source code files for all examples.

Let’s get started.

What is Time Series Forecasting?

What is Time Series Forecasting?
Photo by Dennis Kleine, some rights reserved.

Time Series

A normal machine learning dataset is a collection of observations.

For example:

Time does play a role in normal machine learning datasets.

Predictions are made for new data when the actual outcome may not be known until some future date. The future is being predicted, but all prior observations are almost always treated equally. Perhaps with some very minor temporal dynamics to overcome the idea of “concept drift” such as only using the last year of observations rather than all data available.

A time series dataset is different.

Time series adds an explicit order dependence between observations: a time dimension.

This additional dimension is both a constraint and a structure that provides a source of additional information.

A time series is a sequence of observations taken sequentially in time.

— Page 1, Time Series Analysis: Forecasting and Control.

For example:

Describing vs. Predicting

We have different goals depending on whether we are interested in understanding a dataset or making predictions.

Understanding a dataset, called time series analysis, can help to make better predictions, but is not required and can result in a large technical investment in time and expertise not directly aligned with the desired outcome, which is forecasting the future.

In descriptive modeling, or time series analysis, a time series is modeled to determine its components in terms of seasonal patterns, trends, relation to external factors, and the like. … In contrast, time series forecasting uses the information in a time series (perhaps with additional information) to forecast future values of that series

— Page 18-19, Practical Time Series Forecasting with R: A Hands-On Guide.

Time Series Analysis

When using classical statistics, the primary concern is the analysis of time series.

Time series analysis involves developing models that best capture or describe an observed time series in order to understand the underlying causes. This field of study seeks the “why” behind a time series dataset.

This often involves making assumptions about the form of the data and decomposing the time series into constitution components.

The quality of a descriptive model is determined by how well it describes all available data and the interpretation it provides to better inform the problem domain.

The primary objective of time series analysis is to develop mathematical models that provide plausible descriptions from sample data

— Page 11, Time Series Analysis and Its Applications: With R Examples

Time Series Forecasting

Making predictions about the future is called extrapolation in the classical statistical handling of time series data.

More modern fields focus on the topic and refer to it as time series forecasting.

Forecasting involves taking models fit on historical data and using them to predict future observations.

Descriptive models can borrow for the future (i.e. to smooth or remove noise), they only seek to best describe the data.

An important distinction in forecasting is that the future is completely unavailable and must only be estimated from what has already happened.

The purpose of time series analysis is generally twofold: to understand or model the stochastic mechanisms that gives rise to an observed series and to predict or forecast the future values of a series based on the history of that series

— Page 1, Time Series Analysis: With Applications in R.

The skill of a time series forecasting model is determined by its performance at predicting the future. This is often at the expense of being able to explain why a specific prediction was made, confidence intervals and even better understanding the underlying causes behind the problem.

Stop learning Time Series Forecasting the slow way!

Take my free 7-day email course and discover how to get started (with sample code).

Click to sign-up and also get a free PDF Ebook version of the course.

Components of Time Series

Time series analysis provides a body of techniques to better understand a dataset.

Perhaps the most useful of these is the decomposition of a time series into 4 constituent parts:

  1. Level. The baseline value for the series if it were a straight line.
  2. Trend. The optional and often linear increasing or decreasing behavior of the series over time.
  3. Seasonality. The optional repeating patterns or cycles of behavior over time.
  4. Noise. The optional variability in the observations that cannot be explained by the model.

All time series have a level, most have noise, and the trend and seasonality are optional.

The main features of many time series are trends and seasonal variations … another important feature of most time series is that observations close together in time tend to be correlated (serially dependent)

— Page 2, Introductory Time Series with R

These constituent components can be thought to combine in some way to provide the observed time series. For example, they may be added together to form a model as follows:

Assumptions can be made about these components both in behavior and in how they are combined, which allows them to be modeled using traditional statistical methods.

These components may also be the most effective way to make predictions about future values, but not always.

In cases where these classical methods do not result in effective performance, these components may still be useful concepts, and even input to alternate methods.

Concerns of Forecasting

When forecasting, it is important to understand your goal.

Use the Socratic method and ask lots of questions to help zoom in on the specifics of your predictive modeling problem. For example:

  1. How much data do you have available and are you able to gather it all together? More data is often more helpful, offering greater opportunity for exploratory data analysis, model testing and tuning, and model fidelity.
  2. What is the time horizon of predictions that is required? Short, medium or long term? Shorter time horizons are often easier to predict with higher confidence.
  3. Can forecasts be updated frequently over time or must they be made once and remain static? Updating forecasts as new information becomes available often results in more accurate predictions.
  4. At what temporal frequency are forecasts required? Often forecasts can be made at a lower or higher frequencies, allowing you to harness down-sampling, and up-sampling of data, which in turn can offer benefits while modeling.

Time series data often requires cleaning, scaling, and even transformation.

For example:

  • Frequency. Perhaps data is provided at a frequency that is too high to model or is unevenly spaced through time requiring resampling for use in some models.
  • Outliers. Perhaps there are corrupt or extreme outlier values that need to be identified and handled.
  • Missing. Perhaps there are gaps or missing data that need to be interpolated or imputed.

Often time series problems are real-time, continually providing new opportunities for prediction. This adds an honesty to time series forecasting that quickly flushes out bad assumptions, errors in modeling and all the other ways that we may be able to fool ourselves.

Examples of Time Series Forecasting

There is almost an endless supply of time series forecasting problems.

Below are 10 examples from a range of industries to make the notions of time series analysis and forecasting more concrete.

  • Forecasting the corn yield in tons by state each year.
  • Forecasting whether an EEG trace in seconds indicates a patient is having a seizure or not.
  • Forecasting the closing price of a stock each day.
  • Forecasting the birth rate at all hospitals in a city each year.
  • Forecasting product sales in units sold each day for a store.
  • Forecasting the number of passengers through a train station each day.
  • Forecasting unemployment for a state each quarter.
  • Forecasting utilization demand on a server each hour.
  • Forecasting the size of the rabbit population in a state each breeding season.
  • Forecasting the average price of gasoline in a city each day.

I expect that you will be able to relate one or more of these examples to your own time series forecasting problems that you would like to address.


In this post, you discovered time series forecasting.

Specifically, you learned:

  • About time series data and the difference between time series analysis and time series forecasting.
  • The constituent components that a time series may be decomposed into when performing an analysis.
  • Examples of time series forecasting problems to make these ideas concrete.

Do you have any questions about time series forecasting or about this post?
Ask your questions in the comments below.

Want to Develop Time Series Forecasts with Python?

Introduction to Time Series Forecasting With Python

Develop Your Own Forecasts in Minutes

...with just a few lines of python code

Discover how in my new Ebook:
Introduction to Time Series Forecasting With Python

It covers self-study tutorials and end-to-end projects on topics like: Loading data, visualization, modeling, algorithm tuning, and much more...

Finally Bring Time Series Forecasting to
Your Own Projects

Skip the Academics. Just Results.

See What's Inside

156 Responses to What Is Time Series Forecasting?

  1. Avatar
    Amit December 2, 2016 at 1:30 pm #

    Hi Jason,

    Is there a paper for this – Forecasting utilization demand on a server each hour? Would you be able to link it here?


    • Avatar
      Jason Brownlee December 3, 2016 at 8:26 am #

      There may be Amit, you can search here: http://scholar.google.com

    • Avatar
      Abolfazl November 28, 2018 at 7:35 pm #

      dear my friend
      i’ve to greatly thank @JasonBtownlee for his useful information and code.
      here is my time series prediction by bi-LSTM code,
      best wishes
      Abolfazl Nejatian

    • Avatar
      sunil February 22, 2019 at 1:24 am #

      Each line represents one customer – the first column contains unique customer
      identifier and the second column contains indices of the day when customer have visited the
      mall. The day with index 1 is a Monday (e. g. 7th is a Sunday, 8th is again a Monday). Indices
      are within a range of 1 to 1001 (which is equal to 143 full weeks). The task is to predict the first
      day of the next visit (week 144). For example, if customer will visit mall on Wednesday, then
      prediction should be equal to 3:
      0: Customer will not visit on the next week 1: Monday
      2: Tuesday
      3: Wednesday
      4: Thursday 5: Friday
      6: Saturday 7: Sunday

      Can you plz give a soluation on python

  2. Avatar
    Leo December 2, 2016 at 6:38 pm #

    “Time series forecasting is an important area of machine learning that is often neglected.”

    Time series analysis is an area in itself. Many time series analysts will be offended by this sentence. No pun intended.

    • Avatar
      Brandon December 3, 2016 at 3:59 am #

      Maybe, but in the realm of machine learning time series is just a subset for analyzing and forecasting. If this were another type of blog, not machinelearningmastery, then maybe take offense.

    • Avatar
      Jason Brownlee December 3, 2016 at 8:27 am #

      Thanks for the feedback. Indeed Leo, time series is neglected when discussing machine learning. It is left out of most books.

  3. Avatar
    Saeed Ghasemi December 4, 2016 at 3:03 am #

    Thank you for this post. Interesting read.

    Can LSTMs be used for time series prediction? What performance could one expect relative to other neuron models and architecture? (e.g. RNN, CNN)

    • Avatar
      Jason Brownlee December 4, 2016 at 5:35 am #

      Yes, LSTMs can be used for time series, but they can be tricky to configure.

      I plan to do some large studies on LSTMs vs CNN and other methods in time series soon.

      • Avatar
        Hemant Yadav March 12, 2018 at 4:24 am #

        Have you done anything on LSTMs vs CNN and other methods in time series…. please let me know… I am eagerly waiting for it.

        • Avatar
          Jason Brownlee March 12, 2018 at 6:33 am #

          Yes, I have found LSTMs to be poor at time series forecasting.

          • Avatar
            Christopher September 17, 2018 at 9:11 pm #

            HI Jason,
            Very good post!
            I am new to your blog and just come to this post. Since this reply is 2 years old, may I ask do you still hold this view: I have found LSTMs to be poor at time series forecasting?

            Why I am asking is that I am in wireless telecom industry. Our team wish to explore topics such to forecast the number of users in a base station [a network device that connects your cell phone to the backend], or forecast the data volume in Mega bytes in a base station.

            So far LSTM is our favorite candidate. Seeing your this reply, I am wondering if our team is on the right track.

            Looking forward to your reply.

          • Avatar
            Jason Brownlee September 18, 2018 at 6:13 am #

            Yes. Vanilla LSTMs are poor at time sreies forecasting. I have a ton of results to show this. More here:

            CNNs are often better. CNN+LSTM better again, and ConvLSTMs are very good. I cover these here:

          • Avatar
            Yvette December 30, 2018 at 12:24 pm #

            Hi, Jason,
            I’m also a new visitor in your blog. Firstly I want to thank for your sharing. And I want to ask you a question about whether the CNN/RNN/LSTM can be used as trajectory predictions (especially the moving targets) ?

            At last, can we think of the trajectory as a time series?

            Looking forward to your reply.

          • Avatar
            Jason Brownlee December 31, 2018 at 6:04 am #

            I don’t see why not. Perhaps try modeling a time series framing of the problem and see how you go?

          • Avatar
            Feroz Kazi February 25, 2021 at 7:15 pm #

            I agree Jason, By its nature, LSTM always gives a different results (sometime not-acceptable at all !!!) on the same set of data with same Layers/Dropouts/etc. I tested LSTM with quite a small set of 8 numbers (of n*2 patter) to the large set of 550 weekly historical prices of gold…. every time I run the LSTM, I get different results!!!
            Later, I found that BiDirectional LSTM is much better than all other flavors of LSTM.

          • Avatar
            Jason Brownlee February 26, 2021 at 4:57 am #

            Thanks for sharing!

  4. Avatar
    Kleyn Guerreiro December 7, 2016 at 12:07 am #

    Nowadays I see that MARS (actually “earth” in R) is the strongest algorithm to forecast time series data.

    • Avatar
      Jason Brownlee December 7, 2016 at 8:56 am #

      Thanks for the tip Kleyn. I can see why it would be powerful, it’s a great method.

  5. Avatar
    Anthony Bailey December 16, 2016 at 11:48 pm #

    Hi Jason,
    I was wondering whether to specialize in time series or machine learning. What do you think which of these has a brighter future for someone interested in research in one of these two fields?

    • Avatar
      Jason Brownlee December 17, 2016 at 11:12 am #

      Sorry, I am not in touch with academia any longer.

      There are a lot of problems where machine learning can be helpful in industry and some of those problems are time series.

  6. Avatar
    Johno December 29, 2016 at 10:39 pm #

    Very nice article Jason. Do you think time series data analysis is as important as the machine learning problems in the industry?

    • Avatar
      Jason Brownlee December 30, 2016 at 5:50 am #

      Yes I do Johno, there are many problems with time series and unfortunately, many ML practitioners are unaware of standard methods like ARIMA.

  7. Avatar
    Raphael January 23, 2017 at 9:25 am #

    Do you have an introductory tutorial on time series analysis?

  8. Avatar
    Pooja Parmar February 17, 2017 at 5:19 pm #

    Hi Jason,

    Can you plz tell me from where I can find experiments like this “Forecasting the average price of gasoline in a city each day”?

    • Avatar
      Jason Brownlee February 18, 2017 at 8:35 am #

      Hi Pooja, I have not seen this specific example,

      You could collect the data and create the models, perhaps starting with one city and one year of data, then scaling up from there.

  9. Avatar
    Ranjana March 6, 2017 at 11:26 pm #

    Hello Jason,

    How do I predict increase/decrease in gas price based on historical data of different years using forecasting in machine learning?

  10. Avatar
    Kalongo March 16, 2017 at 7:35 pm #

    Hi Jason

    I want to do a study to compare which one is better when it comes to forecasting between time series models and machine learning models.

    How can you advise me to go about this study?

  11. Avatar
    Thabet May 5, 2017 at 11:36 am #

    Hello Jason,
    Do you have a tutorial on multi-input LSTM in keras?

  12. Avatar
    Nick May 9, 2017 at 11:57 pm #

    Hello Jason,

    I am a novice at this so forgive a potentially silly question.

    If is have a set of time series data with an associated value
    eg timestamp, value

    where the value and possibly the time between certain values equates to an event, is it possible to use this knowledge to train the system so that when I run a model against an unprocessed data set I can detect the occurrence of the event in the second data set?

    Hope this rambling makes sense.

    Thank you

    • Avatar
      Jason Brownlee May 10, 2017 at 8:50 am #

      If I understand your problem description, then yes I believe so.

      You will need to prepare your historical data with clear examples of event/no-event.

  13. Avatar
    Nick May 10, 2017 at 5:24 pm #

    Thank you Jason, Would I need to use Analysis rather than forecasting ?


    • Avatar
      Jason Brownlee May 11, 2017 at 8:31 am #

      You can call “better understanding your problem” analysis if you wish.

  14. Avatar
    Dhineshkumar June 7, 2017 at 5:37 pm #

    I just want to share a link about time series analysis which I found useful.


  15. Avatar
    tom June 8, 2017 at 1:20 pm #

    I have read your post “What Is Time Series Forecasting?” 。I know little about Time Series Forecasting before. So, I am confused after read this post. I wonder what is the difference between Time Series Forecasting and other ML problems ,such as regression, classification?

    • Avatar
      Jason Brownlee June 9, 2017 at 6:17 am #

      The addition of a time dimension which imposes an order dependence between observations.

      This dependence must be respected in the classification/regression formulation of the problem.

      • Avatar
        tom June 9, 2017 at 11:36 am #

        Ok, I got it. I can always get inspiration from you, thanks again, Jason!

  16. Avatar
    Oliver September 1, 2017 at 6:06 am #

    Hi Jason,

    After reading and working through some of your tutorials I´m not sure what the most promising strategy could be to classify a known set of time series data. I have multi feature time series data being labeled or classified (2 possible states).
    When getting the data of a new time step I would like to classify whether it is state one or two. My first idea was to use a solution as shown in your pima-diabetes-tutorial because it looks more like an classification problem to me.
    After going on reading through the different tutorials I found a lot stuff concerning time series prediction/forecast and the analysis of a time range within the time series – but my point is not looking into the future.
    I think that my problem relates to something in-between, doesn´t it? Is there a tutorial you would expect to fit the best to this question or is the solution for this question covered by the different way´s of predicting time series data?


    • Avatar
      Jason Brownlee September 1, 2017 at 6:51 am #

      I would suggest modeling it as sequence classificaiton, not too much unlike classifying a sequence of words in a movie review as positive or negative.

      Try MLPs and LSTMs.

  17. Avatar
    Tom October 18, 2017 at 10:59 am #

    Jason – In this book did you use LSTM for time-series-forecasting in any of the chapters?

    I have to use NN for time-series forecasting. Will this book help ?

    • Avatar
      Jason Brownlee October 18, 2017 at 3:52 pm #

      My time series book focuses on linear models such as AR and ARIMA. No LSTMs.

  18. Avatar
    Rohith November 9, 2017 at 4:28 pm #

    Hello Jason,

    I am working as a supply chain supervisor and i have been given the task of reducing inventory levels at many warehouses. Until now I am just taking the avg sales of previous months and based on this i am forecasting the next month’s sales. I take this data as a basis to maintain inventory levels but this method is proving to be inaccurate. Which is the best time series forecasting method suitable to forecast sales? Can you please provide the procedure to implement this method.

  19. Avatar
    Anfell December 15, 2017 at 1:24 am #

    Hello Jason, I’m working on a project for predicting a specific tournament. I have data consists of date (date of match), home_team (constant data because I’m predicting a specific team, let’s say it’s “teamA” for now), away_team (the opponent of “teamA”), win (status of teamA’s win, 1 being a win and 0 being a loss). The data has holes because this “teamA” doesn’t always participate in every tournament. Is this still valid data for time series? or is there a better method of predicting?

  20. Avatar
    Heron January 18, 2018 at 5:29 pm #

    Hello Jason, I have some question for you. If I use pregnant weight sequence to predict fetal weight, weight of pregnant belongs to time series, What kind of time series problems do these time-series problems belong to? Thanks!

  21. Avatar
    Watt Simon January 29, 2018 at 6:36 pm #

    Hello Jason, I’m working on a project for analysis EMG signals. I want ask that if I want to predict EMG signals, what kind of tools should be used(NAR or LSTM or something else)? Does deep neural network’s performance are better than normal neural network? Thanks

    • Avatar
      Jason Brownlee January 30, 2018 at 9:48 am #

      Perhaps start with an MLP and compare results to an LSTM.

  22. Avatar
    Judson Smith April 27, 2018 at 7:49 am #

    Great article!

    Judson Smith
    Acclaimed Labs – Fully Automated Data Forecasting

  23. Avatar
    saarbaan samad June 1, 2018 at 10:04 pm #

    Hi sir ,
    i have some yearly time series data , to forecast coming years value ,and i m using neural network model. i m new learner in this feild
    but the problem for me is how train the data such as how to convert into lags to make the ready appplying the model . i will be your thankful , waiting for your precious guidings

  24. Avatar
    Ben August 15, 2018 at 8:46 pm #

    Hi Jason,

    Thanks for the excellent post, I am working on a project and I’m not sure it I need time series analysis or not – I am predicting a customers likelihood to purchase, right now this prediction is as of ‘now’ based on data from the previous day – I want to refine this further by predicting this value over 3 days, or 10 days – what would be the normal approach to do this? Does this make it time series analysis, or not?

    Thanks for your advice,

    • Avatar
      Jason Brownlee August 16, 2018 at 6:04 am #

      Perhaps brainstorm a few different ways to frame the problem, then prototype each to discover what works well with your specific dataset?

  25. Avatar
    Michael September 12, 2018 at 9:17 am #

    If anyone is interested – we’ve just launched an automated time series forecasting platform leveraging deep learning. You can learn about the platform here: https://www.oneclick.ai/solutions/time-series/ and sign up for a free test account to kick the tires if interested.

  26. Avatar
    Candy February 5, 2019 at 8:31 am #

    Hi Jason,

    Thanks for the very informative blog.

    I recently started working on a problem, In which it collects some environment variables (temperature, humidity,noise,co2)from the sensors in a building, and tries to predict the occupancy(number of people), By co-modelling with the other environmental variables.
    Based on all the values of the environmental variables and number of people, I am detecting the Anomalies if occurs any.

    I am looking this problem also as an example of time series forecasting. Could you please clarify.


  27. Avatar
    Rajkumar March 7, 2019 at 8:59 pm #

    Hi Jason,

    I’ve a requirement of sales forecasting for a year to do it in R with machine learning . What is the best method of doing it. I’ve data of month wise sales with different dimensions (ex) region, customer & material wise . whether i have to pass data as a whole to train the model or combination of dimensions have to pass.
    Kindly suggest me

  28. Avatar
    Nate April 22, 2019 at 3:59 pm #

    I have been asked to forecast user consumption of a good in a particular geographic area on a month to month basis. I have no ML background. Do you feel that this sort of future forecasting is different enough from something like the stock market to make using ML a reasonable approach?

      • Avatar
        Nate April 23, 2019 at 8:47 am #

        Well I will give it a try but I don’t really see what is fundamentally different from trying to forecast consumption of a good vs trying to predict the stock market. I bring that up because you yourself feel that predicting the stock market is not a good use of your time and I don’t want to spend my time taking a new job if I am only going to spin my wheels. I guess the fact that you are linking means you find the problem to be of value?

        • Avatar
          Jason Brownlee April 23, 2019 at 2:29 pm #

          I have no idea if your dataset is predictable, but you can find out really quickly if you fit some linear models and they out-perform a naive/persistence model.

          E.g. you demonstrate that something is predictable, but if you fail you beat a naive forecast, you don’t demonstrate the inverse, that it’s not predictable. It’s simply not predictable yet, or not yet known to be unpredictable.

  29. Avatar
    thiagu May 11, 2019 at 10:40 am #

    hi jason,
    my question is time series prediction(problem) we can apply forecasting model. if my problem is time series classification ,can we apply forecasting model ? is that possible

  30. Avatar
    thiagu May 12, 2019 at 9:58 am #

    thanks a lot jason….is there any link for that

  31. Avatar
    Luis Fabiano August 15, 2019 at 6:05 pm #

    Excellent job, Jason!
    Always simple and direct to the point.
    I wonder if you have any material on trend estimation.
    Kind regards,
    Luis Fabiano

  32. Avatar
    Asha August 29, 2019 at 4:29 pm #

    Hi Jason,
    Thanks for blog.
    I want to find “Expected life time of a customer” in telecom.
    What features help me to predict.
    I have all transaction data (Voice,SMS,voucher,Data) and demographic details and audit trail details.

    Could you tell me what date feature help me to find “Expected Life Time” of a customer … It will help me to calculate “CLV(customer Life Time value)”.

  33. Avatar
    teimoor September 17, 2019 at 7:53 pm #

    can you post about ECG? are they considered time series too?

  34. Avatar
    Surinder September 18, 2019 at 2:59 am #

    Hi Jason,

    Thanks for the blog.
    Is it possible to do forecasting with only 1 year data.

  35. Avatar
    Suman September 23, 2019 at 2:37 am #

    Hi Jason

    I find your blog very informative and it’s helping me to learn the subject.

    For computer/network equipment failure prediction, which type of model is best suitable.


  36. Avatar
    Revathi September 24, 2019 at 7:09 pm #

    Hi jason,

    Firstly thank you for putting in tremendous effort into this blog. They are extremely helpful and informative. I have a question on cash balance forecasting.

    Let’s say I have a bank’s data with the daily closing account balance of a customer for the last 3 years. Which model would you recommend for predicting the cash balance of the customer, given the variety of models like arima, exponential smoothening, prophet, tbats, or neural networks?

    Also, how intuitive are neural networks in understanding the outputs if we were indeed to use them for the modeling?

    Really looking forward to your advice on this! Thanks!

    • Avatar
      Jason Brownlee September 25, 2019 at 5:56 am #

      Thanks for your support.

      I recommend testing a range of different framings of the problem and a suite of different modeling algorithms to see what works best for your specific dataset.

      When model skill is the focus, you will have to give up model understanding.

  37. Avatar
    Lyla January 4, 2020 at 7:03 pm #

    At first, thank you for this awesome post! One of the best resources I’ve found on time series. It’s really a valuable Information present on the blog. Look forward to read the next post. Thanks a lot

  38. Avatar
    najeh January 20, 2020 at 10:19 pm #

    Is classical time series forecasting methods are no longer robust to approximate the relationship between inputs and outputs in time series data?

    • Avatar
      Jason Brownlee January 21, 2020 at 7:12 am #

      No. It really depends on the dataset. Classical methods are better than most “ml/dl” methods on most univariate time series datasets.

      • Avatar
        najeh January 21, 2020 at 11:39 pm #

        So, what is the goal of using deep learning methods?

        • Avatar
          Jason Brownlee January 22, 2020 at 6:25 am #

          Deep learning methods can perform well on problems where classical methods fail or are challenging to use/configure.

          E.g. complex univariate data. Multivariate data, long multi-step forecasts, Anomaly detection, etc.

          There is no one best algorithm for all problems.

      • Avatar
        Rajesh Swarnkar January 30, 2020 at 11:01 pm #

        Exactly, I have same question. Someone suggested to use ARIMA based STATISTICAL models. Akaike Info Criterion punishes for complex models (LSTM), but there is paper says the counter.


        I have used Triple Exponential smoothing and RNN, RNN was better. I have yet to appli SARIMAX. I will see.

        • Avatar
          Jason Brownlee January 31, 2020 at 7:51 am #

          Try grid searching ETS and SARIMAX. Confirm the comparison from LSTM and linear models is equilivient.

  39. Avatar
    Rajesh Swarnkar January 30, 2020 at 10:54 pm #

    Someone suggested me that ARIMA based models (SARIMAX etc) perform better than LSTM/RNN?

    What is your experience?

  40. Avatar
    ashima March 2, 2020 at 11:27 pm #

    hi, to train a model for time series prediction is it important to make the time equidistant first and then train it?

  41. Avatar
    ravindra March 30, 2020 at 11:21 pm #

    Hi Jason,
    Glad to know you.

    I wish to develop a model to forecast Covid-19 transmission and deaths.
    Guide me on which model fits best for the problem.

    Lockdown came into effect in many countries. Please consider such external measures while you advise me.

    • Avatar
      Jason Brownlee March 31, 2020 at 8:12 am #

      You can fit an exponential function to forecast the number of cases.

      Use the GROWTH function in excel.

  42. Avatar
    Stevie G April 8, 2020 at 10:45 pm #

    hii jason,
    Can you help me with this,How to approach a time series data with a change point.
    How should we handle the model or approach in this case?

    Thank you,

    • Avatar
      Jason Brownlee April 9, 2020 at 8:03 am #

      Perhaps test a suite of different models and discover what works best for your specific datset?

  43. Avatar
    Akshay April 10, 2020 at 12:57 pm #

    Hi Jason,

    Should we remove trend seasonal effect before feeding it to the model ?
    Should we provide order of differencing after differencing a series and use it in d of ARIMA or just feed the number what makes it stationary without differencing it ?
    What is the difference between SARIMA and ARIMA?

    Can you help me with these ?

    • Avatar
      Jason Brownlee April 10, 2020 at 1:28 pm #

      When using SARIMA no, it will do it for you. When using ARIMA, yes it will not do it for you.

  44. Avatar
    Winston April 22, 2020 at 11:07 pm #


    Does Walmart kaggle problem come under time series ? if so why since the test data has the variables for the forecasting time scale also can’t we handle those with regression ?.

    What is your view on it, please clear the doubt

  45. Avatar
    Nana April 26, 2020 at 7:43 am #

    Hello Jason
    I want to forecast the growth of online marketing in an online marketing company.
    Which time series module do you suggest I use please?

  46. Avatar
    farid June 8, 2020 at 5:50 am #

    Hye.. I’m a final year student.. I would like to ask anyone here who is expert in time series forecasting.. In forecasting, can variable time be as input variable? Any suggested book or article that can i related to? Please comment.. Really appreciate that????

  47. Avatar
    Raghavendra Kote June 9, 2020 at 8:43 pm #

    If we have past orders(few or 0 orders by month) and also usage(by month)-in separate datasets, how can I forecast new order volumes? Can ML or ANN help here or something else? either inde

    • Avatar
      Jason Brownlee June 10, 2020 at 6:13 am #

      Perhaps try prototyping a few models and discover what can be predicted reliably.

  48. Avatar
    Virginie June 11, 2020 at 11:43 pm #

    Hello, I’m a student and I’m new to time series analysis, and what you’re explaining helps me a lot. Do you have any idea what kind of model you would use to forecast economic growth over a 1 or 2 year horizon? I find a lot of articles about “nowcasting” but that’s not quite what I need. Thank you for your help.

  49. Avatar
    Farshad September 30, 2020 at 3:12 am #

    Hi Jason,

    Very well explained post. A question is jumping up and down in my mind. The question is if every time-based event is eligible to be considered for time series analysis/forecasting just because the events repeats over the time? There are many factors behind the event, (but we don’t know them or we partially know them). Is it wise to only forecast based in only the result of the event without considering the probable factors? Is it possible to achieve a good model?


    • Avatar
      Jason Brownlee September 30, 2020 at 6:40 am #


      Yes, exactly. We are approximating the “system” that generated the series of events. It will probably never be as good as the true system itself, but we do our best.

  50. Avatar
    Hitarthi Vora October 27, 2020 at 7:01 pm #

    I just love this site. The contents shared is great and easily understood.

  51. Avatar
    AF December 5, 2020 at 4:24 pm #

    hi, if we hv 100 products and everyday we will only sell 20 of them, which method would you recommend if we want to forecast(accurately) the most probable 20 products we will sell tomorrow?

    which book of yours should we buy and learn for his?

    p/s – the article we read would only predict 1 item

  52. Avatar
    Awais December 7, 2020 at 9:19 pm #

    Can we apply time series forecasting on data where we want to predict fixed classes such as 0,1,2 or 3?

    the other thing to note that all the features change abruptly, for example, feature ‘X1’ at time T1 is let’s say 100 and on-time T2 it could be 0.

    • Avatar
      Jason Brownlee December 8, 2020 at 7:43 am #

      Yes, that is called time series classification.

      The complexity of the data may mean more advanced methods are required or that the problem is not predictable.

  53. Avatar
    Sai kumar Kella December 15, 2020 at 10:31 pm #

    Hi Jason.
    May be it was silly. Can we consider a dataset which contains a time component as time series dataset ?. I have a dataset which was collected from year 2012 to 2017, but some months of observations were missed. So can I consider it as time series dataset?

    • Avatar
      Jason Brownlee December 16, 2020 at 7:50 am #

      Sure, you can frame a problem any way you like. All that matters is that your predictions have good skill.

  54. Avatar
    Muhammad December 27, 2020 at 11:34 pm #

    Thanks for sharing valuable stuff. Respected Jason! Can we add Fraud Detection as time series dataset, if we have only No.of months attributes in dataset.

    • Avatar
      Jason Brownlee December 28, 2020 at 5:59 am #

      Perhaps, it might be a time series classification task, e.g. is a fraud event predicted in the input sequence or not.

  55. Avatar
    Iris December 29, 2020 at 11:49 am #

    Hello Jason,

    I’m a student who is very interested in game data analysis. Recently I’m looking for a model to predict the real-time win rate of certain team in a game (like StarCraft). I’m thinking about to use the data containing a lot of games(each of them is a time series) to predict a future game. This is the first time I’m dealing with time series problem, but most online tutorials are focusing on one time series only, do you have any idea how should I dealing problems with multiple-time-series?

    Your help is really appreciated.

  56. Avatar
    Peyman January 15, 2021 at 6:14 am #

    Hello Jason,
    Thank you very much for the valuable contents. I was wondering how CNN we apply CNN to spatio-temporal datasets or what other techniques are suitable for spatio-temporal datasets?

  57. Avatar
    Theodore May 18, 2021 at 10:32 am #

    Hello, I am trying to implemend a predictive maintenance system in python that is for “describing” the current situation and trying to “forecast” a future state of a machine in an industry 4.0 environment (like normal warning or critical state). Is time series forecasting the thing i am looking for?

    • Avatar
      Jason Brownlee May 19, 2021 at 6:29 am #

      Yes, it might be a time series classification task, e.g. what is the state of the system at this time step, or was there an issue in this time interval.

  58. Avatar
    Liliana May 24, 2021 at 10:08 am #

    Hi Jason:

    I would like you to tell me, what algorithms are there to create forecast models for multivariate time series of the type multiple parallel input and multi-step output, but that work in REAL-TIME?

    Thanks for your attention.

    • Avatar
      Jason Brownlee May 25, 2021 at 6:05 am #

      Perhaps test a suite of algorithms and discover what works well or best with your specific dataset.

      • Avatar
        Liliana May 25, 2021 at 9:15 am #

        Jason, I don’t know if I didn’t make myself understood with the question because I don’t understand your answer. Is it then that the real-time forecasting algorithms are not a specific group but just anyone that works for me in real time with my data?

        Thanks for your attention

        • Avatar
          Jason Brownlee May 26, 2021 at 5:43 am #

          A model is fit on historical data and can then be used to make predictions in “real time” on new data.

          If you mean “real time” as in real-time computing systems (RTC), then I cannot help you.

          • Avatar
            Liliana May 26, 2021 at 10:24 am #

            In effect, I was referring to forecasting models, not to real-time computing systems (RTC). And I think now you get me out of that doubt, because I came to think that it was some special group of algorithms that worked for real-time forecasts. Now I think I understand that any algorithm can be fitted to a historical dataset and used to make forecasts in real-time, although of course, I imagine that will depend on the data of the retraining time of the same model. I’m right?.


          • Avatar
            Jason Brownlee May 27, 2021 at 5:32 am #


  59. Avatar
    Liliana May 27, 2021 at 8:01 am #

    Ok, thanks.

  60. Avatar
    Abdullah October 11, 2021 at 6:18 pm #

    Hi Jason,

    Your website is really beneficial and it is one of the best ML websites out there.
    I have a question about multivariate time-series data, can we treat multivariate time-series data as record data by ignoring the temporal aspect? I want to do regression and predict the value of one of the features based on the values of the other features in every time step?

    There might be the problem that the value of the target feature is influenced by the values of the other features in a previous time step and not the values of the current time step. Can that be the case?

    • Avatar
      Adrian Tam October 13, 2021 at 7:22 am #

      Yes, you can do that. Indeed you should do that if you believe time shouldn’t play a role here.

  61. Avatar
    hossein November 24, 2021 at 2:00 pm #

    hi my friend
    it was so useful for me
    so thanks.

    • Avatar
      Adrian Tam November 25, 2021 at 3:33 am #


  62. Avatar
    Amir July 12, 2022 at 7:13 pm #

    Thanks. if I want to forecast a time series dataset with probabilistic distribution output ( for example Normal distribution), what model must be chosen?

  63. Avatar
    Saad January 7, 2023 at 3:27 pm #


    Thanks for this great blog. I have a dataset for Air Quality Index (AQI) where features are Air pollutants like O3, PM2.5, PM10 etc. I am forecasting the feature values and based on those forecasted values I have to calculate the future AQI. I am using LSTM (RNN concept) model for forecasting.
    My training and validation results are great but when I go for forecasting the model behavior is very unpredictable. For initial few samples it forecast new values but after a few samples it just becomes a straight line (same values).

    Any suggestions? Also suggest which model or hybrid model of LSTM will work better in case of AQI prediction which is a time series forecasting problem.

  64. Avatar
    Loide Shaango February 21, 2023 at 9:13 pm #

    Is Randomness and Causality component of time series forecasting?

Leave a Reply