A blog by Rob J Hyndman 

Twitter Gplus RSS

Help for forecasting practitioners

Published on 25 September 2011

I often get email from fore­cast­ers want­ing assis­tance. As much as I’d like to pro­vide a free fore­cast­ing advice ser­vice to the world, that’s not what I’m paid to do, and I choose to spend my unpaid time on other things. How­ever, there are some very help­ful resources avail­able for fore­cast­ing practitioners.

First, every prac­tic­ing fore­caster should be read­ing Fore­sight. It is far and away the best jour­nal or mag­a­zine for fore­cast prac­ti­tion­ers. Sub­scribe, read it, buy the back issues. You won’t be dis­ap­pointed. Please pass this on to every fore­caster you know.

Next, get on to Cross​Val​i​dated​.com. It is designed for peo­ple to ask ques­tions and there’s usu­ally some­one out there who might be able to answer. There’s also an active LinkedIn group for fore­cast­ing where some dis­cus­sion of fore­cast­ing issues takes place.

Attend the Inter­na­tional Fore­cast­ing Sym­po­sium. A mix of aca­d­e­mics and prac­ti­tion­ers attend, and it is a great oppor­tu­nity to find out what oth­ers are doing, and to learn some new tech­niques. The next one is in Boston in June 2012.

Also, get on the IIF email list. That way you will find out about meet­ings and activ­ity in the fore­cast­ing world.

Read the best books. I usu­ally rec­om­mend that prac­ti­tion­ers get hold of the fol­low­ing two books.

These books won first and sec­ond prizes, respec­tively, for the best fore­cast­ing books to be writ­ten dur­ing the first 25 years of the IIF. (Yes, I did co-​​author the sec­ond one so my rec­om­men­da­tion is biased.)

Finally, make sure you are using some decent soft­ware. The major­ity of ques­tions I’m asked are eas­ily solved by just get­ting hold of some good fore­cast­ing soft­ware. The best stand-​​alone fore­cast­ing pack­age I know of is Fore­cast­Pro. If you must use Excel (ugh), at least get a decent fore­cast­ing add-​​in such as Peer­Fore­caster. But best of all, learn R and use the fore­cast pack­age. If you are using the fore­cast pack­age for R, I may even be will­ing to pro­vide free help.


