11 thoughts on “The tsbugs package for R”

  1. Speechless! Anyway, well done mate.

    Happy new year Guy!

    Any plan to visit Southampton soon? Maybe then I can have a chance to be talked through some of the clever stuff you don’t stop doing. I’m getting closer to conduct my sensitivity analysis so expect more bugs from this end.

    Check you later,


    ________________________________ De : Guy Abel À : rkapend@yahoo.fr Envoyé le : Mardi 15 janvier 2013 16h26 Objet : [New post] tsbugs Package

    WordPress.com gjabel posted: “My tsbugs package has gone up on CRAN. The functions are aimed to automate the writing of time series models to run in WinBUGS or OpenBUGS. I created these functions a while back when I was doing some work on model averaging for time series models. I foun”

  2. I expected that the code for prediction to be:
    for(t in 98:107){
    y.new[t] ~ dnorm(y.mean[t], isigma2)
    and not the outcome code:

    for(t in 98:107){
    y.new[t] <- y[t]
    Is this a bug or I missed something?
    Thanks, great tool!


    1. I think that the likelihood for the forecast period (98-107) already has been made by this part:
      for(t in 3:107){
      y[t] ~ dnorm(y.mean[t], isigma2)

      Then the y values for the forecast period (98-107) are copied into a new variable y.new just to make it ieasier to plot the forecast separately using fan(ynew.pn).

    2. Thanks Pablo.

      I think our code for the forecasts are broadly equivalent. Both of our stochastic y.new[t] is generated from the same time dependent mean and variance as my y[t]. However, in the BUGS model I have only set up random nodes for future values once (in the first for loop of the BUGS script, where WinBUGS or OpenBUGS will see the NA’s in the data as missing) and then relabeled them in the forecast chunk of the BUGS code. This works, as using the ar.bugs function the data is modified to add on the right amount of NA’s at the end of the series so BUGS treats them as random nodes (in the top loop). You can see the data (that is used in the data argument on the R2OpenBUGS bugs command) by entering ar2$data into the R console. If I did not modify the data, then I would need a new loop for forecasted values (like the one you propose). Hope this makes sense?

  3. This is very useful package and less time consuming. I am interested in non-normal time series models like Poisson. Is there any plan to extend this package to handle such data.

  4. Awesome package! Is there an extension to the package to perform multivariate SV modeling? i.e., similar to the method described in Meyer & Yu (2006). Thank you!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: