このページは http://www.slideshare.net/hyndman/visualization-and-forecasting-of-big-time-series-data の内容を掲載しています。

掲載を希望されないスライド著者の方は、こちらよりご連絡下さい。

1年以上前 (2015/02/22)にアップロードin学び

Talk given at the ACEMS big data workshop in Brisbane, 23 February 2015

- Rob J Hyndman

Visualizing and forecasting

big time series data

Victoria: scaled

y

2010

Holida

2000

2010

VFR

2000

2010

Business

2000

2010

Other

2000

C

A

BAA

BAB

BA

BBA

BCA

BCB

BCC

BD

BDB

BDC

BDD

BDE

BDF

BEA

BEB

BEC

BED

BEE

BEF

BEG - 1. Australian tourism demand

Visualising and forecasting big time series data

Examples of biggish time series

3 - 1. Australian tourism demand

Quarterly data on visitor night from

1998:Q1 – 2013:Q4

From: National Visitor Survey, based on

annual interviews of 120,000 Australians

aged 15+, collected by Tourism Research

Australia.

Split by 7 states, 27 zones and 76 regions

(a geographical hierarchy)

Also split by purpose of travel

Holiday

Visiting friends and relatives (VFR)

Business

Other

304 bottom-level series

Visualising and forecasting big time series data

Examples of biggish time series

3 - 2. Labour market participation

Australia and New Zealand Standard

Classification of Occupations

8 major groups

43 sub-major groups

97 minor groups

– 359 unit groups

* 1023 occupations

Example: statistician

2 Professionals

22 Business, Human Resource and Marketing

Professionals

224 Information and Organisation Professionals

2241 Actuaries, Mathematicians and Statisticians

224113 Statistician

Visualising and forecasting big time series data

Examples of biggish time series

4 - 2. Labour market participation

Australia and New Zealand Standard

Classification of Occupations

8 major groups

43 sub-major groups

97 minor groups

– 359 unit groups

* 1023 occupations

Example: statistician

2 Professionals

22 Business, Human Resource and Marketing

Professionals

224 Information and Organisation Professionals

2241 Actuaries, Mathematicians and Statisticians

224113 Statistician

Visualising and forecasting big time series data

Examples of biggish time series

4 - 3. Spectacle sales

Monthly UK sales data from 2000 – 2014

Provided by a large spectacle manufacturer

Split by brand (26), gender (3), price range

(6), materials (4), and stores (600)

About 1 million bottom-level series

Visualising and forecasting big time series data

Examples of biggish time series

5 - 3. Spectacle sales

Monthly UK sales data from 2000 – 2014

Provided by a large spectacle manufacturer

Split by brand (26), gender (3), price range

(6), materials (4), and stores (600)

About 1 million bottom-level series

Visualising and forecasting big time series data

Examples of biggish time series

5 - 3. Spectacle sales

Monthly UK sales data from 2000 – 2014

Provided by a large spectacle manufacturer

Split by brand (26), gender (3), price range

(6), materials (4), and stores (600)

About 1 million bottom-level series

Visualising and forecasting big time series data

Examples of biggish time series

5

Monthly UK sales data from 2000 – 2014

Provided by a large spectacle manufacturer

Split by brand (26), gender (3), price range

(6), materials (4), and stores (600)

About 1 million bottom-level series

Visualising and forecasting big time series data

Examples of biggish time series

5- Kite diagrams

Line graph profile

0

Duplicate

&

flip

0

around the hori-

zontal axis

0

Fill the colour

Visualising and forecasting big time series data

Time series visualisation

7 - Kite diagrams: Victorian tourism

Victoria

2010

y

Holida

2000

2010

VFR

2000

2010

Business

2000

2010

Other

2000

C

A

BAA

BAB

BA

BBA

BCA

BCB

BCC

BD

BDB

BDC

BDD

BDE

BDF

BEA

BEB

BEC

BED

BEE

BEF

BEG

Visualising and forecasting big time series data

Time series visualisation

8 - Kite diagrams: Victorian tourism

Visualising and forecasting big time series data

Time series visualisation

8 - Kite diagrams: Victorian tourism

Visualising and forecasting big time series data

Time series visualisation

8 - Kite diagrams: Victorian tourism

Victoria: scaled

2010

y

Holida

2000

2010

VFR

2000

2010

Business

2000

2010

Other

2000

C

A

BAA

BAB

BA

BBA

BCA

BCB

BCC

BD

BDB

BDC

BDD

BDE

BDF

BEA

BEB

BEC

BED

BEE

BEF

BEG

Visualising and forecasting big time series data

Time series visualisation

8 - An STL decomposition

STL decomposition of tourism demand

for holidays in Peninsula

7.0

data

6.0

5.0

0.5

seasonal

−0.5

6.4

6.1

trend

5.8

0.0

remainder

−0.4

2000

2005

2010

Visualising and forecasting big time series data

Time series visualisation

9

time - Seasonal stacked bar chart

Place positive values above the origin

while negative values below the origin

Map the bar length to the magnitude

Encode quarters by colours

Visualising and forecasting big time series data

Time series visualisation

10 - Seasonal stacked bar chart

Place positive values above the origin

while negative values below the origin

Map the bar length to the magnitude

Encode quarters by colours

1.0

0.5

Qtr

Holida

Q1

0.0

Q2

y

Q3

−0.5

Q4

Seasonal Component

−1.0

BAA BAB BAC BBA BCA BCBBCC BDA BDBBDCBDDBDE BDF BEA BEB BEC BED BEE BEF BEG

Regions

Visualising and forecasting big time series data

Time series visualisation

10 - Seasonal stacked bar chart: VIC

Visualising and forecasting big time series data

Time series visualisation

11 - Corrgram of remainder

Compute the correlations

among the remainder

components

Render both the sign and

magnitude using a colour

mapping of two hues

Order variables according to

the first principal component of

the correlations.

Visualising and forecasting big time series data

Time series visualisation

12 - Corrgram of remainder: VIC

Vis

Vis

Vis Vis Oth

Oth Oth

Oth

Vis Oth

Vis

Vis

CHol

A

COth A

CBus CVis

ABus AHol

BEEHol BEFOth BEEOth BDEOth BEBOth BEABus BEFBus BDCOth BA BEBBus BEA BBAHol BDEHol BABOth BAA BAAHol BDCHol BBABus BCBHol BEGBus BDD BABVis BD BEA BDFHol BEEBus BAA BA BD BDEBus BCBOth BA BEBVis BA BCA BEFVis BCBVis BEDHol BEGOth BDBHol BABBus BEBHol BDFBus BECHol BCAHol BDBOth BEAHol BDCBus BECVis BDBVis BCCHol BBA BABHol BBA BCCOth BCBBus BCCVis BEGVis BDDHol BECOth BDCVis BAABus BCCBus BECBus BCA BDFVis BEGHol BDDOth BEDOth BED BDDBus BDEVis BEFHol BEEVis BDBBus BD BD BCABus BDFOth BEDBus

BEEHol

1

BEFOth

BEEOth

BDEOth

BEBOth

BEABus

BEFBus

BDCOth

BACHol

0.8

BEBBus

BEAVis

BBAHol

BDEHol

BABOth

BAAVis

BAAHol

BDCHol

0.6

BBABus

BCBHol

BEGBus

BDDVis

BABVis

BDAVis

BEAOth

BDFHol

0.4

BEEBus

BAAOth

BACOth

BDAOth

BDEBus

BCBOth

BACBus

BEBVis

0.2

BACVis

BCAOth

BEFVis

BCBVis

BEDHol

BEGOth

BDBHol

BABBus

0

BEBHol

BDFBus

BECHol

BCAHol

BDBOth

BEAHol

BDCBus

BECVis

−0.2

BDBVis

BCCHol

BBAVis

BABHol

BBAOth

