More plotting

A major theme in this chapter other than time series analysis is plotting. You may have also noticed a few new functions in the main function earlier. Now it's time to revisit them.

We start with the output of stl.Decompose. This is the definition:

type Result struct {  Data []float64  Trend []float64  Seasonal []float64  Resid []float64  Err error}
There is no notion of time in the result. It's assumed that when you pass in data into stl.Decompose, the data is ordered by the time series. The result also follows this notion.

We've already defined newTSPlot previously, which works fine for the data, trend, and seasonal, but not the residuals. The reason why we don't want to plot residuals as a line chart is because if done right, ...

Get Go Machine Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.