Building simple forecasting models
Before diving into more complex methods, let’s get started with some simple forecasting models: the naive, seasonal naive, and mean models.
Getting ready
In this chapter, we focus on forecasting problems involving univariate time series. Let’s start by loading one of the datasets we explored in Chapter 1:
import pandas as pd serie = pd.read_csv( "assets/datasets/time_series_solar.csv", parse_dates=["Datetime"], index_col="Datetime", )['Incoming Solar']
In the preceding code, series
is a pandas Series
object that contains the univariate time series.
How to do it…
We can now forecast our time series using the three following methods:
- Naive: The simplest forecasting method is the naive approach. This method assumes that the next observation is the same as the last one. In
Python
, it could be implemented as...