Time series
In
A time series is very frequently plotted via a
Time series analysis comprises methods for analyzing time series data in order to extract meaningful statistics and other characteristics of the data. Time series forecasting is the use of a
Time series data have a natural temporal ordering. This makes time series analysis distinct from
Time series analysis can be applied to real-valued, continuous data, discrete numeric data, or discrete symbolic data (i.e. sequences of characters, such as letters and words in the English language[1]).
Methods for analysis
Methods for time series analysis may be divided into two classes:
Additionally, time series analysis techniques may be divided into
Methods of time series analysis may also be divided into
Panel data
A time series is one type of panel data. Panel data is the general class, a multidimensional data set, whereas a time series data set is a one-dimensional panel (as is a cross-sectional dataset). A data set may exhibit characteristics of both panel data and time series data. One way to tell is to ask what makes one data record unique from the other records. If the answer is the time data field, then this is a time series data set candidate. If determining a unique record requires a time data field and an additional identifier which is unrelated to time (e.g. student ID, stock symbol, country code), then it is panel data candidate. If the differentiation lies on the non-time identifier, then the data set is a cross-sectional data set candidate.
Analysis
There are several types of motivation and data analysis available for time series which are appropriate for different purposes.
Motivation
In the context of
Exploratory analysis
A straightforward way to examine a regular time series is manually with a line chart. An example chart is shown on the right for tuberculosis incidence in the United States, made with a spreadsheet program. The number of cases was standardized to a rate per 100,000 and the percent change per year in this rate was calculated. The nearly steadily dropping line shows that the TB incidence was decreasing in most years, but the percent change in this rate varied by as much as +/- 10%, with 'surges' in 1975 and around the early 1990s. The use of both vertical axes allows the comparison of two time series in one graphic.
A study of corporate data analysts found two challenges to exploratory time series analysis: discovering the shape of interesting patterns, and finding an explanation for these patterns.[7] Visual tools that represent time series data as heat map matrices can help overcome these challenges.
Other techniques include:
- serial dependence
- Spectral analysis to examine cyclic behavior which need not be related to seasonality. For example, sunspot activity varies over 11 year cycles.[8][9]Other common examples include celestial phenomena, weather patterns, neural activity, commodity prices, and economic activity.
- Separation into components representing trend, seasonality, slow and fast variation, and cyclical irregularity: see trend estimation and decomposition of time series
Curve fitting
Curve fitting[10][11] is the process of constructing a curve, or mathematical function, that has the best fit to a series of data points,[12] possibly subject to constraints.[13][14] Curve fitting can involve either interpolation,[15][16] where an exact fit to the data is required, or smoothing,[17][18] in which a "smooth" function is constructed that approximately fits the data. A related topic is regression analysis,[19][20] which focuses more on questions of statistical inference such as how much uncertainty is present in a curve that is fit to data observed with random errors. Fitted curves can be used as an aid for data visualization,[21][22] to infer values of a function where no data are available,[23] and to summarize the relationships among two or more variables.[24] Extrapolation refers to the use of a fitted curve beyond the range of the observed data,[25] and is subject to a degree of uncertainty[26] since it may reflect the method used to construct the curve as much as it reflects the observed data.
For processes that are expected to generally grow in magnitude one of the curves in the graphic at right (and many others) can be fitted by estimating their parameters.
The construction of economic time series involves the estimation of some components for some dates by interpolation between values ("benchmarks") for earlier and later dates. Interpolation is estimation of an unknown quantity between two known quantities (historical data), or drawing conclusions about missing information from the available information ("reading between the lines").[27] Interpolation is useful where the data surrounding the missing data is available and its trend, seasonality, and longer-term cycles are known. This is often done by using a related series known for all relevant dates.[28] Alternatively polynomial interpolation or spline interpolation is used where piecewise polynomial functions are fit into time intervals such that they fit smoothly together. A different problem which is closely related to interpolation is the approximation of a complicated function by a simple function (also called regression). The main difference between regression and interpolation is that polynomial regression gives a single polynomial that models the entire data set. Spline interpolation, however, yield a piecewise continuous function composed of many polynomials to model the data set.
Extrapolation is the process of estimating, beyond the original observation range, the value of a variable on the basis of its relationship with another variable. It is similar to interpolation, which produces estimates between known observations, but extrapolation is subject to greater uncertainty and a higher risk of producing meaningless results.
Function approximation
In general, a function approximation problem asks us to select a function among a well-defined class that closely matches ("approximates") a target function in a task-specific way. One can distinguish two major classes of function approximation problems: First, for known target functions,
Second, the target function, call it g, may be unknown; instead of an explicit formula, only a set of points (a time series) of the form (x, g(x)) is provided. Depending on the structure of the domain and codomain of g, several techniques for approximating g may be applicable. For example, if g is an operation on the real numbers, techniques of interpolation, extrapolation, regression analysis, and curve fitting can be used. If the codomain (range or target set) of g is a finite set, one is dealing with a classification problem instead. A related problem of online time series approximation[29] is to summarize the data in one-pass and construct an approximate representation that can support a variety of time series queries with bounds on worst-case error.
To some extent, the different problems (regression, classification, fitness approximation) have received a unified treatment in statistical learning theory, where they are viewed as supervised learning problems.
Prediction and forecasting
In
- Fully formed statistical models for stochastic simulation purposes, so as to generate alternative versions of the time series, representing what might happen over non-specific time-periods in the future
- Simple or fully formed statistical models to describe the likely outcome of the time series in the immediate future, given knowledge of the most recent outcomes (forecasting).
- Forecasting on time series is usually done using automated statistical software packages and programming languages, such as Julia, Python, R, SAS, SPSS and many others.
- Forecasting on large scale data can be done with Apache Spark using the Spark-TS library, a third-party package.[30]
Classification
Assigning time series pattern to a specific category, for example identify a word based on series of hand movements in sign language.
Signal estimation
This approach is based on harmonic analysis and filtering of signals in the frequency domain using the Fourier transform, and spectral density estimation, the development of which was significantly accelerated during World War II by mathematician Norbert Wiener, electrical engineers Rudolf E. Kálmán, Dennis Gabor and others for filtering signals from noise and predicting signal values at a certain point in time. See Kalman filter, Estimation theory, and Digital signal processing
Segmentation
Splitting a time-series into a sequence of segments. It is often the case that a time-series can be represented as a sequence of individual segments, each with its own characteristic properties. For example, the audio signal from a conference call can be partitioned into pieces corresponding to the times during which each person was speaking. In time-series segmentation, the goal is to identify the segment boundary points in the time-series, and to characterize the dynamical properties associated with each segment. One can approach this problem using change-point detection, or by modeling the time-series as a more sophisticated system, such as a Markov jump linear system.
Clustering
Time series data may be clustered, however special care has to be taken when considering subsequence clustering.[31] Time series clustering may be split into
- whole time series clustering (multiple time series for which to find a cluster)
- subsequence time series clustering (single timeseries, split into chunks using sliding windows)
- time point clustering
Subsequence time series clustering
Subsequence time series clustering resulted in unstable (random) clusters induced by the feature extraction using chunking with sliding windows.[32] It was found that the cluster centers (the average of the time series in a cluster - also a time series) follow an arbitrarily shifted sine pattern (regardless of the dataset, even on realizations of a random walk). This means that the found cluster centers are non-descriptive for the dataset because the cluster centers are always nonrepresentative sine waves.
Models
Models for time series data can have many forms and represent different
Non-linear dependence of the level of a series on previous data points is of interest, partly because of the possibility of producing a chaotic time series. However, more importantly, empirical investigations can indicate the advantage of using predictions derived from non-linear models, over those from linear models, as for example in nonlinear autoregressive exogenous models. Further references on nonlinear time series analysis: (Kantz and Schreiber),[34] and (Abarbanel)[35]
Among other types of non-linear time series models, there are models to represent the changes of variance over time (
In recent work on model-free analyses, wavelet transform based methods (for example locally stationary wavelets and wavelet decomposed neural networks) have gained favor. Multiscale (often referred to as multiresolution) techniques decompose a given time series, attempting to illustrate time dependence at multiple scales. See also Markov switching multifractal (MSMF) techniques for modeling volatility evolution.
A hidden Markov model (HMM) is a statistical Markov model in which the system being modeled is assumed to be a Markov process with unobserved (hidden) states. An HMM can be considered as the simplest dynamic Bayesian network. HMM models are widely used in speech recognition, for translating a time series of spoken words into text.
Many of these models are collected in the python package sktime.
Notation
A number of different notations are in use for time-series analysis. A common notation specifying a time series X that is indexed by the natural numbers is written
- X = (X1, X2, ...).
Another common notation is
- Y = (Yt: t ∈ T),
where T is the index set.
Conditions
There are two sets of conditions under which much of the theory is built:
Ergodicity implies stationarity, but the converse is not necessarily the case. Stationarity is usually classified into
In addition, time-series analysis can be applied where the series are
Tools
Tools for investigating time-series data include:
- Consideration of the cross-correlation functionsand cross-spectral density functions)
- Scaled cross- and auto-correlation functions to remove contributions of slow components[37]
- Performing a Fourier transform to investigate the series in the frequency domain
- Discrete, continuous or mixed spectra of time series, depending on whether the time series contains a (generalized) harmonic signal or not
- Use of a noise
- empirical orthogonal functionanalysis)
- Singular spectrum analysis
- "Structural" models:
- General state space models
- Unobserved components models
- General
- Machine learning
- Queueing theory analysis
- Control chart
- Detrended fluctuation analysis
- Nonlinear mixed-effects modeling
- Dynamic time warping[38]
- Dynamic Bayesian network
- Time-frequency analysis techniques:
- Chaotic analysis
Measures
Time-series metrics or
- Univariate linear measures
- Moment (mathematics)
- Spectral band power
- Spectral edge frequency
- Accumulated energy (signal processing)
- Characteristics of the autocorrelation function
- Hjorth parameters
- FFT parameters
- Autoregressive model parameters
- Mann–Kendall test
- Univariate non-linear measures
- Measures based on the correlation sum
- Correlation dimension
- Correlation integral
- Correlation density
- Correlation entropy
- Approximate entropy[40]
- Sample entropy
- Fourier entropyuk
- Wavelet entropy
- Dispersion entropy
- Fluctuation dispersion entropy
- Rényi entropy
- Higher-order methods
- Marginal predictability
- Dynamical similarity index
- State spacedissimilarity measures
- Lyapunov exponent
- Permutation methods
- Local flow
- Other univariate measures
- Algorithmic complexity
- Kolmogorov complexity estimates
- Hidden Markov model states
- Rough path signature[41]
- Surrogate time series and surrogate correction
- Loss of recurrence (degree of non-stationarity)
- Bivariate linear measures
- Maximum linear cross-correlation
- Linear Coherence (signal processing)
- Bivariate non-linear measures
- Non-linear interdependence
- Dynamical Entrainment (physics)
- Measures for phase synchronization
- Measures for phase locking
- Similarity measures:[42]
- Cross-correlation
- Dynamic time warping[38]
- Hidden Markov model
- Edit distance
- Total correlation
- Newey–West estimator
- Prais–Winsten transformation
- Data as vectors in a metrizable space
- Data as time series with envelopes
- Global standard deviation
- Local standard deviation
- Windowed standard deviation
- Data interpreted as stochastic series
- Pearson product-moment correlation coefficient
- Spearman's rank correlation coefficient
- Data interpreted as a probability distribution function
Visualization
Time series can be visualized with two categories of chart: Overlapping Charts and Separated Charts. Overlapping Charts display all-time series on the same layout while Separated Charts presents them on different layouts (but aligned for comparison purpose)[43]
Overlapping charts
- Braided graphs
- Line charts
- Slope graphs
- GapChartfr
Separated charts
- Horizon graphs
- Reduced line chart (small multiples)
- Silhouette graph
- Circular silhouette graph
See also
- Anomaly time series
- Chirp
- Decomposition of time series
- Detrended fluctuation analysis
- Digital signal processing
- Distributed lag
- Estimation theory
- Forecasting
- Frequency spectrum
- Hurst exponent
- Least-squares spectral analysis
- Monte Carlo method
- Panel analysis
- Random walk
- Scaled correlation
- Seasonal adjustment
- Sequence analysis
- Signal processing
- Time series database (TSDB)
- Trend estimation
- Unevenly spaced time series
References
- S2CID 6084733.
- S2CID 8973749.
- S2CID 158707.
- ISBN 1-58113-567-X.
- S2CID 16748451.
- PMID 34573792.
- S2CID 9787931.
- ISBN 978-0-471-08256-9.[page needed]
- ISBN 978-0-13-041500-4.[page needed]
- ISBN 978-0-8493-0143-8.[page needed]
- ISBN 978-0-943494-02-9.[page needed]
- ISBN 978-0-306-43997-1.
functions are fulfilled if we have a good to moderate fit for the observed data.
- ^ The Signal and the Noise: Why So Many Predictions Fail-but Some Don't. By Nate Silver
- ISBN 978-1-55860-529-9.[page needed]
- ^ Numerical Methods in Engineering with MATLAB®. By Jaan Kiusalaas. Page 24.
- ISBN 978-1-139-62058-1.
- ISBN 978-1-107-64695-7.
- ^ See also: Mollifier
- ISBN 978-0-19-803834-4.[page needed]
- ^ Regression Analysis By Rudolf J. Freund, William J. Wilson, Ping Sa. Page 269.[date missing]
- ISBN 978-3-642-05035-0.
- ISBN 978-1-4020-9920-5.
- ISBN 978-0-12-475913-8.
- ISBN 978-1-4129-6127-1.
- ISBN 978-0-7425-7440-3.
- DTIC ADA316839.
- ISBN 978-0-486-13482-6.[page needed]
- .
- S2CID 16072352.
- ^ Sandy Ryza (2020-03-18). "Time Series Analysis with Spark" (slides of a talk at Spark Summit East 2016). Databricks. Retrieved 2021-01-12.
- PMID 25140332.
- .
- ISBN 978-0521570954.
- ISBN 978-0521529020.
- ISBN 978-0387983721.
- ISBN 0-08-044335-4
- S2CID 4694570.
- ^ S2CID 17900407.
- PMID 17008335.
- ^ Land, Bruce; Elias, Damian. "Measuring the 'Complexity' of a time series".
- arXiv:1603.03788.
- S2CID 17798157.
- ^ Tominski, Christian; Aigner, Wolfgang. "The TimeViz Browser:A Visual Survey of Visualization Techniques for Time-Oriented Data". Retrieved 1 June 2014.
Further reading
- De Gooijer, Jan G.; S2CID 14996235.
- Box, George; Jenkins, Gwilym (1976), Time Series Analysis: forecasting and control, rev. ed., Oakland, California: Holden-Day
- Durbin J., Koopman S.J. (2001), Time Series Analysis by State Space Methods, Oxford University Press.
- Gershenfeld, Neil (2000), The Nature of Mathematical Modeling, OCLC 174825352
- ISBN 978-0-691-04289-3
- ISBN 978-0-12-564901-8
- Shasha, D. (2004), High Performance Discovery in Time Series, ISBN 978-0-387-00857-8
- Shumway R. H., Stoffer D. S. (2017), Time Series Analysis and its Applications: With R Examples (ed. 4), Springer, ISBN 978-3-319-52451-1
- Weigend A. S., Gershenfeld N. A. (Eds.) (1994), Time Series Prediction: Forecasting the Future and Understanding the Past. Proceedings of the NATO Advanced Research Workshop on Comparative Time Series Analysis (Santa Fe, May 1992), Addison-Wesley.
- Wiener, N. (1949), Extrapolation, Interpolation, and Smoothing of Stationary Time Series, MIT Press.
- Woodward, W. A., Gray, H. L. & Elliott, A. C. (2012), Applied Time Series Analysis, CRC Press.
- Auffarth, Ben (2021). Machine Learning for Time-Series with Python: Forecast, predict, and detect anomalies with state-of-the-art machine learning methods (1st ed.). Packt Publishing. ISBN 978-1801819626. Retrieved 5 November 2021.
External links
- Introduction to Time series Analysis (Engineering Statistics Handbook) — A practical guide to Time series analysis.