A time series is a series of data points indexed in time order. Most commonly, a time series is a sequence taken at successive equally spaced points in time. Thus it is a sequence of discrete-time data. Examples of time series are heights of ocean tides, counts of sunspots, and the daily closing value of the Dow Jones Industrial Average.
Time series are very frequently plotted via line charts. Time series are used in statistics, signal processing, pattern recognition, econometrics, mathematical finance, weather forecasting, earthquake prediction, electroencephalography, control engineering, astronomy, communications engineering, and largely in any domain of applied science and engineering which involves temporal measurements.
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 model to predict future values based on previously observed values. While regression analysis is often employed in such a way as to test theories that the current values of one or more independent time series affect the current value of another time series, this type of analysis of time series is not called "time series analysis", which focuses on comparing values of a single time series or multiple dependent time series at different points in time. Interrupted time series analysis is the analysis of interventions on a single time series.
Time series data have a natural temporal ordering. This makes time series analysis distinct from cross-sectional studies, in which there is no natural ordering of the observations. Time series analysis is also distinct from spatial data analysis where the observations typically relate to geographical locations. A stochastic model for a time series will generally reflect the fact that observations close together in time will be more closely related than observations further apart. In addition, time series models will often make use of the natural one-way ordering of time so that values for a given period will be expressed as deriving in some way from past values, rather than from future values
Time series analysis can be applied to real-valued, continuous data, :wikt:discrete|discrete numeric data, or discrete symbolic data.
Methods for analysisMethods for time series analysis may be divided into two classes: frequency-domain methods and time-domain methods. The former include spectral analysis and wavelet analysis; the latter include auto-correlation and cross-correlation analysis. In the time domain, correlation and analysis can be made in a filter-like manner using scaled correlation, thereby mitigating the need to operate in the frequency domain.
Additionally, time series analysis techniques may be divided into parametric and non-parametric methods. The parametric approaches assume that the underlying stationary stochastic process has a certain structure which can be described using a small number of parameters. In these approaches, the task is to estimate the parameters of the model that describes the stochastic process. By contrast, non-parametric approaches explicitly estimate the covariance or the spectrum of the process without assuming that the process has any particular structure.
Methods of time series analysis may also be divided into linear and non-linear, and univariate and multivariate.
Panel dataA 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. 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, 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.
AnalysisThere are several types of motivation and data analysis available for time series which are appropriate for different purposes and etc.
MotivationIn the context of statistics, econometrics, quantitative finance, seismology, meteorology, and geophysics the primary goal of time series analysis is forecasting. In the context of signal processing, control engineering and communication engineering it is used for signal detection and estimation. In the context of data mining, pattern recognition and machine learning time series analysis can be used for clustering, classification, query by content, anomaly detection as well as forecasting.
Exploratory analysisThe clearest way to examine a regular time series manually is with a line chart such as the one shown for tuberculosis 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.
Other techniques include:
- Autocorrelation analysis to examine serial dependence
- Spectral analysis to examine cyclic behavior which need not be related to seasonality. For example, sun spot activity varies over 11 year cycles. 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
The construction of economic time series involves the estimation of some components for some dates by interpolation between values for earlier and later dates. Interpolation is estimation of an unknown quantity between two known quantities, or drawing conclusions about missing information from the available information. 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. 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.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 approximationIn general, a function approximation problem asks us to select a function among a well-defined class that closely matches a target function in a task-specific way.
One can distinguish two major classes of function approximation problems: First, for known target functions approximation theory is the branch of numerical analysis that investigates how certain known functions can be approximated by a specific class of functions that often have desirable properties.
Second, the target function, call it g, may be unknown; instead of an explicit formula, only a set of points of the form 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 of g is a finite set, one is dealing with a classification problem instead. A related problem of online time series approximation 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 have received a unified treatment in statistical learning theory, where they are viewed as supervised learning problems.
Prediction and forecastingIn statistics, prediction is a part of statistical inference. One particular approach to such inference is known as predictive inference, but the prediction can be undertaken within any of the several approaches to statistical inference. Indeed, one description of statistics is that it provides a means of transferring knowledge about a sample of a population to the whole population, and to other related populations, which is not necessarily the same as prediction over time. When information is transferred across time, often to specific points in time, the process is known as forecasting.
- 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 on time series is usually done using automated statistical software packages and programming languages, such as Apache Spark, Julia, Python, R, SAS, SPSS and many others.
- Forecasting on large scale data is done using Spark which has spark-ts as a third party package.
Signal estimationThis 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
SegmentationSplitting 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.
ModelsModels for time series data can have many forms and represent different stochastic processes. When modeling variations in the level of a process, three broad classes of practical importance are the autoregressive models, the integrated models, and the moving average models. These three classes depend linearly on previous data points. Combinations of these ideas produce autoregressive moving average and autoregressive integrated moving average models. The autoregressive fractionally integrated moving average model generalizes the former three. Extensions of these classes to deal with vector-valued data are available under the heading of multivariate time-series models and sometimes the preceding acronyms are extended by including an initial "V" for "vector", as in VAR for vector autoregression. An additional set of extensions of these models is available for use where the observed time-series is driven by some "forcing" time-series : the distinction from the multivariate case is that the forcing series may be deterministic or under the experimenter's control. For these models, the acronyms are extended with a final "X" for "exogenous".
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:, and
Among other types of non-linear time series models, there are models to represent the changes of variance over time. These models represent autoregressive conditional heteroskedasticity and the collection comprises a wide variety of representation. Here changes in variability are related to, or predicted by, recent past values of the observed series. This is in contrast to other possible representations of locally varying variability, where the variability might be modelled as being driven by a separate time-varying process, as in a doubly stochastic model.
In recent work on model-free analyses, wavelet transform based methods have gained favor. Multiscale techniques decompose a given time series, attempting to illustrate time dependence at multiple scales. See also Markov switching multifractal techniques for modeling volatility evolution.
A Hidden Markov model is a statistical Markov model in which the system being modeled is assumed to be a Markov process with unobserved 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.
NotationA 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
Another common notation is
where T is the index set.
ConditionsThere are two sets of conditions under which much of the theory is built:
strict stationarity and second-order stationarity. Both models and applications can be developed under each of these conditions, although the models in the latter case might be considered as only partly specified.
In addition, time-series analysis can be applied where the series are seasonally stationary or non-stationary. Situations where the amplitudes of frequency components change with time can be dealt with in time-frequency analysis which makes use of a time–frequency representation of a time-series or signal.
ToolsTools for investigating time-series data include:
- Consideration of the autocorrelation function and the spectral density function
- Scaled cross- and auto-correlation functions to remove contributions of slow components
- Performing a Fourier transform to investigate the series in the frequency domain
- Use of a filter to remove unwanted noise
- Principal component analysis
- Singular spectrum analysis
- "Structural" models:
- * General State Space Models
- * Unobserved Components Models
- Machine Learning
- * Artificial neural networks
- * Support vector machine
- * Fuzzy logic
- * Gaussian process
- * Hidden Markov model
- Queueing theory analysis
- Control chart
- * Shewhart individuals control chart
- * CUSUM chart
- * EWMA chart
- Detrended fluctuation analysis
- Dynamic time warping
- Dynamic Bayesian network
- Time-frequency analysis techniques:
- * Fast Fourier transform
- * Continuous wavelet transform
- * Short-time Fourier transform
- * Chirplet transform
- * Fractional Fourier transform
- Chaotic analysis
- * Correlation dimension
- * Recurrence plots
- * Recurrence quantification analysis
- * Lyapunov exponents
- * Entropy encoding
- Univariate linear measures
- * Moment
- * Spectral band power
- * Spectral edge frequency
- * Accumulated Energy
- * 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
- * Sample entropy
- * Wavelet entropy
- * Rényi entropy
- * Higher-order methods
- * Marginal predictability
- * Dynamical similarity index
- * State space dissimilarity measures
- * Lyapunov exponent
- * Permutation methods
- * Local flow
- Other univariate measures
- * Algorithmic complexity
- * Kolmogorov complexity estimates
- * Hidden Markov Model states
- * Rough path signature
- * Surrogate time series and surrogate correction
- * Loss of recurrence
- Bivariate linear measures
- * Maximum linear cross-correlation
- * Linear Coherence
- Bivariate non-linear measures
- * Non-linear interdependence
- * Dynamical Entrainment
- * Measures for Phase synchronization
- * Measures for Phase locking
- Similarity measures:
- * Cross-correlation
- * Dynamic Time Warping
- * Hidden Markov Models
- * Edit distance
- * Total correlation
- * Newey–West estimator
- * Prais–Winsten transformation
- * Data as Vectors in a Metrizable Space
- ** Minkowski distance
- ** Mahalanobis distance
- * 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
- ** Kolmogorov–Smirnov test
- ** Cramér–von Mises criterion