Hello again, A different but related question to my last one: Does anyone know if one can easily estimate state-space models using ML and the kalman filter using R? I would be especially interested in a relatively flexible function that would allow for estimation of hyperparameters, or could be made to do so. Thanks Michael J. Roberts Resource Economics Division, PMT USDA-ERS 202-654-5557 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Wednesday 08 November 2000 22:01, Michael Roberts wrote:> Does anyone know if one can easily estimate state-space models > using ML and the kalman filter using R? I would be especially > interested in a relatively flexible function that would allow for > estimation > of hyperparameters, or could be made to do so.I looked into this a bit ago and dropped it because of other deadlines, but all I could find was a small routine on Statlib, http://lib.stat.cmu.edu/S/kalman. It's not pretty and doesn't do ML for you, but maybe it's worth a start? Maybe over the holidays I'll get around to writing up something original. I've got a need to estimate the state evolution matrix in a big-dimensional problem myself. Of course, if you find anything that already works well... Good Luck, Elliot Williams (ewilliams at ucsd.edu) Economics Dept, UCSD San Diego, CA -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> > Hello again, > > A different but related question to my last one: > > Does anyone know if one can easily estimate state-space models > using ML and the kalman filter using R? I would be especially > interested in a relatively flexible function that would allow for > estimation > of hyperparameters, or could be made to do so.I have ported Richard Jones' CARMA to R. It uses state space modelling. It is in my growth library www.luc.ac.be/~jlindsey/rcode.html Jim> > Thanks > > Michael J. Roberts > Resource Economics Division, PMT > USDA-ERS > 202-654-5557 > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>Does anyone know if one can easily estimate state-space models >using ML and the kalman filter using R? I would be especially >interested in a relatively flexible function that would allow for >estimation of hyperparameters, or could be made to do so.My DSE library is on CRAN and a users guide is available at <http://www.bank-banque-canada.ca/pgilbert>. It handles multivariate ARMA and state-space models. Both the Kalman filter and the smoothed state estimates can be estimated by the state-space models. The ML estimation is (I believe) superficially broken at present but I hope to get a chance to fix it in a few weeks. I don't really recommend ML estimation of state-space models (at least not multivariate ones) because of know problems with convergence. This appears to be related to parameter effects cuvature. You will generally have much better luck doing ML estimation with the equivalent ARMA representation and then converting back to state-space form once you have convergence (if you really want a state-space model). The DSE library has methods for converting between representations. EM estimation would be relatively straight forward to implement but, after hearing Stoffer at a 1993 conference say he had switched back to ML because of poor performance of EM (for time series model estimation), I have been in no rush to do that. In any case, the convergence problems related to curvature would apply equally for EM estimation. With respect to hyperparameters, it depends on how much you care about the structure of the model. If you are happy with "black box" models then I would recommend a procedure I called "brute force technique" in a 1995 paper "Combining VAR Estimation and State Space Model Reduction for Simple Good Predictions" J. of Forecasting: Special Issue on VAR Modelling. 14:229-250. It is implemented in bft() in the DSE library. The technique results in a linear time-invariant model by a combination of VAR estimation and balanced state-space reduction using a technique of S. Mittnik. (BTW another reduction technique proposed by Aoki does not work.) Even though it uses VAR estimation the resulting state-space model may have only an ARMA equivalent (not a VAR equivalent) because the reduction attempts to find a parsimonious representation. I have studied lots of estimation techniques for multivariate time series models and bft is still my perferred starting point. You can do better, but you can do a lot worse. In addition to linear time-invariant ARMA and state-space models the DSE library implements many tools for doing multivariate time series modeling. In the S/R code I have not implemented time varying models (as in your first post) but there are many tools in the library that would help do that. There is, however, some overhead and I would not necessarily recommend it if you are only interested in univariate models. Paul Gilbert -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._