BCCOth

BCBBus

BCCVis

−0.4

BEGVis

BDDHol

BECOth

BDCVis

BAABus

BCCBus

BECBus

BCAVis

−0.6

BDFVis

BEGHol

BDDOth

BEDOth

BEDVis

BDDBus

BDEVis

BEFHol

−0.8

BEEVis

BDBBus

BDABus

BDAHol

BCABus

BDFOth

BEDBus

−1

Visualising and forecasting big time series data

Time series visualisation

13 - Corrgram of remainder: TAS

Vis

Vis

Oth

Oth

Oth

Vis

AAHol

AA

AA

AABus

FCAHol

FBBHol

FBAHol

F

FCBHol

FCA

FBBVis

F

FCBBus

F

FCA

FBBOth

FBABus

FBA

FCBVis

FCABus

FBA

FCBOth

FBBBus

F

1

FCAHol

FBBHol

0.8

FBAHol

FAAHol

0.6

FCBHol

FCAVis

0.4

FBBVis

FAAVis

0.2

FCBBus

FAAOth

0

FCAOth

FBBOth

−0.2

FBABus

FBAOth

−0.4

FCBVis

FCABus

−0.6

FBAVis

FCBOth

−0.8

FBBBus

FAABus

−1

Visualising and forecasting big time series data

Time series visualisation

14 - Feature analysis

Summarize each time series with a feature

vector:

strength of trend

lumpiness (variance of annual variances of

remainder)

strength of seasonality

size of seasonal peak

size of seasonal trough

ACF1

linearity of trend

curvature of trend

spectral entropy

Do PCA on feature matrix

Visualising and forecasting big time series data

Time series visualisation

15 - Feature analysis

139

87

4

172

152

188

192

.)

ar

7

25

156

80

100 200

223

166

97

112

xplained v 2

72

73

47

32

116e

85 69

52

21

65

160

149

151

lump

spik

2855

240 16

40

13

177

249

220

247

257

261

185

245

265

277

281

17

71

205

77

233

81

196

269

49225

273

297

201

145

229

176 164

season

trough

289

20214

ity168 124

180

237

216

276

128

211

89

193

peak

288

210 136 264108

293

9

212

