CRAN Task View: Time Series Analysis
|Maintainer:||Rob J. Hyndman|
|Contact:||Rob.Hyndman at monash.edu|
Base R ships with a lot of functionality useful for time series,
in particular in the stats package. This is complemented by many
packages on CRAN, which are briefly summarized below. There is also
a considerable overlap between the tools for time series and those
The packages in this view can be roughly
structured into the following topics. If you think that some package
is missing from the list, please let us know.
: Base R contains substantial infrastructure for representing and analyzing
time series data. The fundamental class is
represent regularly spaced time series (using numeric time stamps).
Hence, it is particularly well-suited for annual, monthly, quarterly
: Methods for analyzing and modeling time series include ARIMA models in
arima(), AR(p) and VAR(p) models in
structural models in
plot(), (partial) autocorrelation
decompose(), STL decomposition
stl(), moving average and autoregressive linear
filter(), and basic Holt-Winters forecasting in
Times and Dates
can only deal with numeric time stamps,
but many more classes are available for storing time/date information
and computing with it. For an overview see
R Help Desk: Date and
Time Classes in R
by Gabor Grothendieck and Thomas Petzoldt in
R News 4(1)
allow for more convenient computation with monthly
and quarterly observations, respectively.
from the base package is the basic class
for dealing with dates in daily data. The dates are internally stored
as the number of days since 1970-01-01.
package provides classes for
and date/time (intra-day) in
chron(). There is no
support for time zones and daylight savings time. Internally,
objects are (fractional) days since 1970-01-01.
the POSIX standard for date/time (intra-day) information and also support time zones
and daylight savings time. However, the time zone computations require
some care and might be system-dependent. Internally,
objects are the number of seconds since 1970-01-01 00:00:00 GMT.
provides functions that facilitate
certain POSIX-based computations.
is provided in the
package (previously: fCalendar). It is aimed at financial time/date information and deals with
time zones and daylight savings times via a new concept of "financial centers".
Internally, it stores all information in
all computations in GMT only. Calendar functionality, e.g., including
information about weekends and holidays for various stock exchanges,
is also included.
package provides the
class from the
facilitates computing with dates in terms of months.
provides functions for aggregation of incomplete time series data.
package includes methods for temporal disaggregation and interpolation of a low frequency time series to a higher frequency series.
extracts useful time components of a date object, such as day of week, weekend, holiday, day of month, etc, and put it in a data frame.
Time Series Classes
As mentioned above,
is the basic class for
regularly spaced time series using numeric time stamps.
package provides infrastructure for regularly
and irregularly spaced time series using arbitrary classes for
the time stamps (i.e., allowing all classes from the previous section).
It is designed to be as consistent as possible with
Coercion from and to
is available for all other
classes mentioned in this section.
is based on
uniform handling of R's different time-based data classes.
Various packages implement irregular time series based on
time stamps, intended especially for financial applications. These include
implements time series with
time series with
contains infrastructure for setting
time frames in different formats.
Forecasting and Univariate Modeling
provides a class and methods for univariate time series
forecasts, and provides many functions implementing different
forecasting models including all those in the stats
provides some basic models with partial optimization,
package provides a larger set of
models and facilities with full optimization.
in stats (with
model selection) and
for subset AR models.
in stats is the basic
function for ARIMA, SARIMA, ARIMAX, and subset ARIMA models.
It is enhanced in the
package via the function
package provides different algorithms for ARMA and subset ARMA
implements a fast MLE algorithm for ARMA models.
contains functionality for Generalized SARIMA time series
package handles multiplicative AR(1) with seasonal processes.
provides an interactive tutorial for Box-Jenkins modelling.
Periodic ARMA models
for periodic autoregressive time series models, and
for periodic ARMA modelling and other procedures for periodic time series analysis.
: Some facilities for fractional differenced ARFIMA
models are provided in the
has more advanced and general facilities for ARFIMA and ARIMA models, including dynamic
regression (transfer function) models.
handles estimation, diagnostics
and forecasting for ARFIMA models.
is an interface for ARIMA and ARFIMA models. Fractional Gaussian noise and simple models for
hyperbolic decay time series are handled in the
models are provided by the
function in the
package, and the
function in the
fits basic GARCH models,
implements ARIMA models with a wide class of GARCH innovations.
estimates a Bayesian GARCH(1,1) model with t innovations.
implements Generalized Orthogonal GARCH (GO-GARCH) models.
The R-Forge project
aims to provide a flexible and rich GARCH modelling
and testing environment including univariate and multivariate GARCH packages. Its
has extensive information and examples.
models are handled by
in a Bayesian framework.
contains methods for
linear time series analysis,
analysis of dynamic linear models,
series analysis and control, and
for time series BUGS models.
Spectral density estimation
is provided by
in the stats package, including the periodogram, smoothed periodogram and AR estimates. Bayesian spectral inference is provided by
includes methods to compute and plot Laplace periodograms for univariate time series.
provides Kolmogorov-Zurbenko Adaptive Filters including break detection, spectral analysis,
wavelets and KZ Fourier Transforms.
includes computing wavelet filters, wavelet transforms and
multiresolution analyses. Wavelet methods for time series
analysis based on Percival and Walden (2000) are given in
can be used to plot and
compute the wavelet spectra, cross-wavelet spectra, and wavelet
coherence of non-stationary time series. It also includes functions
to cluster time series based on the (dis)similarities in their spectrum.
Further wavelet methods can be found in the packages
Decomposition and Filtering
provides autoregressive and moving average linear filtering of
multiple univariate time series. The
package provides several robust time series filters, while
includes miscellaneous time series filters
useful for smoothing and extracting trend and cyclical
provides real-time signal extraction
(direct filter approach).
: Classical decomposition
is provided via
decompose(), more advanced and flexible
decomposition is available using
stl(), both from
the basic stats package.
Singular Spectrum Analysis
is implemented in
: the stats package provides classical
decompose(), and STL decomposition in
provides a wrapper for the
which have to be installed first.
provides a graphical user interface for
Analysis of seasonality
package provides methods for detecting and characterizing abrupt changes within the trend and seasonal components obtained from a decomposition.
estimates the peak-to-trough ratio of a seasonal component.
season: Seasonal analysis of health data including regression models, time-stratified case-crossover, plotting functions and residual checks.
seas: Seasonal analysis and graphics, especially for climatology.
deseasonalize: Optimal deseasonalization for geophysical time series using AR fitting.
Stationarity, Unit Roots, and Cointegration
Stationarity and unit roots
various stationarity and unit root tests including
Augmented Dickey-Fuller, Phillips-Perron, and KPSS. Alternative
implementations of the ADF and KPSS tests are in the
package, which also includes further methods
such as Elliott-Rothenberg-Stock, Schmidt-Phillips and Zivot-Andrews
package also provides the MacKinnon test.
provides implementations of both the standard ADF
and a covariate-augmented ADF (CADF) test.
: The Engle-Granger two-step method with the Phillips-Ouliaris
cointegration test is implemented in
The latter additionally contains functionality for the Johansen trace
and lambda-max tests.
provides Johansen's test and AIC/BIC simultaneous rank-lag selection.
provides tools to extract and plot common trends from a cointegration system.
Nonlinear Time Series Analysis
: Various forms of nonlinear
autoregression are available in
additive AR, neural nets, SETAR and LSTAR models, threshold VAR and VECM.
implements Bent-Cable autoregression.
provided algorithms for time series analysis from
nonlinear dynamical systems theory.
an R interface to the algorithms and
provides an R implementation of the algorithms.
: Various tests for nonlinearity are provided in
Dynamic Regression Models
Dynamic linear models
: A convenient interface for fitting
dynamic regression models via OLS is available in
an enhanced approach that also works with other regression functions
and more time series classes is implemented in
provides functions for fitting, analysing and forecasting generalized dynamic linear models.
package applies a dynamic variable selection procedure using an extension of the LARS
algorithm. More advanced dynamic system equations can be fitted using
dse. Gaussian linear state
space models can be fitted using
likelihood, Kalman filtering/smoothing and Bayesian methods).
models can be fitted using the
Multivariate Time Series Models
Vector autoregressive (VAR) models
are provided via
in the basic stats package including order
selection via the AIC. These models are
restricted to be stationary. Possibly non-stationary VAR models
are fitted in the
package, which also allows
VAR models in principal component space. More elaborate models
are provided in package
and a Bayesian approach is available in
uses fast implementations to estimate VAR models (possibly with
exogenous inputs and sparse coefficient matrices).
state space models
facilitates Monte Carlo experiments to
evaluate the associated estimation methods.
Vector error correction models
are available via the
packages, including versions with structural
constraints and thresholding.
Time series component analysis
: Time series factor analysis is provided in
implements forecatable component analysis by searching for the best linear transformations that make a multivariate time series as forecastable as possible.
Multivariate state space models
are implemented in the
(Fast Kalman Filter) package.
This provides relatively flexible state space models via the
parameters are allowed to be time-varying and intercepts are included in both equations.
An alternative implementation is provided by the
package which provides a
fast multivariate Kalman filter, smoother, simulation smoother and forecasting. Yet another implementation
is given in the
package which also contains tools for converting other multivariate models
into state space form.
fits constrained and unconstrained multivariate autoregressive state-space models using an EM algorithm. All four packages assume the observational and state error terms are uncorrelated.
Partially-observed Markov processes
are a generalization of the usual linear multivariate state
space models, allowing non-Gaussian and non-linear models. These are implemented in the
Continuous time models
Continuous time autoregressive modelling
is provided in
Continuous time ARMA model
estimation and simulation is available in
for time series bootstrapping,
including block bootstrap with several variants.
fast stationary and block bootstrapping.
Maximum entropy bootstrap for time series is available in
Time Series Data
Data from Makridakis, Wheelwright and Hyndman (1998)
Forecasting: methods and
are provided in the
Data from Hyndman, Koehler, Ord and Snyder (2008)
with exponential smoothing
are in the
Data from Hyndman and Athanasopoulos (2013)
Forecasting: principles and practice
are in the
Data from the M-competition and M3-competition are provided in the
Data from the Quandl online portal to financial, economical and social datasets can
be queried interactively using the
Data from the Datamarket online portal can be fetched using the
Data from Cryer and Chan (2010) are in the
Data from Shumway and Stoffer (2011) are in the
Data from Tsay (2005)
Analysis of financial
are in the
package, along with some functions and
script files required to work some of the examples.
provides a common interface to time series databases.
provides an interface for FAME time series databases
both contain many data sets (including time series data)
from many econometrics text books
dtw: Dynamic time warping algorithms for computing and plotting pairwise alignments between time series.
ensembleBMA: Bayesian Model Averaging to create probabilistic forecasts from ensemble forecasts and weather observations.
events: turns machine-extracted event data into regular aggregated multivariate time series.
fractalrock: Generate fractal time series with non-normal returns distribution.
GeneNet: Microarray time series and network analysis.
provide functions for analysing and modelling time series in hydrology and related environmental sciences.
makes hourly interpolation of daily minimum and maximum temperature series. It is useful in climatology when hourly time-series must be downscaled from the daily information.
provides tools for preparing ecological community time series data for multivariate AR modeling.
nets: routines for the estimation of sparse long run partial correlation networks for time series data.
paleoTS: Modeling evolution in paleontological time series.
pastecs: Regulation, decomposition and analysis of space-time series.
ptw: Parametric time warping.
PVAClone: Population growth models using data cloning.
is set of S3 and S4 functions for spatial multi-site stochastic generation of daily time-series of temperature and precipitation making use of VAR models. The package can be used in climatology and statistical hydrology.
RSEIS: Seismic time series analysis tools.
rts: Raster time series analysis (e.g., time series of satellite images).
sde: Simulation and inference for stochastic differential equations.
surveillance: Temporal and spatio-temporal modeling and monitoring of epidemic phenomena.
tiger: Temporally resolved groups of typical differences (errors) between two time series are determined and visualized.
wavethresh: Locally stationary wavelet models for nonstationary time series
(including estimation, plotting, and simulation functionality for time-varying spectrums).
wq: Exploring water quality time series.
provides weighted portmanteau statistics for time series goodness-of-fit testing.