Upcoming talks in California

I’m back in Cal­i­for­nia for the next cou­ple of weeks, and will give the fol­low­ing talk at Stan­ford and UC-​​Davis.

Optimal forecast reconciliation for big time series data

Time series can often be nat­u­rally dis­ag­gre­gated in a hier­ar­chi­cal or grouped struc­ture. For exam­ple, a man­u­fac­tur­ing com­pany can dis­ag­gre­gate total demand for their prod­ucts by coun­try of sale, retail out­let, prod­uct type, pack­age size, and so on. As a result, there can be mil­lions of indi­vid­ual time series to fore­cast at the most dis­ag­gre­gated level, plus addi­tional series to fore­cast at higher lev­els of aggregation.

A com­mon con­straint is that the dis­ag­gre­gated fore­casts need to add up to the fore­casts of the aggre­gated data. This is known as fore­cast rec­on­cil­i­a­tion. I will show that the opti­mal rec­on­cil­i­a­tion method involves fit­ting an ill-​​conditioned lin­ear regres­sion model where the design matrix has one col­umn for each of the series at the most dis­ag­gre­gated level. For prob­lems involv­ing huge num­bers of series, the model is impos­si­ble to esti­mate using stan­dard regres­sion algo­rithms. I will also dis­cuss some fast algo­rithms for imple­ment­ing this model that make it prac­ti­ca­ble for imple­ment­ing in busi­ness contexts.

Stan­ford: 4.30pm, Tues­day 6th Octo­ber.
UCDavis: 4:10pm, Thurs­day 8th October.

Mathematical annotations on R plots

I’ve always strug­gled with using plotmath via the expression func­tion in R for adding math­e­mat­i­cal nota­tion to axes or leg­ends. For some rea­son, the most obvi­ous way to write some­thing never seems to work for me and I end up using trial and error in a loop with far too many iterations.

So I am very happy to see the new latex2exp pack­age avail­able which trans­lates LaTeX expres­sions into a form suit­able for R graphs. This is going to save me time and frus­tra­tion! Con­tinue reading →

Useful tutorials

There are some tools that I use reg­u­larly, and I would like my research stu­dents and post-​​docs to learn them too. Here are some great online tuto­ri­als that might help.

R vs Autobox vs ForecastPro vs ...

Every now and then a com­mer­cial soft­ware ven­dor makes claims on social media about how their soft­ware is so much bet­ter than the fore­cast pack­age for R, but no details are provided.

There are lots of rea­sons why you might select a par­tic­u­lar soft­ware solu­tion, and R isn’t for every­one. But any­one claim­ing supe­ri­or­ity should at least pro­vide some evi­dence rather than make unsub­stan­ti­ated claims. Con­tinue reading →

Dark themes for writing

I spend much of my day sit­ting in front of a screen, cod­ing or writ­ing. To limit the strain on my eyes, I use a dark theme as much as pos­si­ble. That is, I write with light col­ored text on a dark back­ground. I don’t know why this is not the default in more soft­ware as it makes a big dif­fer­ence after a few hours of writing.

Most of the time, I am writ­ing using either Sub­lime Text, RStu­dio or TeX­studio. Each of them can be set to use a dark theme with syn­tax col­or­ing to high­light struc­tural fea­tures in the text.
Con­tinue reading →

Generating quantile forecasts in R

From today’s email:

I have just fin­ished read­ing a copy of ‘Forecasting:Principles and Prac­tice’ and I have found the book really inter­est­ing. I have par­tic­u­larly enjoyed the case stud­ies and focus on prac­ti­cal applications.

After fin­ish­ing the book I have joined a fore­cast­ing com­pe­ti­tion to put what I’ve learnt to the test. I do have a cou­ple of queries about the fore­cast­ing out­puts required. The out­put required is a quan­tile fore­cast, is this the same as pre­dic­tion inter­vals? Is there any R func­tion to pro­duce quan­tiles from 0 to 99?

If you were able to point me in the right direc­tion regard­ing the above it would be greatly appreciated.

Many Thanks,

Con­tinue reading →