Loading data

Our workflow assumes that input data for forecast evaluation is stored in a special format:

Here we use .csv files stored online. Alternatively, a database or local files can be used. For this example we use the M3-Competition dataset formatted according to the above schemas.

The first step is to load actuals and forecasts:

# load M3-Competition quarterly data actuals:
ts <- read.csv("https://forvis.github.io/data/M3_quarterly_TSTS.csv", stringsAsFactors = FALSE)

# load M3-Competition quarterly data forecasts:<- read.csv("https://forvis.github.io/data/M3_quarterly_FTS.csv", stringsAsFactors = FALSE)

Then we can check if data is loaded correctly:

head(ts)
##   series_id category   value timestamp
## 1        Q1    MICRO 3142.63   1984-Q1
## 2        Q1    MICRO 3190.75   1984-Q2
## 3        Q1    MICRO 3178.69   1984-Q3
## 4        Q1    MICRO 3170.94   1984-Q4
## 5        Q1    MICRO 3124.38   1985-Q1
## 6        Q1    MICRO 3170.00   1985-Q2
head()
##   series_id method_id forecast horizon timestamp origin_timestamp
## 1        Q1  NAIVE2  5511.55       1   1993-Q1          1992-Q4
## 2        Q1  NAIVE2  5511.55       2   1993-Q2          1992-Q4
## 3        Q1  NAIVE2  5511.55       3   1993-Q3          1992-Q4
## 4        Q1  NAIVE2  5511.55       4   1993-Q4          1992-Q4
## 5        Q1  NAIVE2  5511.55       5   1994-Q1          1992-Q4
## 6        Q1  NAIVE2  5511.55       6   1994-Q2          1992-Q4

To see details on the data format specifications, use showTSTS() and showFTS() functions.

When input data is loaded successfully and corresponds to the format required, we can proceed to the next step.


To cite this website, please use the following reference:

Sai, C., Davydenko, A., & Shcherbakov, M. (date). The Forvision Project. Retrieved from https://forvis.github.io/

© 2018 Sai, C., Davydenko, A., & Shcherbakov, M. All Rights Reserved. Short sections of text, not exceed two paragraphs, may be quoted without explicit permission, provided that full acknowledgement is given.