Chapter 5 Other Software
This a brief summary of other available software to estimate state space models with a focus on R and python.
5.1 R packages
Tusell (2011) reviews R packages for state space models (as of 2011). Helske (2012) includes an more recent review of R packages implementing state space models.
- The stats package includes functions for univariate Kalman filtering and smoothing (
KalmanLike
,KalmanRun
,KalmanSmooth
,KalmanForecast
) which are used byStructTS
andarima
. - dse
- sspir
- dlm
KFAS
- dlmodeler - provides a unified interface to multiple packages
- rucm: structural time series
MARSS - maximum likelihood estimation of a large glass of Guassian state space models with an EM-algorithm
5.2 Other
The JSS Volume 41 (Commandeur, Koopman, and Ooms 2011) contains articles on state space implementations in multiple languages
- STAMP (Mendelssohn 2011)
- Ox/SsfPack (Pelagatti 2011)
- R (Petris and Petrone 2011)
- SsfPack in S+FinMetrics (Zivot 2011)
- Matlab (Peng and Aston 2011)
- FORTRAN (Bell 2011)
- eViews (Bossche 2011)
- RATS (Doan 2011)
- Stata (Drukker and Gates 2011)
- gretl (Lucchetti 2011)
- SAS (Selukar 2011)
- Ox (Bos 2011)
5.2.1 Stata
Stata’s timeseries capabilities includes the command ssmodels
to estimate general state space models, as well as common special cases: arima
(SARIMAX models), dfactor
(Dynamic Factor), and ucm
(Unobserved Components Models).
5.2.2 Python
The [statsmodels] module [statsmodels.tsa] contains functions and classes for time series analysis including autoregressive (AR), vector autoregressive (VAR), autoregressive moving avergage models (ARMA), and functions fo Kalman filtering. Currently the Kalman filter only handles the special univariate case for ARIMA.
The statsmodels module statsmodels.tsa.statespace contains more general state space code. The examples are very good.
An example of using statsmodels.tsa.statespace
and PyMC to simulate from the posterior of a state space model. See State Space Modeling in Python.
Strickland et al. (2014) introduce PySSM to simulate state space models using PyMCMC (not to be confused with the more popular PyMC).
Ansley, Craig F., and Robert Kohn. 1986. “A Note on Reparameterizing a Vector Autoregressive Moving Average Model to Enforce Stationarity.” Journal of Statistical Computation and Simulation 24 (2): 99–106. doi:10.1080/00949658608810893.
Bell, William. 2011. “REGCMPNT a Fortran Program for Regression Models with ARIMA Component Errors.” Journal of Statistical Software 41 (1): 1–23. doi:10.18637/jss.v041.i07.
Bos, Charles. 2011. “A Bayesian Analysis of Unobserved Component Models Using Ox.” Journal of Statistical Software 41 (1): 1–24. doi:10.18637/jss.v041.i13.
Bossche, Filip Van den. 2011. “Fitting State Space Models with EViews.” Journal of Statistical Software 41 (1): 1–16. doi:10.18637/jss.v041.i08.
Carter, R., C. K. And Kohn. 1994. “On Gibbs Sampling for State Space Models.” Biometrika 81 (3): 541–53. doi:10.1093/biomet/81.3.541.
Commandeur, Jacques J. F., Siem Jan Koopman, and Marius Ooms. 2011. “Statistical Software for State Space Methods.” Journal of Statistical Software 41 (1): 1–18. http://www.jstatsoft.org/v41/i01.
De Jong, Piet, and Neil Shephard. 1995. “The Simulation Smoother for Time Series Models.” Biometrika 82 (2): 339–50. doi:10.1093/biomet/82.2.339.
Doan, Thomas. 2011. “State Space Methods in RATS.” Journal of Statistical Software 41 (1): 1–16. doi:10.18637/jss.v041.i09.
Drukker, David, and Richard Gates. 2011. “State Space Methods in Stata.” Journal of Statistical Software 41 (1): 1–25. doi:10.18637/jss.v041.i10.
Durbin, J., and S. J. Koopman. 2002. “A Simple and Efficient Simulation Smoother for State Space Time Series Analysis.” Biometrika 89 (3). Biometrika Trust: 603–15. http://www.jstor.org/stable/4140605.
Durbin, J., and S.J. Koopman. 2012. Time Series Analysis by State Space Methods: Second Edition. Oxford Statistical Science Series. OUP Oxford. http://books.google.com/books?id=fOq39Zh0olQC.
Frühwirth-Schnatter, Sylvia. 1994. “Data Augmentation and Dynamic Linear Models.” Journal of Time Series Analysis 15 (2). Blackwell Publishing Ltd: 183–202. doi:10.1111/j.1467-9892.1994.tb00184.x.
Helske, Jouni. 2012. “KFAS: Kalman Filter and Smoother for Exponential Family State Space Models.” http://CRAN.R-project.org/package=KFAS.
Jones, M. C. 1987. “Randomly Choosing Parameters from the Stationarity and Invertibility Region of Autoregressive-Moving Average Models.” Journal of the Royal Statistical Society. Series C (Applied Statistics) 36 (2). [Wiley, Royal Statistical Society]: 134–38. http://www.jstor.org/stable/2347544.
Jones, Richard H. 1980. “Maximum Likelihood Fitting of ARMA Models to Time Series with Missing Observations.” Technometrics 22 (3). [Taylor & Francis, Ltd., American Statistical Association, American Society for Quality]: 389–95. http://www.jstor.org/stable/1268324.
Lucchetti, Riccardo. 2011. “State Space Methods in gretl.” Journal of Statistical Software 41 (1): 1–22. doi:10.18637/jss.v041.i11.
Mendelssohn, Roy. 2011. “The STAMP Software for State Space Models.” Journal of Statistical Software 41 (1): 1–18. doi:10.18637/jss.v041.i02.
Monahan, John F. 1984. “A Note on Enforcing Stationarity in Autoregressive-Moving Average Models.” Biometrika 71 (2): 403–4. doi:10.1093/biomet/71.2.403.
Pelagatti, Matteo. 2011. “State Space Methods in Ox/SsfPack.” Journal of Statistical Software 41 (1): 1–25. doi:10.18637/jss.v041.i03.
Peng, Jyh-Ying, and John Aston. 2011. “The State Space Models Toolbox for MATLAB.” Journal of Statistical Software 41 (1): 1–26. doi:10.18637/jss.v041.i06.
Petris, Giovanni, and Sonia Petrone. 2011. “State Space Models in R.” Journal of Statistical Software 41 (4): 1–25. http://www.jstatsoft.org/v41/i04.
Selukar, Rajesh. 2011. “State Space Modeling Using SAS.” Journal of Statistical Software 41 (1): 1–13. doi:10.18637/jss.v041.i12.
Strickland, Christopher, Robert Burdett, Kerrie Mengersen, and Robert Denham. 2014. “PySSM: A Python Module for Bayesian Inference of Linear Gaussian State Space Models.” Journal of Statistical Software 57 (1): 1–37. doi:10.18637/jss.v057.i06.
Tusell, Fernando. 2011. “Kalman Filtering in R.” Journal of Statistical Software 39 (2): 1–27. http://www.jstatsoft.org/v39/i02.
Zivot, Eric. 2011. “State Space Modeling Using SsfPack in S+FinMetrics 3.0.” Journal of Statistical Software 41 (1): 1–27. doi:10.18637/jss.v041.i05.
References
Tusell, Fernando. 2011. “Kalman Filtering in R.” Journal of Statistical Software 39 (2): 1–27. http://www.jstatsoft.org/v39/i02.
Helske, Jouni. 2012. “KFAS: Kalman Filter and Smoother for Exponential Family State Space Models.” http://CRAN.R-project.org/package=KFAS.
Commandeur, Jacques J. F., Siem Jan Koopman, and Marius Ooms. 2011. “Statistical Software for State Space Methods.” Journal of Statistical Software 41 (1): 1–18. http://www.jstatsoft.org/v41/i01.
Mendelssohn, Roy. 2011. “The STAMP Software for State Space Models.” Journal of Statistical Software 41 (1): 1–18. doi:10.18637/jss.v041.i02.
Pelagatti, Matteo. 2011. “State Space Methods in Ox/SsfPack.” Journal of Statistical Software 41 (1): 1–25. doi:10.18637/jss.v041.i03.
Petris, Giovanni, and Sonia Petrone. 2011. “State Space Models in R.” Journal of Statistical Software 41 (4): 1–25. http://www.jstatsoft.org/v41/i04.
Zivot, Eric. 2011. “State Space Modeling Using SsfPack in S+FinMetrics 3.0.” Journal of Statistical Software 41 (1): 1–27. doi:10.18637/jss.v041.i05.
Peng, Jyh-Ying, and John Aston. 2011. “The State Space Models Toolbox for MATLAB.” Journal of Statistical Software 41 (1): 1–26. doi:10.18637/jss.v041.i06.
Bell, William. 2011. “REGCMPNT a Fortran Program for Regression Models with ARIMA Component Errors.” Journal of Statistical Software 41 (1): 1–23. doi:10.18637/jss.v041.i07.
Bossche, Filip Van den. 2011. “Fitting State Space Models with EViews.” Journal of Statistical Software 41 (1): 1–16. doi:10.18637/jss.v041.i08.
Doan, Thomas. 2011. “State Space Methods in RATS.” Journal of Statistical Software 41 (1): 1–16. doi:10.18637/jss.v041.i09.
Drukker, David, and Richard Gates. 2011. “State Space Methods in Stata.” Journal of Statistical Software 41 (1): 1–25. doi:10.18637/jss.v041.i10.
Lucchetti, Riccardo. 2011. “State Space Methods in gretl.” Journal of Statistical Software 41 (1): 1–22. doi:10.18637/jss.v041.i11.
Selukar, Rajesh. 2011. “State Space Modeling Using SAS.” Journal of Statistical Software 41 (1): 1–13. doi:10.18637/jss.v041.i12.
Bos, Charles. 2011. “A Bayesian Analysis of Unobserved Component Models Using Ox.” Journal of Statistical Software 41 (1): 1–24. doi:10.18637/jss.v041.i13.
Strickland, Christopher, Robert Burdett, Kerrie Mengersen, and Robert Denham. 2014. “PySSM: A Python Module for Bayesian Inference of Linear Gaussian State Space Models.” Journal of Statistical Software 57 (1): 1–37. doi:10.18637/jss.v057.i06.