Related Posts:


 
Tags:
32 Comments  comments 
  • Ron Hulsey

    Hi Rob,

    I’m so happy I found your Web site. I was a demand man­ager who was recently laid-​​off and try­ing to start my own busi­ness. I need robust soft­ware with an “expert mod­eler” that an inde­pen­dent ser­vice provider could afford. Will “R” do this for me?

    Thanks for your help,

    Ron Hulsey MBA, CPIM, CPM
    Sales Fore­cast­ing Services

    • http://robjhyndman.com Rob J Hyndman

      Yes, R is very robust and pro­vides auto­matic fore­cast­ing for uni­vari­ate time series via the fore­cast pack­age. It will also do auto­matic model selec­tion for regres­sion using the step() func­tion. But you do have to learn the lan­guage. Click­ing and point­ing won’t get you far.

  • Ron Hulsey

    Rob, please give me a sen­tence on how I go about learn­ing the “lan­guage”? I could do the same thing Fore­cast Pro can do and it’s free?

    BTW what do you think about SPSS fore­cast­ing software?

  • Stephan Kolassa

    One teensy lit­tle point: AFAIK, if you sub­scribe to Fore­sight (or become a mem­ber of the IIF), you get access to the back issues in pdf for­mat, so Fore­sight is an even bet­ter deal! Sub­scribe today!

    Oh yes, I should prob­a­bly men­tion here that I’m an Asso­ciate Edi­tor, so I might be biased…

  • test

    Hi Rob,

    Thanks for the won­der­ful fore­cast pack­age. I have a ques­tion about it. I would like to use the auto.arima method in the fore­cast pack­age to gen­er­ate a model. I would like to store the coef­fi­cients (e.g. ma1, sma1 etc.) gen­er­ated by the algo­rithm and use that in a java pro­gram to pre­dict the value at any given time. What equa­tion can I use to do the same? Thanks for your help.

    • http://robjhyndman.com Rob J Hyndman

      The coef­fi­cients are stored in the object returned by auto.arima(). Use attrib­utes() to see what is stored.

  • David

    Hey Rob,

    I’m work­ing on a TS project for my time series course at UCSB. I am mod­el­ing the price of gold. Using the auto.arima() func­tion in the Fore­cast pack­age, I get a arima (2,0,3) model but the data is def­i­nitely in need of log trans­for­ma­tion (accord­ing to box-​​cox) and order 2 differencing.

    When I run auto.arima on the logged and dif­fer­enced data, I get an error mes­sage say­ing that MLE could not be com­puted and the model returned has a sea­sonal com­po­nent, even though I’ve already dif­fer­enced by 12.

    Do you have any sug­ges­tions? I’m draw­ing blanks here.

    • http://robjhyndman.com Rob J Hyndman

      auto.arima() does not do trans­for­ma­tions for you. If it needs a log trans­for­ma­tion, you need to do that your­self first.

      The selec­tion of the order of dif­fer­enc­ing is pretty good in auto.arima() assum­ing any log trans­for­ma­tion has already been done. Why do you think it should have order 2 differencing?

      It sounds like you have monthly price data and you think it has a monthly sea­son­al­ity. That would be very unlikely. If gold price data has sea­son­al­ity, then sen­si­ble peo­ple would exploit it by buy­ing in the trough and sell­ing at the peak. The effi­cient mar­ket hypoth­e­sis means that the sea­son­al­ity would get removed.

      If you really have sea­sonal data, then dif­fer­enc­ing does not nec­es­sar­ily remove all sea­son­al­ity. It only takes out the sea­sonal unit root.

  • Richard Scherer

    I am try­ing to do an a series of out-​​of-​​sample forecast,i.e. a rolling regres­sion of the pred­i­tions uti­liz­ing the pack­age Fore­cast.
    The goal is to use a model, such as ets to make a pre­dic­tion on a series in a ts for­mat , the series fore­casted is a sub­set of S.ts, S.ts starts at 1(1st obser­va­tion) and runs through obser­va­tion #3000. The Start =st, the fore­cast width(length of subset)=wd. Each time a fore­cast is made, I want to export that fore­cast to Excel and move for­ward St+i, where i might run from 1 to 100; and make a new fore­cast, and so on.
    As I am not much of a pro­gram­mer, I had thought to cre­ate a func­tion, and then a loop rou­tine. Unfor­tu­nately, I can’t get my func­tion to work. the parts of the func­tion work, s is sim­ply the daily close of the S&P500 ori­en­tated ETF SPY.
    I first read in S.ts, give st and wd a value
    and hoped that if I entered some­thing like :
    source(“Desktop/etspred.R”)
    s.pred<-etspred.R()
    that I would see a pre­dic­tion printed out.….
    I would appre­ci­ate any help, sug­ges­tions, alter­na­tives for accom­plish­ing the same goal,etc
    Thanks

    Ets.pred<- function(fore)
    {
    s<-window(s.ts,start=st, end=st+wd)
    tsp<-BoxCox(s,lambda=l)
    tsp.ets <- ets(tsp)
    ftsp.ets <- forecast.ets(tsp.ets,h=6)
    fftsp=(ftsp.ets$mean)
    fsp <- InvBoxCox(fftsp, lambda=l)
    print(fsp)
    }

    • http://robjhyndman.com Rob J Hyndman

      Your func­tion is strange. You pass fore as an argu­ment, but never use it, and you refer to lots of objects that are not passed as argu­ments. Then you print some­thing but never return the result. Try read­ing a book on R pro­gram­ming before doing any­thing else.

      Also, if you want to port results to Excel, use the write.csv() func­tion rather than cut and paste from the screen.

  • Emma

    Hi Rob,
    I started using the R fore­cast pack­age a month ago and have found the vari­ety of time series mod­els extremely use­ful. I’m cur­rently using the dshw func­tion on daily data and won­dered if I could ask for your advice.

    I’ve pro­duced a good fore­cast using dshw(x,6,24) where x is a time series with fre­quency 6 (rep­re­sent­ing a 6 day work­ing week with every Sun­day excluded). How­ever, I have had dif­fi­culty using the func­tion when the time series has an odd num­ber of work­ing days (e.g. 5 or 7) and I get the fol­low­ing error when run­ning dshw (e.g. on dshw(x,7,28)):

    Error in optim(start, dshw.mse, y = y, period1 = period1, period2 = period2, : func­tion can­not be eval­u­ated at ini­tial parameters”.

    Can I change any of the other default dshw argu­ments to resolve this?

    • http://robjhyndman.com Rob J Hyndman

      This is now fixed in the lat­est ver­sion of the fore­cast pack­age. Thanks for the bug report.

      • Christy

        Hi Rob,

        I have the most recent ver­sion of R (2.14) and the fore­cast pack­age (3.13).  I am get­ting the error stated above.  My time series has 37,000 + data points and sea­sonal peri­ods of 96 and 672.  Do you have any ideas what might be caus­ing this?

        Thanks for any infor­ma­tion you can pro­vide on this.

        • http://robjhyndman.com Rob J Hyndman

          Are you sure it’s the same error? I can’t repro­duce the prob­lem with your specs. I did, how­ever, find a new prob­lem when your time series is not a ts object. I’ll fix that in the next release. The fol­low­ing works for me:

          x <- ts(rnorm(37000),f=96)
          fit <- dshw(x,96,672,alpha=0.2,beta=0.1,
             gamma=0.05,omega=0.05, phi=0.5)

          (I’m spec­i­fy­ing the para­me­ters to speed up the exam­ple.)  Does that work for you too? (I don’t mean does it give good fore­casts as it won’t with those para­me­ters. But does it process with­out an error?)

          • Christy

            Yes I am sure it is the same error, and yes the exam­ple of above does work with out an error.  I have found that if I add 100 to each data point I am able to esti­mate the fore­cast using the dshw function.

          • http://robjhyndman.com Rob J Hyndman

            Can you please pro­vide a min­i­mal­ist exam­ple so I can repli­cate the error.

          • http://robjhyndman.com Rob J Hyndman

            Hi Christy. Thanks for the email with the data. The prob­lem is that dshw() assumes mul­ti­plica­tive sea­son­al­ity which is not suit­able for data con­tain­ing zeros. The error mes­sage wasn’t very infor­ma­tive, so I’ll fix that in the next release (3.14). By adding 100 (or even 0.1) to all obser­va­tions, they are then all pos­i­tive and so the model fits ok.

          • Christy

            Thanks for all of your help!

  • Jon

    Hi Rob

    I have just got into the area — are there any peo­ple you would rec­om­mend to fol­low on Twit­ter or any other blogs to keep abreast of the field pleaase?

    Thanks

    Jon

    • Rob J Hyndman

      One site I missed that is a very use­ful blog aggre­ga­tor is the Applied Fore­cast­ing por­tal. I find Twit­ter less use­ful for keep­ing up with fore­cast­ing developments.

      • Jon

        Thanks Rob

  • neff

    Hi Rob

    I have any ques­tion about using fore­cast pack­age for R in java pro­gram. Iwant to store result of fore­cast in an array. This is my code, it can’t stop run­ning and I get­ting error mas­sage.
    What can I do to store it? Thanks for your help.
    ================================================
    pub­lic class Arima {

                    pub­lic sta­tic void
    main(String[] args) {

                                    Rengine re = new Rengine(Rargs, false,
    null);

                                    System.out.println(“Rengine cre­ated,
    wait­ing for R”);

                                    if (!re.waitForR()) {

                                    System.out.println(“Cannot load
    R”);

                                    return;

                                    }

                                    re.eval(“library(forecast);”);

                                    re.eval(“data<-scan(‘D:/timeseries.txt’,skip=1);”);

                                    re.eval(“datats<-data;”);

                                    /​/​
    I use auto.arima func­tion to fore­cast my data for 12 peri­ods. but the  
                                    /​/​ default period  of fore­cast
    result is ten period. How can I set to get it? 

                                    re.eval(“arima<-auto.arima(datats);”);

                                    re.eval(“fcast<-forecast(arima);”);

                                    REXP fs =
    re.eval(“summary(fcast);”);

                                    /​/​
    I want to get result of fore­cast and returned it at an array

                                    dou­ble[] fore­cast = fs.asDoubleArray();

                                    for(int i=0; i<forecast.length; i++)

                                    System.out.println(forecast[i]);

                    re.end();

                    }

    }

  • neff

    Hi Rob

    I have any ques­tion about using fore­cast pack­age for R in java pro­gram. Iwant to store result of fore­cast in an array. This is my code, it can’t stop run­ning and I get­ting error mas­sage.
    What can I do to store it? Thanks for your help.
    ================================================
    pub­lic class Arima {

                    pub­lic sta­tic void
    main(String[] args) {

                                    Rengine re = new Rengine(Rargs, false,
    null);

                                    System.out.println(“Rengine cre­ated,
    wait­ing for R”);

                                    if (!re.waitForR()) {

                                    System.out.println(“Cannot load
    R”);

                                    return;

                                    }

                                    re.eval(“library(forecast);”);

                                    re.eval(“data<-scan(‘D:/timeseries.txt’,skip=1);”);

                                    re.eval(“datats<-data;”);

                                    /​/​
    I use auto.arima func­tion to fore­cast my data for 12 peri­ods. but the  
                                    /​/​ default period  of fore­cast
    result is ten period. How can I set to get it? 

                                    re.eval(“arima<-auto.arima(datats);”);

                                    re.eval(“fcast<-forecast(arima);”);

                                    REXP fs =
    re.eval(“summary(fcast);”);

                                    /​/​
    I want to get result of fore­cast and returned it at an array

                                    dou­ble[] fore­cast = fs.asDoubleArray();

                                    for(int i=0; i<forecast.length; i++)

                                    System.out.println(forecast[i]);

                    re.end();

                    }

    }

    • http://robjhyndman.com Rob J Hyndman

      Sorry, I don’t know java. Maybe some read­ers could help. Oth­er­wise try on stack​over​flow​.com

  • Dje Omaru

    Hi Rob,
    please how can we get the estimeted para­me­ters from dshw
    for exam­ple:
    fcast <- dshw(taylor)
    we have a fore­cast val­ues but what about esti­mated para­me­ters.
    Thanks for any infor­ma­tion you can pro­vide on this. 

    • http://robjhyndman.com Rob J Hyndman

      fcast$model

      • Dje Omaru

        Thanks  very much

        • Dje Omaru

          Please I have another ques­tion, is there a method to apply dou­ble sea­sonal arima for tay­lor series.
          Thanks for your help.

      • Dje Omaru

        Please I have another ques­tion, is there a method to apply a dou­ble sea­sonal arima for tay­lor serie.
        Thanks for your help.

        • http://robjhyndman.com Rob J Hyndman

          I don’t know of any pack­age in R for han­dling mul­ti­ple sea­son­al­ity in ARIMA models.

          • Dje Omaru

            Thank you, it’s a shame that his does not exist.