A blog by Rob J Hyndman 

Twitter Gplus RSS

Posts Tagged ‘R’:


Blog aggregators

Published on 15 May 2012

A very use­ful way of keep­ing up with blogs in a par­tic­u­lar area is to sub­scribe to a blog aggre­ga­tor. These will syn­di­cate posts from a large num­ber of blogs and pro­vide links back to the orig­i­nal sources. So you only need to sub­scribe once to get all the good stuff in that area. There are now sev­eral blog aggre­ga­tors avail­able that might be of inter­est to read­ers here. And this blog is now syn­di­cated on sev­eral other sites includ­ing those listed below.

 
1 Comment  comments 

Measuring time series characteristics

Published on 2 May 2012

A few years ago, I was work­ing on a project where we mea­sured var­i­ous char­ac­ter­is­tics of a time series and used the infor­ma­tion to deter­mine what fore­cast­ing method to apply or how to clus­ter the time series into mean­ing­ful groups. The two main papers to come out of that project were: Wang, Smith and Hyn­d­man (2006) Characteristic-​​​​​​based clus­ter­ing for time series data. Data Min­ing and Knowl­edge Dis­cov­ery, 13(3), 335–364. Wang, Smith-​​​​Miles and Hyn­d­man (2009) “Rule induc­tion for fore­cast­ing method selec­tion: meta-​​​​​​learning the char­ac­ter­is­tics of uni­vari­ate time series”, Neu­ro­com­puting, 72, 2581–2594. I’ve since had a lot of requests for the code which one of my coau­thors has been help­fully email­ing to any­one who asked. But to make it eas­ier, we thought it might be help­ful if I post some updated code here. This is not the same as the R code we used in the paper, as I’ve improved it in sev­eral ways (so it will give dif­fer­ent results). If you just want the code, skip to the bot­tom of the post.

 
16 Comments  comments 

Forecasts and ggplot

Published on 23 March 2012

The fore­cast pack­age uses the base R graph­ics for all plots, but some peo­ple may pre­fer to use the nice graph­ics avail­able using the ggplot2 pack­age. In the fol­low­ing two posts, Frank Dav­en­port shows how it can be done: Plot­ting fore­cast() objects in ggplot part 1: Extract­ing the Data Plot­ting fore­cast() objects in ggplot part 2: Visu­al­ize Obser­va­tions, Fits, and Forecasts  

 
2 Comments  comments 

Data visualization

Published on 5 March 2012

For those who have not read the sem­i­nal works of Tufte and Cleve­land, please hang your heads in shame. To sal­vage some sense of self-​​​​worth, you can then head over to Solomon Messing’s blog where he is start­ing a series on data visu­al­iza­tion based on the prin­ci­ples devel­oped by Tufte and Cleve­land (with R exam­ples). The clas­sics are also worth read­ing, and remain rel­e­vant despite the 20 or 30 years that have elapsed since they appeared.

 
1 Comment  comments 

Exponential smoothing and regressors

Published on 28 February 2012

I have thought quite a lot about includ­ing regres­sors (i.e. covari­ates) in expo­nen­tial smooth­ing (ETS) mod­els, and I have done it a cou­ple of times in my pub­lished work. See my 2008 expo­nen­tial smooth­ing book (chap­ter 9) and my 2008 Tourism Man­age­ment paper. How­ever, there are some the­o­ret­i­cal issues with these approaches, which have come to light through the research of Ahmad Farid Osman, one of our PhD stu­dents at Monash Uni­ver­sity. Basi­cally, they are never fore­castable in the sense explained in Sec­tion 10.2 my 2008 book (fore­casta­bil­ity is the ETS equiv­a­lent of invert­ibil­ity in ARIMA mod­els). Osman has attempted to repair the prob­lem by propos­ing a dif­fer­ent for­mu­la­tion from those in the above ref­er­ences. The only pub­lic descrip­tion of his pro­posed model is given by Osman and King in this pre­sen­ta­tion – sorry, they do have a full paper explain­ing their approach, but it is not pub­licly avail­able.  How­ever, the model is much messier than the for­mu­la­tion we put in our book, and although it avoids the fore­casta­bil­ity issues, I think it is more dif­fi­cult to inter­pret. Still, it’s a good attempt at a tough prob­lem, and there’s noth­ing else around that’s any bet­ter. So don’t expect any code for fit­ting ETS mod­els with regres­sors to appear in the fore­cast pack­age

(More)…

 
No Comments  comments 

Internet surveys

Published on 19 January 2012

I received the fol­low­ing email today: I am prepar­ing a the­sis … I need to con­duct the widest pos­si­ble poll, and it occurred to me that per­haps you could guide me toward an internet-​​​​based way in which this can be done eas­ily. I have a ten-​​​​question ques­tion­naire pre­pared, that I wish to have an ran­dom sam­ple of the pop­u­la­tion respond to. I have no bud­get for this, so I hope you can sug­gest a way in which a good num­ber of responses can be har­vested using blogs or sites you may be aware of. Here is my response.

 
2 Comments  comments 

Forecasting time series using R

Published on 16 December 2011

I gave this talk on Fore­cast­ing time series using R for the Mel­bourne Users of R Net­work (Mel­bURN) on Thurs­day 27 Octo­ber 2011. Slides Exam­ples Abstract I look at the var­i­ous facil­i­ties for time series fore­cast­ing avail­able in R, con­cen­trat­ing on the fore­cast pack­age. This pack­age imple­ments sev­eral auto­matic meth­ods for fore­cast­ing time series includ­ing fore­casts from ARIMA mod­els, ARFIMA mod­els and expo­nen­tial smooth­ing mod­els. I also look more gen­er­ally at how to go about fore­cast­ing non-​​​​seasonal data, sea­sonal data, sea­sonal data with high fre­quency, and sea­sonal data with mul­ti­ple fre­quen­cies. Exam­ples are taken from my own con­sult­ing expe­ri­ence. I give an overview of what’s pos­si­ble and avail­able and where it is use­ful, rather than give the math­e­mat­i­cal details of any spe­cific time series methods.

 
No Comments  comments 

The art of R programming

Published on 30 November 2011

This is a gem of a book. It will become the book I give PhD stu­dents when they are learn­ing how to write good R code. That is, if I ever see it again. I had hoped to write a review of it, but I haven’t seen it since it arrived in the mail a cou­ple of weeks ago because a research stu­dent or research assis­tant has always had it on loan. I guess that’s a tes­ta­ment to how use­ful it is.

 
6 Comments  comments 

Kaggle on TV

Published on 29 November 2011

It is good to see fore­cast­ing algo­rithms get­ting some main­stream expo­sure on ABC Cat­a­lyst. Update: See also this great talk by Jeremy Howard, a data sci­en­tist from Mel­bourne and now part of Kaggle.

 
No Comments  comments 

What you wish you knew before you started a PhD

Published on 11 November 2011

I asked my research group recently what they wished they had learned before they started work on a PhD. Here are some of the responses.

 
5 Comments  comments