Toolbox Overview

The CAPTAIN Toolbox is a collection of Matlab functions for non-stationary time series analysis, forecasting and control. It is useful for system identification, signal extraction, interpolation, data-based mechanistic modelling and control of a wide range of linear and non-linear stochastic systems. The toolbox consists of three modules as follows:

TVPMOD: Time Variable Parameter (TVP) MODels. For the identification of unobserved components models, with a particular focus on state-dependent and time-variable parameter models (includes the popular dynamic harmonic regression model as a special case).

RIVSID: Refined Instrumental Variable (RIV) System Identification algorithms. For optimal RIV estimation of multiple-input, discrete-time and hybrid continuous-time Transfer Function models.

TDCONT: True Digital CONTrol (TDC). For multivariable, non-minimal state space control, including pole assignment and optimal design, and with backward shift and delta-operator options.

The toolbox is presently developed and tested for Matlab R2019a onwards (Captain v8.2 onwards), although some backwards compatibility is maintained through to Matlab 2014a (Captain v8.1).

Current Developers

Wlodek Tych and Peter C Young, Lancaster Environment Centre (LEC), Lancaster University, UK.

C James Taylor, Engineering Department, Lancaster University, Lancaster, UK.

Additional Co-Author

Diego J Pedregal, Castilla-La Mancha University, Ciudad Real, Spain.

Additional Contributors

Paul G. McKenna and Renata Romanowicz.

Getting Started & Handbooks

At present, the following handbooks can be downloaded:

Getting Started Guide (PDF) with installation instructions, brief background to the modelling approach and some Matlab examples.

Guide to TVPMOD (PDF) for Time Variable Parameter models.

The following two books provide much more background information about the algorithms, models and general approach, including numerous case study examples:

C. James Taylor, Arun Chotai and Peter C. Young, True Digital Control: Statistical Modelling and Non-Minimal State Space Design, John Wiley & Sons,  2013.

Peter C. Young, Recursive estimation and time series analysis: An introduction for the student and practitioner, Springer, 2012.

Toolbox Description

CAPTAIN is a Matlab compatible toolbox for non-stationary time series analysis and forecasting. Based around a powerful state-space framework, it extends Matlab to allow, in the most general case, for the identification of unobserved components models. Here, the time series is assumed to be composed of an additive or multiplicative combination of different components that have defined statistical characteristics but which cannot be observed directly. With Maximum Likelihood estimation of most models and the inclusion of several popular model forms, such as the Basic Structural Model and the Dynamic Linear Model, together with a standard set of data pre-processing, system identification and model validation tools, CAPTAIN is a wide-ranging package for signal processing and general time series analysis.

Uniquely, however, CAPTAIN focuses on Time Variable Parameter (TVP) models, where the stochastic evolution of each parameter is assumed to be described by a generalised random walk process. In this regard, the state-space formulation is particularly well suited to estimation based on optimal recursive estimation, in which the time variable parameters are estimated sequentially whilst working through the data in temporal order. In the off-line situation, where all the time series data are available for analysis, this Kalman filtering operation is accompanied by optimal recursive smoothing. Here the estimates obtained from the forward pass filtering algorithm are updated sequentially whilst working through the data in reverse temporal order using a backwards-recursive Fixed Interval Smoothing (FIS) algorithm.

In this manner, CAPTAIN provides novel tools for TVP analysis, allowing for the optimal estimation of dynamic regression models, including linear regression, auto-regression and harmonic regression. Furthermore, a closely related algorithm for State Dependent Parameter (SDP) estimation provides for the non-parametric identification and forecasting of a very wide class of nonlinear systems, including chaotic systems. The identification stage in this process again exploits the recursive smoothing algorithms, combined with special data re-ordering and back-fitting procedures, to obtain estimates of any state dependent parameter variations.

Of course, in many cases, specifying time invariant parameters for the model yields the equivalent, conventional, stationary model. In this regard, one model that has received special treatment in the toolbox is the multiple-input, single-output Transfer Function (TF) model. CAPTAIN includes functions for robust unbiased identification and estimation of both discrete-time and continuous-time TF models. One advantage of the TF model is its simplicity and ability to characterise the dominant modal behaviour of a dynamic system. This makes such a model an ideal basis for control system design. Hence, the toolbox also includes a set of functions for state variable feedback control design, based on the Proportional-Integral-Plus (PIP) control methodology.

Some of the estimation algorithms have been in constant use for over 30 years e.g. in the microCAPTAIN package for MS-DOS. However, the Matlab implementation is much more flexible and includes the latest innovations and improvements. The authors hope that the toolbox will allow interested researchers to add to the ever expanding list of successful applications, which already includes the analysis of numerous biological, environmental, engineering and socio-economic processes, as illustrated by some of the articles in the scientific literature that cite the following article (Taylor et al. 2007).


Taylor, C.J., Young, P.C., Tych, W., Wilson, E.D. (2018) New developments in the CAPTAIN Toolbox for Matlab with case study examples, 18th IFAC Symposium on System Identification (SYSID), Stockholm, Sweden. DOI:10.1016/j.ifacol.2018.09.202

Taylor, C.J., Pedregal, D.J., Young, P.C. and Tych, W. (2007) Environmental time series analysis and forecasting with the Captain toolbox, Environmental Modelling and Software, 22, pp. 797-814 (

Taylor, C.J. (2019) Citations to the CAPTAIN Toolbox, Research Note, Engineering Department, Lancaster University: download PDF.

See Google Scholar citations: