[R] State Space models in R

spencerg spencer.graves at prodsyse.com
Fri Sep 11 18:02:56 CEST 2009


Hi, Giovanni: 


      1.  I've used primarily "sspir" and "dlm".  There is apparently a 
new release of "sspir", which I have not used.  When I last tried 
"sspir", it did NOT have a forecast function, while "dlm" did.  The two 
packages have functions with the same name but incompatible code.  It 
would be good if the two were compatible, but unfortunately, I'm not in 
a position to volunteer to make them so. 


      2.  I'm very glad you are preparing such a review paper.  To check 
your lit search, you might try something like the following: 


library(sos)
ss <- ???"state space"
k <- ???"kalman"
sk <- ss|k
installPackages(sk)
writeFindFn2xls(sk)


      When I did this just now, it identified 272 help pages in 92 
packages matching either "state space" or "kalman".  In addition to the 
packages you mentioned, the following packages may also interest you:  
expsmooth, cts, KFAS, forecast, timsac, Stem, and deSolve;  these all 
have at least 6 help pages matching one of these terms.  The pomp 
package, with 5 matches, may also be of interest. 


      The "installPackages" command above only installed packages with 
at least 6 help pages in this example.  To extend this to 4, I used 
"installPackages(sk, 4)".  Then I deleted the "sk.xls" file in "getwd()" 
and reran "writeFindFn2xls(sk)" to get more information about packages 
with 5 and 4 matches. 

     
      To extend this search further, I added the following: 


dlm <- ???"dynamic linear model"
dlms <- ???"dynamic linear models"
dlsk <- sk|dlm|dlms
writeFindFn2xls(dlsk)


      This identified 320 help pages in 115 packages, but I don't know 
it added anything relevant to your question. 


      I created the "sos" package with help from Sundar Dorai-Raj and 
Romain Francois largely to help with this kind of search.  In seconds, 
it converted questions and insecurities about what relevant packages 
might be available into an embarrassment of riches.  An anonymous 
referee (or some other future reader) will be less likely to complain 
about something you've missed.  If it misses an important package, the 
package is either small or does not adequately match your search terms. 


      Hope this helps. 
      Spencer


Giovanni Petris wrote:
> Hello everybody,
>
> I am writing a review paper about State Space models in R, and I would
> like to cover as many packages as I reasonably can. 
>
> So far I am familiar with the following tools to deal with SS models:
>
> * StructTS, Kalman* (in stats)
> * packages dse[1-2] 
> * package sspir
> * package dlm
>
> I would like to have some input from users who work with SS models:
> are there any other packages for SS models that I am missing?, which
> package do you use and why?, what do you think are advantages/
> disadvantages of the package you use?
>
> Of course I do have my own preferences (biased, of course) and
> opinions about the different packages, but I would also like to
> summarize in my paper the feedback I get from the R community.
>
> Thank you in advance.
>
> Best,
> Giovanni Petris
>
>   


-- 
Spencer Graves, PE, PhD
President and Chief Operating Officer
Structure Inspection and Monitoring, Inc.
751 Emerson Ct.
San José, CA 95126
ph:  408-655-4567




More information about the R-help mailing list