ed PC2 (18.6% e

231

14

290 88

138

linear 27

44

109

189

59

75

41

209

55

118

132

298 256

173

74

202

161

45

70110

178

148 43

101

120

224

141

163

0

22 278

153

38

122

190

270

283

199

62

66

175

217

117

236

184

171

146 35

144 95

268

103

170

68

127

1

262

98

179

286 157

12

96 207

169

246

33

206

300

125

282cur

67

222

299

84

92

115

154

204

232 79

235

213

241

253

37

111

239

294

2

6

61

93 56

226

105

134143 215

263

129

250

v 284

entrop

126 86

234

18

2830

31

57 60 227

258 63

82

274

ature

301 181

133

187 99

243279 26

113

147

280

292 83

197 198

208

230

303

304

standardiz

34

130

242

266

260

221 142

186

219

121

244

267

y

137

19272

295302

194

248

23

90

94

106191 76

91

135

155

182

203

218

296

42

78

119 29

17448

195 4

10255 8

252 107

158

159

275

259

58 104

228

f

238

15165

o 50

114

287

54167

.acf

3

46

291102 36

140

271

123 1164

131

150

162

53

183

254 24

251

39

51

−2

−2

0

2

standardized PC1 (43.2% explained var.)

Visualising and forecasting big time series data

Time series visualisation

16 - Feature analysis

800

600

BEGBus

400

200

0

750

BCCBus

500

250

0

alue

v 400

CCA

300

Oth

200

100

0

1500

CA

1000

COth

500

0

2000

2005

2010

Time

Visualising and forecasting big time series data

Time series visualisation

16 - Feature analysis

1600

1200

AD

AHol

800

400

1000

BDCHol

750

500

250

2000

alue

v

1500

BBAHol

1000

500

4000

A

CAHol

3000

2000

1000

2000

2005

2010

Time

Visualising and forecasting big time series data

Time series visualisation

16 - Feature analysis

NSW

NT

QLD

SA

6

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

4

●

●

●

●

●

●

●

●

●

●

●

●

●

●●

●

●

●●

●

●

●●

●

●

●●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

2

● ●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●●

●

●

●

●

●

●

●

● ● ●

●●

● ● ●

●●

● ● ●

●●

●

●

●

●

●

●

●

●

●

●

●

●●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

● ●

●●

●

●

●

●

●●

●●

●

● ●●

●●

●●

●

●

●

●

●

●

●

● ●

● ●

● ●

●

●

● ●

●

●

●

● ●

●

●

●● ●

●

●

●

●●

● ● ●

●

● ● ●

●

● ● ●

●

●●

●

●● ●

●

●● ●

●

●● ●

● ●

●

●

●

●

●

●

● ●

●

●

● ● ● ●

●

●

●

●

● ● ●

●

●

● ●

●

●

● ● ● ●

●

●

● ●

●●

● ●

●

●

●

● ●

●

● ●

● ●

●

●

●

●

● ●

●

● ●

●

●

●● ●

●

● ●

●

●

● ●

● ●

●

●●

●

●

●

●

●

●

●

●

●

●

●

● ●

●

●

●

● ●

●

●

●

● ●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

● ●

● ● ●

● ●

●

●●

●

●●

● ●

●

● ●●

● ● ●●

●●

●

● ●

●

● ●●● ●●

●●

●

● ●

●

● ●●

● ● ●●

●●

●

●

●

●

●

●

●

0

●

● ●

● ●

● ● ●●

●

● ●

● ●

●

●

● ●

●

●

● ●

●

●●

●

●

●

● ●

● ●

●

●

●●

●

●● ●

● ●

● ●

●

●

●

● ●

●

●

● ●

● ●

●

●

●●

●

●

● ●

●

● ●

●

●

●

● ● ●

●

●●

●

● ●

● ●

● ●

●

● ●

● ●

●

● ●

● ● ●

●●

● ●

●

●

● ●

● ● ●

● ●

●

● ●

● ●

●

●●

●●

● ●

●

● ●

●

● ●

● ●

●

● ●

●

●●

●●

●

●

●

●●

●

●

●

●

●●

●

●

●●

●

●

●

●

● ● ●●

●

●

●

●

●●

●

●

●●

●

●

●

●

●

● ●

●

●

●

●

●

●

●●

●

●

● ●

●

●

●●

● ●● ●

●

●●

●

● ●

● ●●

●

●

●●

●

● ●

● ●●

●

●

●●

●

● ●

● ●●

●

●

●

●

●

●

● ●

● ●

● ●

●

●● ●

●●

●● ●

●

●● ●

●

●

●

●

●

● ● ●

● ●

●●

●●●

● ●

●

●

●

●● ●

● ●●

●

● ●● ●

●●●

● ●

●

●● ●

● ●●

●

● ●●● ●

● ●

●

●● ●

● ● ●

●

● ●● ●●●

●

●●●

●

●

●●

●

●

●

●

●

●

●

●

●●

●

●

● ●●

●

●●

●

●

●●

●

●

● ●

●

● ●

●●

●

●

●

● ●●

●

●●

● ●

●

●

●●●●

● ●

● ●

●●

●●

●

●●

●

●●●●

● ●

●●

●

●●

●

●●

●

●

●●●●

● ●

● ●

●●

●

●

●

● ●

●

●

●

●

●●●

●

●

●●

●

● ●

●

●

●●●

●

●

●●

●

● ●

●

●

●●●

●

●

●●

●

● ●

●

●

●●●

●

●

● ●

●

●

●

●

●

●●

●

●●

●

● ●

●

●●●

●

●

●●●

●

●

●●●

●

●

●●

●

●

●● ●

●

●● ●

●

●● ●

●

●●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

−2

●●●

●

● ● ●

●

●

● ● ●

●

●

● ● ●

●

●

●

●

●

●

TAS

VIC

WA

PC2 6

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

4

●

●

●

●

●

●

●

●

●

●

●●

●

●

●

●

●

●

●●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

2

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

● ●

●

●

●

●

● ●

●

●

●

● ●

●●

●●

●

●

●

●

● ●

●

●

●

●

●

●

●

●●

●

●

●

●

● ●

●

●

●

●

●●

●

●

●

●

● ●

●

●

●

●

●

●

● ●

●

●

● ●

●

● ● ●

●

● ●

●

●

●

● ● ●

●

●

●

● ● ●

●

● ● ●

●

●

●

●● ●

●

●● ●

● ●

● ●

●

● ● ● ●

●

●

●

●

● ●

● ●

● ● ●●

●

●

●

●

●●

● ● ● ●

●

●

●

●

●

● ●

● ●

●

●

●

●

● ●

●●

●

●

●

● ●

●

● ●

●

●

●

●

●

●●

●

● ●

●

● ●

● ●

●

●

● ●

●

●

●

●

●

●

●

●

●

●●

● ●

●●

●

●

●

●●

●

● ●●

● ●

●

●●

●●

● ●

●

● ●●

● ● ●●

●●

●

● ●

●

●

●

●● ●

●●

●

●

●

●

●●

●

●

●

●

●● ●

●

●

●●

● ●

●

●

●

●

0

● ● ●● ●

●

● ●

●

● ●

●

●

●

●

●●

●

●● ●

●

● ● ●

●●

●

●●

●

●

●

●

● ● ●

●●

●

● ●

●

● ●

●

●

●

●

●

●

●

● ●

●

●

● ●

●

●

● ●

● ● ●

● ● ●

●

● ●

●

● ●

● ●

●

●

●●

●

●●

●

●

● ●

●

●

●

●

●

●

●

● ●

●

●

●

●●

●

●

●

●

●

●

●●

●

●

●

●

●●

●

●●●

●

●●

●

●

● ●●

●

● ●

●

●

●●

●

● ●

● ●●

●

●

●

●

●●

● ●

●

●

●

●●

● ●

●● ●

●

● ●●

● ●

● ●

● ●

●

●

●

● ●

● ●

●

●

●

●●

●

●

●

●●

●● ●

●

●●

●

● ●

● ●

● ● ●

●●

● ●

● ●

●

●● ●

● ● ● ●

●

●● ●

●

● ●

● ●

●

●

●

●

●

●

●

●

●

●

●

●

●●

●

●

●

●●

●

●

● ●

●

●

● ●

●

● ●

●●

●

●●

●●

●

●

●

●

●

●●

●● ●

●

● ●

●

●●

●

●

●●

●

●

●●

●

●

●

● ●

●●

●●

●

●

●●

●●

●●

●

●

●

●

● ●●

●●

●

● ●

●

●●

●

●●

●

● ●

●

●●

●

● ●

●●

●

● ●

●

●

●

●●●

●

●

●●●

●

●

●●●

●

●

● ●

●

●

●

●● ●

●

●

●

●● ●

●

●

●

●

●

●

●●

●

●

●

●

−2

● ●

●

●

●

●

● ● ●

●

●

● ● ●

●

●

●

●

●

−7.5−5.0−2.5 0.0 2.5 5.0

−7.5−5.0−2.5 0.0 2.5 5.0

−7.5−5.0−2.5 0.0 2.5 5.0

PC1

Visualising and forecasting big time series data

Time series visualisation

16 - Feature analysis

Bus

Hol

6

●

●

●●

●

●

●

●

●

●

4

●

●

●

●●

●

●

● ●

●

●

● ●

●

●

●

●

●

●

●

●

2

●

●

●

●

● ● ●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●●

●

●● ●

●

●

●

●

●

●●

● ●

●

●

●

●

●

●

●

●

●

●

●

●

● ● ●

●

●

●

● ● ●

●

●

●

●

●● ●

●●

●

●

●

●

●

●

●● ●

●

●

●

●

● ● ●

●●

●● ●

●

●

●

●

●

●

● ● ● ●●●

●● ●

●

●

●

●

●

●

● ● ●●

●

●

●

●

●

● ● ●●

●

●

● ●

●

● ●●

●

● ●●●

●

●

●●

●

● ● ●

● ●

●

●

●

● ●

●

●

●

● ● ●

●

●

● ● ●

●

●

●

●

● ●

●

●● ●●

●

●

●

● ●

●

●

●

●

●

●

● ● ●

●

●

●

●

●

●

●● ●● ●

●

●

●

●● ●

●● ●

0

●

●

●

●

●

● ●

● ●

●

●

●

● ● ●

●

●● ●

●

●

● ●

●● ●

●

● ●

● ●

● ●

●

●

●

●

●

●●

●

●

●

● ● ●

●

●

●

●● ● ●● ● ●●

● ●

●

● ●

●

● ●

●●

●● ●

●

●

●

● ● ●

●● ●

● ●

●

●● ●

●

●

●

●

● ●

● ●

● ● ●

●

●

●

● ● ●●

●

● ●

●

●●

●

●

●

● ● ●

●

● ●

● ●

●●●

●●

●

●

●

●

● ●

●● ●

●●●

●● ●● ● ●●

●

● ● ●

● ●

●

●

● ●

●●●

●● ●

●●●

●

●

● ●

●

●

●

● ●

●

●

● ●●

● ●

●

●

●

●

● ● ●

●●

●

●●●

●

● ●

●

●●

●

●

●

●

● ●

●

●●

● ●

● ●

●●

●

● ●

●

●

●

● ●

●

● ●

●

● ● ●

●

●

●

●

● ● ●

●

●●

● ● ●

● ●●

● ●

●

● ●

●

●

● ●●

● ●

●

● ●

●

●

●

●

●●

●

● ●●

−2

●

●

●

●

●

●

●

● ●●

●

●

●

Oth

Vis

PC2 6

●

●

●

●

●

●

●

●

●

●

4

●

●

●

●

●

●

●●

● ●

●

● ●

●

●

●

●

●

●

●

●

●

●

●

2

●

●

● ●

●

●

●

●

●

● ●

●

●

●

●

●

●

●

●

●

●

●

●

●

●●

●

●

●●

● ●

●

●

●

●

●

●

●

●

●

●

● ●

●

● ●

●

● ● ●

●

●

●

●

●

● ●

●

●

●

●● ●

●●

●

●

●

●

●

●

●● ●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

● ● ● ●● ●

●● ●

●

●

●

●

●●

●

●

● ●●

●

●

●

●

●

● ● ●●

●

●

● ●

●

●

●

● ● ●

●

●

●

● ●

●

●

●

●

● ● ●

●

●●

●

●

●

●

●

● ●

● ●

●

● ●

●

●

●

●

●

●

●

●

●

● ●

●

●● ●●

●

●

● ●

●

● ●

●

●

●

●

●

● ●

●

●

●

●●

●

●

●● ●

●

●

●

●

0

●

●

●● ●

●

●

●

●

●

● ●

● ●

● ●

● ●

●

● ● ●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

●

● ●

●

●

●

●

●●

●

●

●

●

●

●

●

● ● ●●

● ●

● ●●

●

●

●●

● ● ●

●

● ●

●

●

●

●

●

●

● ● ●

●

●

●

●

● ●

●

● ● ●● ●

● ●

● ● ●● ●

●

●

●

●

●

●

●

●

● ●

●● ●

●

● ●

● ● ●

● ●

● ● ●

●●

● ●

● ●

●

●●●

●

●

●

● ●

●

●

● ●

●

●

●

● ● ●

● ●● ●

●

● ●

●

●

●

●●●

● ●

●

● ●

●

●●

●

●

●

●●

●

●● ●●

●

●

● ● ●

● ●

● ●

●

● ●

●

●●

●

● ●

●

● ●

● ●

● ●

●

● ●

●

● ●●

●

●●

● ●●

● ●

●

●

● ● ●

●

●

●

●● ●

● ● ●

● ● ●

●

●

●

●

●

● ●●

●

● ● ●

●

●

● ●● ●

● ●

●

● ●

● ●

●

● ●

●

●

●

● ●●

●

−2

● ●

●

●●

●

●

● ●●

●

●

●

−7.5

−5.0

−2.5

0.0

2.5

5.0

−7.5

−5.0

−2.5

0.0

2.5

5.0

PC1

Visualising and forecasting big time series data

Time series visualisation

16 - Hierarchical time series

A hierarchical time series is a collection of

several time series that are linked together in

a hierarchical structure.

Total

A

B

C

AA

AB

AC

BA

BB

BC

CA

CB

CC

Examples

Net labour turnover

Tourism by state and region

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

18 - Hierarchical time series

A hierarchical time series is a collection of

several time series that are linked together in

a hierarchical structure.

Total

A

B

C

AA

AB

AC

BA

BB

BC

CA

CB

CC

Examples

Net labour turnover

Tourism by state and region

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

18 - Hierarchical time series

A hierarchical time series is a collection of

several time series that are linked together in

a hierarchical structure.

Total

A

B

C

AA

AB

AC

BA

BB

BC

CA

CB

CC

Examples

Net labour turnover

Tourism by state and region

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

18 - Hierarchical time series

Yt : observed aggregate of all

Total

series at time t.

YX,t : observation on series X at

time t.

A

B

C

Bt : vector of all series at

bottom level in time t.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

19 - Hierarchical time series

Yt : observed aggregate of all

Total

series at time t.

YX,t : observation on series X at

time t.

A

B

C

Bt : vector of all series at

bottom level in time t.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

19 - Hierarchical time series

Yt : observed aggregate of all

Total

series at time t.

YX,t : observation on series X at

time t.

A

B

C

Bt : vector of all series at

bottom level in time t.

1 1 1 Y

A,t

1

0 0

yt = [Yt, YA,t, YB,t, YC,t] =

Y

B,t

0

1 0

Y

0 0 1

C,t

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

19 - Hierarchical time series

Yt : observed aggregate of all

Total

series at time t.

YX,t : observation on series X at

time t.

A

B

C

Bt : vector of all series at

bottom level in time t.

1 1 1 Y

A,t

1

0 0

yt = [Yt, YA,t, YB,t, YC,t] =

Y

B,t

0

1 0

Y

0 0 1

C,t

S

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

19 - Hierarchical time series

Yt : observed aggregate of all

Total

series at time t.

YX,t : observation on series X at

time t.

A

B

C

Bt : vector of all series at

bottom level in time t.

1 1 1 Y

A,t

1

0 0

yt = [Yt, YA,t, YB,t, YC,t] =

Y

B,t

0

1 0

Y

0 0 1

C,t

Bt

S

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

19 - Hierarchical time series

Yt : observed aggregate of all

Total

series at time t.

YX,t : observation on series X at

time t.

A

B

C

Bt : vector of all series at

bottom level in time t.

1 1 1 Y

A,t

1

0 0

yt = [Yt, YA,t, YB,t, YC,t] =

Y

B,t

0

1 0

Y

0 0 1

C,t

Bt

yt = SBt

S

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

19 - Hierarchical time series

Total

A

B

C

AX

AY

AZ

BX

BY

BZ

CX

CY

CZ

Yt

1

1

1

1

1

1

1

1

1

YA,t

1

1

1

0

0

0

0

0

0

Y

0

0

0

1

1

1

0

0

0

Y

B,t

AX,t

YC,t

0

0

0

0

0

0

1

1

1

YAY,t

Y

AX,t

1

0

0

0

0

0

0

0

0

YAZ,t

Y

AY,t

0

1

0

0

0

0

0

0

0

YBX,t

y

t = YAZ,t = 0

0

1

0

0

0

0

0

0

YBY,t

YBX,t

0

0

0

1

0

0

0

0

0

Y

BZ,t

Y

BY,t

0

0

0

0

1

0

0

0

0

YCX,t

Y

0

0

0

0

0

1

0

0

0

Y

BZ,t

CY,t

YCX,t

0

0

0

0

0

0

1

0

0

YCZ,t

YCY,t

0

0

0

0

0

0

0

1

0

Y

B

CZ,t

0

0

0

0

0

0

0

0

1

t

S

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

20 - Hierarchical time series

Total

A

B

C

AX

AY

AZ

BX

BY

BZ

CX

CY

CZ

Yt

1

1

1

1

1

1

1

1

1

YA,t

1

1

1

0

0

0

0

0

0

Y

0

0

0

1

1

1

0

0

0

Y

B,t

AX,t

YC,t

0

0

0

0

0

0

1

1

1

YAY,t

Y

AX,t

1

0

0

0

0

0

0

0

0

YAZ,t

Y

AY,t

0

1

0

0

0

0

0

0

0

YBX,t

y

t = YAZ,t = 0

0

1

0

0

0

0

0

0

YBY,t

YBX,t

0

0

0

1

0

0

0

0

0

Y

BZ,t

Y

BY,t

0

0

0

0

1

0

0

0

0

YCX,t

Y

0

0

0

0

0

1

0

0

0

Y

BZ,t

CY,t

YCX,t

0

0

0

0

0

0

1

0

0

YCZ,t

YCY,t

0

0

0

0

0

0

0

1

0

Y

B

CZ,t

0

0

0

0

0

0

0

0

1

t

S

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

20 - Hierarchical time series

Total

A

B

C

AX

AY

AZ

BX

BY

BZ

CX

CY

CZ

Yt

1

1

1

1

1

1

1

1

1

YA,t

1

1

1

0

0

0

0

0

0

Y

0

0

0

1

1

1

0

0

0

Y

B,t

AX,t

YC,t

0

0

0

0

0

0

1

1

1

YAY,t

Y

AX,t

1

0

0

0

0

0

0

0

0

YAZ,t

Y

AY,t

0

1

0

0

0

0

0

0

0

YBX,t

y

t = YAZ,t = 0

0

1

0

0

0

0

0

0

YBY,t

YBX,t

0

0

0

1

0

0

0

0

0

Y

BZ,t

Y

BY,t

0

0

0

0

1

0

0

0

0

YCX,t

Y

0

0

0

0

0

1

0

0

0

Y

BZ,t

CY,t

YCX,t

0

0

0

0

0

0

1

0

0

YCZ,t

YCY,t

0

0

0

0

0

0

0

1

0

y

Y

B

t = SBt

CZ,t

0

0

0

0

0

0

0

0

1

t

S

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

20 - Forecasting notation

Let ˆ

yn(h) be vector of initial h-step forecasts,

made at time n, stacked in same order as yt.

(They may not add up.)

Reconciled forecasts are of the form:

˜

yn(h) = SPˆ

yn(h)

for some matrix P.

P extracts and combines base forecasts

ˆ

yn(h) to get bottom-level forecasts.

S adds them up

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

21 - Forecasting notation

Let ˆ

yn(h) be vector of initial h-step forecasts,

made at time n, stacked in same order as yt.

(They may not add up.)

Reconciled forecasts are of the form:

˜

yn(h) = SPˆ

yn(h)

for some matrix P.

P extracts and combines base forecasts

ˆ

yn(h) to get bottom-level forecasts.

S adds them up

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

21 - Forecasting notation

Let ˆ

yn(h) be vector of initial h-step forecasts,

made at time n, stacked in same order as yt.

(They may not add up.)

Reconciled forecasts are of the form:

˜

yn(h) = SPˆ

yn(h)

for some matrix P.

P extracts and combines base forecasts

ˆ

yn(h) to get bottom-level forecasts.

S adds them up

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

21

Let ˆ

yn(h) be vector of initial h-step forecasts,

made at time n, stacked in same order as yt.

(They may not add up.)

Reconciled forecasts are of the form:

˜

yn(h) = SPˆ

yn(h)

for some matrix P.

P extracts and combines base forecasts

ˆ

yn(h) to get bottom-level forecasts.

S adds them up

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

21

Let ˆ

yn(h) be vector of initial h-step forecasts,

made at time n, stacked in same order as yt.

(They may not add up.)

Reconciled forecasts are of the form:

˜

yn(h) = SPˆ

yn(h)

for some matrix P.

P extracts and combines base forecasts

ˆ

yn(h) to get bottom-level forecasts.

S adds them up

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

21- General properties: bias

˜

yn(h) = SPˆ

yn(h)

Assume: base forecasts ˆ

yn(h) are unbiased:

E[ˆ

yn(h)|y1, . . . , yn] = E[yn+h|y1, . . . , yn]

Let ˆ

Bn(h) be bottom level base forecasts

with βn(h) = E[ˆ

Bn(h)|y1, . . . , yn].

Then E[ˆ

yn(h)] = Sβn(h).

We want the revised forecasts to be

unbiased: E[˜

yn(h)] = SPSβn(h) = Sβn(h).

Revised forecasts are unbiased iff SPS = S.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

22 - General properties: bias

˜

yn(h) = SPˆ

yn(h)

Assume: base forecasts ˆ

yn(h) are unbiased:

E[ˆ

yn(h)|y1, . . . , yn] = E[yn+h|y1, . . . , yn]

Let ˆ

Bn(h) be bottom level base forecasts

with βn(h) = E[ˆ

Bn(h)|y1, . . . , yn].

Then E[ˆ

yn(h)] = Sβn(h).

We want the revised forecasts to be

unbiased: E[˜

yn(h)] = SPSβn(h) = Sβn(h).

Revised forecasts are unbiased iff SPS = S.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

22 - General properties: bias

˜

yn(h) = SPˆ

yn(h)

Assume: base forecasts ˆ

yn(h) are unbiased:

E[ˆ

yn(h)|y1, . . . , yn] = E[yn+h|y1, . . . , yn]

Let ˆ

Bn(h) be bottom level base forecasts

with βn(h) = E[ˆ

Bn(h)|y1, . . . , yn].

Then E[ˆ

yn(h)] = Sβn(h).

We want the revised forecasts to be

unbiased: E[˜

yn(h)] = SPSβn(h) = Sβn(h).

Revised forecasts are unbiased iff SPS = S.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

22

˜

yn(h) = SPˆ

yn(h)

Assume: base forecasts ˆ

yn(h) are unbiased:

E[ˆ

yn(h)|y1, . . . , yn] = E[yn+h|y1, . . . , yn]

Let ˆ

Bn(h) be bottom level base forecasts

with βn(h) = E[ˆ

Bn(h)|y1, . . . , yn].

Then E[ˆ

yn(h)] = Sβn(h).

We want the revised forecasts to be

unbiased: E[˜

yn(h)] = SPSβn(h) = Sβn(h).

Revised forecasts are unbiased iff SPS = S.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

22

˜

yn(h) = SPˆ

yn(h)

Assume: base forecasts ˆ

yn(h) are unbiased:

E[ˆ

yn(h)|y1, . . . , yn] = E[yn+h|y1, . . . , yn]

Let ˆ

Bn(h) be bottom level base forecasts

with βn(h) = E[ˆ

Bn(h)|y1, . . . , yn].

Then E[ˆ

yn(h)] = Sβn(h).

We want the revised forecasts to be

unbiased: E[˜

yn(h)] = SPSβn(h) = Sβn(h).

Revised forecasts are unbiased iff SPS = S.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

22

˜

yn(h) = SPˆ

yn(h)

Assume: base forecasts ˆ

yn(h) are unbiased:

E[ˆ

yn(h)|y1, . . . , yn] = E[yn+h|y1, . . . , yn]

Let ˆ

Bn(h) be bottom level base forecasts

with βn(h) = E[ˆ

Bn(h)|y1, . . . , yn].

Then E[ˆ

yn(h)] = Sβn(h).

We want the revised forecasts to be

unbiased: E[˜

yn(h)] = SPSβn(h) = Sβn(h).

Revised forecasts are unbiased iff SPS = S.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

22

˜

yn(h) = SPˆ

yn(h)

Assume: base forecasts ˆ

yn(h) are unbiased:

E[ˆ

yn(h)|y1, . . . , yn] = E[yn+h|y1, . . . , yn]

Let ˆ

Bn(h) be bottom level base forecasts

with βn(h) = E[ˆ

Bn(h)|y1, . . . , yn].

Then E[ˆ

yn(h)] = Sβn(h).

We want the revised forecasts to be

unbiased: E[˜

yn(h)] = SPSβn(h) = Sβn(h).

Revised forecasts are unbiased iff SPS = S.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

22- General properties: variance

˜

yn(h) = SPˆ

yn(h)

Let variance of base forecasts ˆ

yn(h) be given

by

Σh = Var[ˆ

yn(h)|y1, . . . , yn]

Then the variance of the revised forecasts is

given by

Var[˜

yn(h)|y1, . . . , yn] = SPΣhP S .

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

23 - General properties: variance

˜

yn(h) = SPˆ

yn(h)

Let variance of base forecasts ˆ

yn(h) be given

by

Σh = Var[ˆ

yn(h)|y1, . . . , yn]

Then the variance of the revised forecasts is

given by

Var[˜

yn(h)|y1, . . . , yn] = SPΣhP S .

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

23 - General properties: variance

˜

yn(h) = SPˆ

yn(h)

Let variance of base forecasts ˆ

yn(h) be given

by

Σh = Var[ˆ

yn(h)|y1, . . . , yn]

Then the variance of the revised forecasts is

given by

Var[˜

yn(h)|y1, . . . , yn] = SPΣhP S .

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

23 - BLUF via trace minimization

Theorem

For any P satisfying SPS = S, then

min = trace[SPΣhP S ]

P

has solution P = (S Σ† S)−1S Σ† .

h

h

Σ† is generalized inverse of Σ

h

h.

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Equivalent to GLS estimate of regression

ˆ

yn(h) = Sβn(h) + εh where ε ∼ N(0, Σh).

Problem: Σh hard to estimate.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

24 - BLUF via trace minimization

Theorem

For any P satisfying SPS = S, then

min = trace[SPΣhP S ]

P

has solution P = (S Σ† S)−1S Σ† .

h

h

Σ† is generalized inverse of Σ

h

h.

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Equivalent to GLS estimate of regression

ˆ

yn(h) = Sβn(h) + εh where ε ∼ N(0, Σh).

Problem: Σh hard to estimate.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

24 - BLUF via trace minimization

Theorem

For any P satisfying SPS = S, then

min = trace[SPΣhP S ]

P

has solution P = (S Σ† S)−1S Σ† .

h

h

Σ† is generalized inverse of Σ

h

h.

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Equivalent to GLS estimate of regression

ˆ

yn(h) = Sβn(h) + εh where ε ∼ N(0, Σh).

Problem: Σh hard to estimate.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

24

Theorem

For any P satisfying SPS = S, then

min = trace[SPΣhP S ]

P

has solution P = (S Σ† S)−1S Σ† .

h

h

Σ† is generalized inverse of Σ

h

h.

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Equivalent to GLS estimate of regression

ˆ

yn(h) = Sβn(h) + εh where ε ∼ N(0, Σh).

Problem: Σh hard to estimate.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

24

Theorem

For any P satisfying SPS = S, then

min = trace[SPΣhP S ]

P

has solution P = (S Σ† S)−1S Σ† .

h

h

Σ† is generalized inverse of Σ

h

h.

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Equivalent to GLS estimate of regression

ˆ

yn(h) = Sβn(h) + εh where ε ∼ N(0, Σh).

Problem: Σh hard to estimate.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

24

Theorem

For any P satisfying SPS = S, then

min = trace[SPΣhP S ]

P

has solution P = (S Σ† S)−1S Σ† .

h

h

Σ† is generalized inverse of Σ

h

h.

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Equivalent to GLS estimate of regression

ˆ

yn(h) = Sβn(h) + εh where ε ∼ N(0, Σh).

Problem: Σh hard to estimate.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

24- Optimal combination forecasts

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Solution 1: OLS

Assume εh ≈ SεB,h where εB,h is the

forecast error at bottom level.

Then Σh ≈ SΩhS where Ωh = Var(εB,h).

If Moore-Penrose generalized inverse used,

then (S Σ† S)−1S Σ† = (S S)−1S .

h

h

˜

yn(h) = S(S S)−1S ˆ

yn(h)

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

25 - Optimal combination forecasts

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Solution 1: OLS

Assume εh ≈ SεB,h where εB,h is the

forecast error at bottom level.

Then Σh ≈ SΩhS where Ωh = Var(εB,h).

If Moore-Penrose generalized inverse used,

then (S Σ† S)−1S Σ† = (S S)−1S .

h

h

˜

yn(h) = S(S S)−1S ˆ

yn(h)

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

25 - Optimal combination forecasts

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Solution 1: OLS

Assume εh ≈ SεB,h where εB,h is the

forecast error at bottom level.

Then Σh ≈ SΩhS where Ωh = Var(εB,h).

If Moore-Penrose generalized inverse used,

then (S Σ† S)−1S Σ† = (S S)−1S .

h

h

˜

yn(h) = S(S S)−1S ˆ

yn(h)

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

25

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Solution 1: OLS

Assume εh ≈ SεB,h where εB,h is the

forecast error at bottom level.

Then Σh ≈ SΩhS where Ωh = Var(εB,h).

If Moore-Penrose generalized inverse used,

then (S Σ† S)−1S Σ† = (S S)−1S .

h

h

˜

yn(h) = S(S S)−1S ˆ

yn(h)

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

25

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Solution 1: OLS

Assume εh ≈ SεB,h where εB,h is the

forecast error at bottom level.

Then Σh ≈ SΩhS where Ωh = Var(εB,h).

If Moore-Penrose generalized inverse used,

then (S Σ† S)−1S Σ† = (S S)−1S .

h

h

˜

yn(h) = S(S S)−1S ˆ

yn(h)

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

25

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Solution 1: OLS

Assume εh ≈ SεB,h where εB,h is the

forecast error at bottom level.

Then Σh ≈ SΩhS where Ωh = Var(εB,h).

If Moore-Penrose generalized inverse used,

then (S Σ† S)−1S Σ† = (S S)−1S .

h

h

˜

yn(h) = S(S S)−1S ˆ

yn(h)

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

25- Optimal combination forecasts

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Solution 2: WLS

Suppose we approximate Σ1 by its

diagonal.

Easy to estimate, and places weight where

we have best forecasts.

Empirically, it gives better forecasts than

other available methods.

˜

yn(h) = S(S ΛS)−1S Λˆ

yn(h)

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

26 - Optimal combination forecasts

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Solution 2: WLS

Suppose we approximate Σ1 by its

diagonal.

Easy to estimate, and places weight where

we have best forecasts.

Empirically, it gives better forecasts than

other available methods.

˜

yn(h) = S(S ΛS)−1S Λˆ

yn(h)

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

26 - Optimal combination forecasts

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Solution 2: WLS

Suppose we approximate Σ1 by its

diagonal.

Easy to estimate, and places weight where

we have best forecasts.

Empirically, it gives better forecasts than

other available methods.

˜

yn(h) = S(S ΛS)−1S Λˆ

yn(h)

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

26

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Solution 2: WLS

Suppose we approximate Σ1 by its

diagonal.

Easy to estimate, and places weight where

we have best forecasts.

Empirically, it gives better forecasts than

other available methods.

˜

yn(h) = S(S ΛS)−1S Λˆ

yn(h)

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

26

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Solution 2: WLS

Suppose we approximate Σ1 by its

diagonal.

Easy to estimate, and places weight where

we have best forecasts.

Empirically, it gives better forecasts than

other available methods.

˜

yn(h) = S(S ΛS)−1S Λˆ

yn(h)

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

26

˜

yn(h) = S(S Σ† S)−1S Σ† ˆ

y

h

h

n(h)

Revised forecasts

Base forecasts

Solution 2: WLS

Suppose we approximate Σ1 by its

diagonal.

Easy to estimate, and places weight where

we have best forecasts.

Empirically, it gives better forecasts than

other available methods.

˜

yn(h) = S(S ΛS)−1S Λˆ

yn(h)

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

26- Challenges

˜

yn(h) = S(S ΛS)−1S Λˆ

yn(h)

Computational difficulties in big

hierarchies due to size of the S matrix and

singular behavior of (S ΛS).

Loss of information in ignoring covariance

matrix in computing point forecasts.

Still need to estimate covariance matrix to

produce prediction intervals.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

27 - Challenges

˜

yn(h) = S(S ΛS)−1S Λˆ

yn(h)

Computational difficulties in big

hierarchies due to size of the S matrix and

singular behavior of (S ΛS).

Loss of information in ignoring covariance

matrix in computing point forecasts.

Still need to estimate covariance matrix to

produce prediction intervals.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

27 - Challenges

˜

yn(h) = S(S ΛS)−1S Λˆ

yn(h)

Computational difficulties in big

hierarchies due to size of the S matrix and

singular behavior of (S ΛS).

Loss of information in ignoring covariance

matrix in computing point forecasts.

Still need to estimate covariance matrix to

produce prediction intervals.

Visualising and forecasting big time series data

BLUF: Best Linear Unbiased Forecasts

27 - Australian tourism

Visualising and forecasting big time series data

Application: Australian tourism

29 - Australian tourism

Hierarchy:

States (7)

Zones (27)

Regions (82)

Visualising and forecasting big time series data

Application: Australian tourism

29 - Australian tourism

Hierarchy:

States (7)

Zones (27)

Regions (82)

Base forecasts

ETS (exponential

smoothing) models

Visualising and forecasting big time series data

Application: Australian tourism

29 - Base forecasts

Domestic tourism forecasts: Total

85000

80000

75000

Visitor nights

70000

65000

60000

1998

2000

2002

2004

2006

2008

Year

Visualising and forecasting big time series data

Application: Australian tourism

30 - Base forecasts

Domestic tourism forecasts: NSW

30000

26000

Visitor nights

22000

18000

1998

2000

2002

2004

2006

2008

Year

Visualising and forecasting big time series data

Application: Australian tourism

30 - Base forecasts

Domestic tourism forecasts: VIC

18000

16000

14000

Visitor nights

12000

10000

1998

2000

2002

2004

2006

2008

Year

Visualising and forecasting big time series data

Application: Australian tourism

30 - Base forecasts

Domestic tourism forecasts: Nth.Coast.NSW

9000

8000

7000

Visitor nights

6000

5000

1998

2000

2002

2004

2006

2008

Year

Visualising and forecasting big time series data

Application: Australian tourism

30 - Base forecasts

Domestic tourism forecasts: Metro.QLD

13000

11000

Visitor nights

9000

8000

1998

2000

2002

2004

2006

2008

Year

Visualising and forecasting big time series data

Application: Australian tourism

30 - Base forecasts

Domestic tourism forecasts: Sth.WA

1400

1200

1000

Visitor nights

800

600

400

1998

2000

2002

2004

2006

2008

Year

Visualising and forecasting big time series data

Application: Australian tourism

30 - Base forecasts

Domestic tourism forecasts: X201.Melbourne

6000

5500

5000

Visitor nights

4500

4000

1998

2000

2002

2004

2006

2008

Year

Visualising and forecasting big time series data

Application: Australian tourism

30 - Base forecasts

Domestic tourism forecasts: X402.Murraylands

300

200

Visitor nights

100

0

1998

2000

2002

2004

2006

2008

Year

Visualising and forecasting big time series data

Application: Australian tourism

30 - Base forecasts

Domestic tourism forecasts: X809.Daly

100

80

60

Visitor nights

40

20

0

1998

2000

2002

2004

2006

2008

Year

Visualising and forecasting big time series data

Application: Australian tourism

30 - Reconciled forecasts

95000

otal

T

80000

65000

2000

2005

2010

Visualising and forecasting big time series data

Application: Australian tourism

31 - Reconciled forecasts

30000

18000

NSW

VIC

24000

14000

18000

2000

2005

2010

10000

2000

2005

2010

20000

QLD

Other

24000

14000

2000

2005

2010

18000

2000

2005

2010

Visualising and forecasting big time series data

Application: Australian tourism

31 - Reconciled forecasts

y

22000

7000

Sydne

Other NSW

4000

14000

2000

2005

2010

2000

2005

2010

ne

12000

5000

Melbour

Other VIC

4000

6000

2000

2005

2010

2000

2005

2010

isbane

9000

12000

Other QLD

GC and Br

6000

2000

2005

2010

6000

2000

2005

2010

20000

7500

Other

Capital cities

14000

5500

2000

2005

2010

2000

2005

2010

Visualising and forecasting big time series data

Application: Australian tourism

31 - Forecast evaluation

Select models using all observations;

Re-estimate models using first 12

observations and generate 1- to

8-step-ahead forecasts;

Increase sample size one observation at a

time, re-estimate models, generate

forecasts until the end of the sample;

In total 24 1-step-ahead, 23

2-steps-ahead, up to 17 8-steps-ahead for

forecast evaluation.

Visualising and forecasting big time series data

Application: Australian tourism

32 - Forecast evaluation

Select models using all observations;

Re-estimate models using first 12

observations and generate 1- to

8-step-ahead forecasts;

Increase sample size one observation at a

time, re-estimate models, generate

forecasts until the end of the sample;

In total 24 1-step-ahead, 23

2-steps-ahead, up to 17 8-steps-ahead for

forecast evaluation.

Visualising and forecasting big time series data

Application: Australian tourism

32 - Forecast evaluation

Select models using all observations;

Re-estimate models using first 12

observations and generate 1- to

8-step-ahead forecasts;

Increase sample size one observation at a

time, re-estimate models, generate

forecasts until the end of the sample;

In total 24 1-step-ahead, 23

2-steps-ahead, up to 17 8-steps-ahead for

forecast evaluation.

Visualising and forecasting big time series data

Application: Australian tourism

32

Select models using all observations;

Re-estimate models using first 12

observations and generate 1- to

8-step-ahead forecasts;

Increase sample size one observation at a

time, re-estimate models, generate

forecasts until the end of the sample;

In total 24 1-step-ahead, 23

2-steps-ahead, up to 17 8-steps-ahead for

forecast evaluation.

Visualising and forecasting big time series data

Application: Australian tourism

32- Hierarchy: states, zones, regions

MAPE

h = 1

h = 2

h = 4

h = 6

h = 8

Average

Top Level: Australia

Bottom-up

3.79

3.58

4.01

4.55

4.24

4.06

OLS

3.83

3.66

3.88

4.19

4.25

3.94

WLS

3.68

3.56

3.97

4.57

4.25

4.04

Level: States

Bottom-up

10.70

10.52

10.85

11.46

11.27

11.03

OLS

11.07

10.58

11.13

11.62

12.21

11.35

WLS

10.44

10.17

10.47

10.97

10.98

10.67

Level: Zones

Bottom-up

14.99

14.97

14.98

15.69

15.65

15.32

OLS

15.16

15.06

15.27

15.74

16.15

15.48

WLS

14.63

14.62

14.68

15.17

15.25

14.94

Bottom Level: Regions

Bottom-up

33.12

32.54

32.26

33.74

33.96

33.18

OLS

35.89

33.86

34.26

36.06

37.49

35.43

WLS

31.68

31.22

31.08

32.41

32.77

31.89

Visualising and forecasting big time series data

Application: Australian tourism

33 - Fast computation: hierarchical data

Total

A

B

C

AX

AY

AZ

BX

BY

BZ

CX

CY

CZ

Yt

1

1

1

1

1

1

1

1

1

YA,t

1

1

1

0

0

0

0

0

0

Y

0

0

0

1

1

1

0

0

0

Y

B,t

AX,t

YC,t

0

0

0

0

0

0

1

1

1

YAY,t

Y

AX,t

1

0

0

0

0

0

0

0

0

YAZ,t

Y

AY,t

0

1

0

0

0

0

0

0

0

YBX,t

y

t = YAZ,t = 0

0

1

0

0

0

0

0

0

YBY,t

YBX,t

0

0

0

1

0

0

0

0

0

Y

BZ,t

Y

BY,t

0

0

0

0

1

0

0

0

0

YCX,t

Y

0

0

0

0

0

1

0

0

0

Y

BZ,t

CY,t

YCX,t

0

0

0

0

0

0

1

0

0

YCZ,t

YCY,t

0

0

0

0

0

0

0

1

0

y

Y

B

t = SBt

CZ,t

0

0

0

0

0

0

0

0

1

t

S

Visualising and forecasting big time series data

Fast computation tricks

35 - Fast computation: hierarchical data

Total

A

B

C

AX

AY

AZ

BX

BY

BZ

CX

CY

CZ

Yt

1

1

1

1

1

1

1

1

1

YA,t

1

1

1

0

0

0

0

0

0

Y

1

0

0

0

0

0

0

0

0

Y

AX,t

AX,t

YAY,t

0

1

0

0

0

0

0

0

0

YAY,t

Y

AZ,t

0

0

1

0

0

0

0

0

0

YAZ,t

Y

B,t

0

0

0

1

1

1

0

0

0

YBX,t

y

t = YBX,t = 0

0

0

1

0

0

0

0

0

YBY,t

YBY,t

0

0

0

0

1

0

0

0

0

Y

BZ,t

Y

BZ,t

0

0

0

0

0

1

0

0

0

YCX,t

Y

0

0

0

0

0

0

1

1

1

Y

C,t

CY,t

YCX,t

0

0

0

0

0

0

1

0

0

YCZ,t

YCY,t

0

0

0

0

0

0

0

1

0

y

Y

B

t = SBt

CZ,t

0

0

0

0

0

0

0

0

1

t

S

Visualising and forecasting big time series data

Fast computation tricks

36 - Fast computation: hierarchies

Think of the hierarchy as a tree of trees:

Total

T

. . .

1

T2

TK

Then the summing matrix contains k smaller summing

matrices:

1

1

· · · 1

n1

n2

nK

S

1

0

· · ·

0

S =

0

S

2

· · ·

0

..

..

. .

..

.

.

.

.

0

0

· · · SK

where 1n is an n-vector of ones and tree Ti has ni

terminal nodes.

Visualising and forecasting big time series data

Fast computation tricks

37 - Fast computation: hierarchies

Think of the hierarchy as a tree of trees:

Total

T

. . .

1

T2

TK

Then the summing matrix contains k smaller summing

matrices:

1

1

· · · 1

n1

n2

nK

S

1

0

· · ·

0

S =

0

S

2

· · ·

0

..

..

. .

..

.

.

.

.

0

0

· · · SK

where 1n is an n-vector of ones and tree Ti has ni

terminal nodes.

Visualising and forecasting big time series data

Fast computation tricks

37 - Fast computation: hierarchies

S Λ

1

1S1

0

· · ·

0

0

S Λ

2S2

· · ·

0

SΛS =

2

.

+λ

.

..

. .

..

0 Jn

.

.

.

.

0

0

· · · S Λ

K

K SK

λ0 is the top left element of Λ;

Λk is a block of Λ, corresponding to tree Tk;

Jn is a matrix of ones;

n =

n

k

k.

Now apply the Sherman-Morrison formula . . .

Visualising and forecasting big time series data

Fast computation tricks

38 - Fast computation: hierarchies

S Λ

1

1S1

0

· · ·

0

0

S Λ

2S2

· · ·

0

SΛS =

2

.

+λ

.

..

. .

..

0 Jn

.

.

.

.

0

0

· · · S Λ

K

K SK

λ0 is the top left element of Λ;

Λk is a block of Λ, corresponding to tree Tk;

Jn is a matrix of ones;

n =

n

k

k.

Now apply the Sherman-Morrison formula . . .

Visualising and forecasting big time series data

Fast computation tricks

38 - Fast computation: hierarchies

(S Λ

1

1S1)−1

0

· · ·

0

0

(S Λ

2

2S2)−1 · · ·

0

(SΛS)−1 =

.

.

.

.

−cS0

..

..

. .

..

0

0

· · · (S Λ

K

K SK )−1

S0 can be partitioned into K2 blocks, with the (k, )

block (of dimension nk × n ) being

(S Λ

k

k Sk )−1Jnk,n (S Λ S )−1

Jnk,n is a nk × n matrix of ones.

c−1 = λ−1 +

1 (S Λ

.

0

n

k Sk )−11n

k

k

k

k

Each S Λ

k

k Sk can be inverted similarly.

SΛy can also be computed recursively.

Visualising and forecasting big time series data

Fast computation tricks

39 - Fast computation: hierarchies

(S Λ

1

1S1)−1

0

· · ·

0

0

(S Λ

2

2S2)−1 · · ·

0

(SΛS)−1 =

.

.

.

.

−cS0

..

..

. .

..

0

0

· · · (S Λ

K

K SK )−1

S0 can be partitioned into K2 blocks, with the (k, )

block (of dimension nk × n ) being

The recursive calculations can be

(S Λ

k

k Sk )−1Jnk,n (S Λ S )−1

done in such a way that we never

Jnk,n is a nk × n matrix of ones.

store any of the large matrices

c−1 = λ−1 +

1 (S Λ

.

0

n

k Sk )−11n

involved.

k

k

k

k

Each S Λ

k

k Sk can be inverted similarly.

SΛy can also be computed recursively.

Visualising and forecasting big time series data

Fast computation tricks

39 - Fast computation

A similar algorithm has been developed for

grouped time series with two groups.

When the time series are not strictly

hierarchical and have more than two grouping

variables:

Use sparse matrix storage and arithmetic.

Use iterative approximation for inverting

large sparse matrices.

Paige & Saunders (1982)

ACM Trans. Math. Software

Visualising and forecasting big time series data

Fast computation tricks

40 - Fast computation

A similar algorithm has been developed for

grouped time series with two groups.

When the time series are not strictly

hierarchical and have more than two grouping

variables:

Use sparse matrix storage and arithmetic.

Use iterative approximation for inverting

large sparse matrices.

Paige & Saunders (1982)

ACM Trans. Math. Software

Visualising and forecasting big time series data

Fast computation tricks

40 - Fast computation

A similar algorithm has been developed for

grouped time series with two groups.

When the time series are not strictly

hierarchical and have more than two grouping

variables:

Use sparse matrix storage and arithmetic.

Use iterative approximation for inverting

large sparse matrices.

Paige & Saunders (1982)

ACM Trans. Math. Software

Visualising and forecasting big time series data

Fast computation tricks

40 - hts package for R

hts: Hierarchical and grouped time series

Methods for analysing and forecasting hierarchical and grouped

time series

Version:

4.5

Depends:

forecast (≥ 5.0), SparseM

Imports:

parallel, utils

Published:

2014-12-09

Author:

Rob J Hyndman, Earo Wang and Alan Lee

Maintainer:

Rob J Hyndman <Rob.Hyndman at monash.edu>

BugReports: https://github.com/robjhyndman/hts/issues

License:

GPL (≥ 2)

Visualising and forecasting big time series data

hts package for R

42 - Example using R

library(hts)

# bts is a matrix containing the bottom level time series

# nodes describes the hierarchical structure

y <- hts(bts, nodes=list(2, c(3,2)))

Visualising and forecasting big time series data

hts package for R

43 - Example using R

library(hts)

# bts is a matrix containing the bottom level time series

# nodes describes the hierarchical structure

y <- hts(bts, nodes=list(2, c(3,2)))

Total

A

B

AX

AY

AZ

BX

BY

Visualising and forecasting big time series data

hts package for R

43 - Example using R

library(hts)

# bts is a matrix containing the bottom level time series

# nodes describes the hierarchical structure

y <- hts(bts, nodes=list(2, c(3,2)))

# Forecast 10-step-ahead using WLS combination method

# ETS used for each series by default

fc <- forecast(y, h=10)

Visualising and forecasting big time series data

hts package for R

44 - forecast.gts function

Usage

forecast(object, h,

method = c("comb", "bu", "mo", "tdgsf", "tdgsa", "tdfp"),

fmethod = c("ets", "rw", "arima"),

weights = c("sd", "none", "nseries"),

positive = FALSE,

parallel = FALSE, num.cores = 2, ...)

Arguments

object

Hierarchical time series object of class gts.

h

Forecast horizon

method

Method for distributing forecasts within the hierarchy.

fmethod

Forecasting method to use

positive

If TRUE, forecasts are forced to be strictly positive

weights

Weights used for "optimal combination" method.

When

weights = "sd", it takes account of the standard deviation of

forecasts.

parallel

If TRUE, allow parallel processing

num.cores

If parallel = TRUE, specify how many cores are going to be

used

Visualising and forecasting big time series data

hts package for R

45 - References

RJ Hyndman, RA Ahmed, G Athanasopoulos, and

HL Shang (2011). “Optimal combination forecasts for

hierarchical time series”. Computational statistics &

data analysis 55(9), 2579–2589.

RJ Hyndman, AJ Lee, and E Wang (2014). Fast

computation of reconciled forecasts for hierarchical

and grouped time series. Working paper 17/14.

Department of Econometrics & Business Statistics,

Monash University

RJ Hyndman, AJ Lee, and E Wang (2014). hts:

Hierarchical and grouped time series.

cran.r-project.org/package=hts.

RJ Hyndman and G Athanasopoulos (2014).

Forecasting: principles and practice. OTexts.

OTexts.org/fpp/.

Visualising and forecasting big time series data

References

47 - References

RJ Hyndman, RA Ahmed, G Athanasopoulos, and

HL Shang (2011). “Optimal combination forecasts for

hierarchical time series”. Computational statistics &

data analysis 55(9), 2579–2589.

RJ Hyndman, AJ Lee, and E Wang (2014). Fast

computation of reconciled forecasts for hierarchical

and grouped time series. Working paper 17/14.

Department of Econometrics & Business Statistics,

Monash University

RJ Hyndman, AJ Lee, and E Wang (2014). hts:

Hierarchical and grouped time series.

➥ Papers and R code:

cran.r-project.org/package=hts.

RJ Hyndman and G Athanasopoulos

robjhyndman.com

(2014).

Forecasting: principles and practice. OTexts.

➥ Email: Rob.Hyndman@monash.edu

OTexts.org/fpp/.

Visualising and forecasting big time series data

References

47