StateSpaceModels.jl is a Julia package for time-series analysis using state-space models.



Build Status Coverage Documentation
Build Status Codecov branch

StateSpaceModels.jl is a package for modeling, forecasting, and simulating time series in a state-space framework. Implementations were made based on the book "Time Series Analysis by State Space Methods" (2012) by James Durbin and Siem Jan Koopman. The notation of the variables in the code also follows the book.


This package is registered in METADATA so you can Pkg.add it as follows:

pkg> add StateSpaceModels


Current features:

  • Kalman filter and smoother
  • Square-root filter and smoother
  • Maximum likelihood estimation
  • Forecasting
  • Monte Carlo simulation
  • Multivariate modeling
  • User-defined models (input any Z, T, and R)
  • Several predefined models, including:
    1. Basic structural model (trend, slope, seasonal)
    2. Structural model with exogenous variables
    3. Linear trend model
    4. Local level model
  • Completion of missing values
  • Diagnostics for the residuals, including:
    1. Jarque-Bera test
    2. Ljung-Box test
    3. Homoscedasticity test

Planned features:

  • Univariate treatment of multivariate models

Citing StateSpaceModels.jl

If you use StateSpaceModels.jl in your work, we kindly ask you to cite the following paper (pdf):

title={StateSpaceModels.jl: a Julia Package for Time-Series Analysis in a State-Space Framework},
author={Raphael Saavedra and Guilherme Bodin and Mario Souto},
journal={arXiv preprint arXiv:1908.01757},



These plots were generated in the Nile river example.

Nile filtered state

Airline passengers

These plots were generated in the Airline passengers example.

Airline passengers

Vehicle tracking

This gif was generated in the Vehicle tracking example.

Vehicle tracking

First Commit


Last Touched

8 days ago


332 commits

Used By: