Time series: random data plus trend, with best-fit line and different applied filters
Inmathematics, atime series is a series ofdata points indexed (or listed or graphed) in time order. Most commonly, a time series is asequence taken at successive equally spaced points in time. Thus it is a sequence ofdiscrete-time data. Examples of time series are heights of oceantides, counts ofsunspots, and the daily closing value of theDow Jones Industrial Average.
Time seriesanalysis comprises methods for analyzing time series data in order to extract meaningful statistics and other characteristics of the data.Time seriesforecasting is the use of amodel to predict future values based on previously observed values. Generally, time series data is modelled as astochastic process. Whileregression analysis is often employed in such a way as to test relationships between one or more different time series, this type of analysis is not usually called "time series analysis", which refers in particular to relationships between different points in time within a single series.
Time series data have a natural temporal ordering. This makes time series analysis distinct fromcross-sectional studies, in which there is no natural ordering of the observations (e.g. explaining people's wages by reference to their respective education levels, where the individuals' data could be entered in any order). Time series analysis is also distinct fromspatial data analysis where the observations typically relate to geographical locations (e.g. accounting for house prices by the location as well as the intrinsic characteristics of the houses). Astochastic 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 (seetime reversibility).
Time series analysis can be applied toreal-valued, continuous data,discretenumeric data, or discrete symbolic data (i.e. sequences of characters, such as letters and words in theEnglish language[1]).
Additionally, time series analysis techniques may be divided intoparametric andnon-parametric methods. Theparametric approaches assume that the underlyingstationary stochastic process has a certain structure which can be described using a small number of parameters (for example, using anautoregressive ormoving-average model). 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 thecovariance or thespectrum of the process without assuming that the process has any particular structure.
A time series is one type ofpanel data. Panel data is the general class, a multidimensional data set, whereas a time series data set is a one-dimensional panel (as is across-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.
Time series of tuberculosis deaths in the United States 1954-2021.
A simple way to examine a regular time series is manually with aline chart. The datagraphic shows tuberculosis deaths in the United States,[8] along with the yearly change and the percentage change from year to year. The total number of deaths declined in every year until the mid-1980s, after which there were occasional increases, often proportionately - but not absolutely - quite large.
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.[9] Visual tools that represent time series data asheat map matrices can help overcome these challenges.
Spectral analysis to examine cyclic behavior which need not be related toseasonality. For example, sunspot activity varies over 11 year cycles.[10][11] Other common examples include celestial phenomena, weather patterns, neural activity, commodity prices, and economic activity.
Curve fitting[12][13] is the process of constructing acurve, ormathematical function, that has the best fit to a series ofdata points,[14] possibly subject to constraints.[15][16] Curve fitting can involve eitherinterpolation,[17][18] where an exact fit to the data is required, orsmoothing,[19][20] in which a "smooth" function is constructed that approximately fits the data. A related topic isregression analysis,[21][22] which focuses more on questions ofstatistical 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,[23][24] to infer values of a function where no data are available,[25] and to summarize the relationships among two or more variables.[26]Extrapolation refers to the use of a fitted curve beyond therange of the observed data,[27] and is subject to adegree of uncertainty[28] since it may reflect the method used to construct the curve as much as it reflects the observed data.
Growth equations
For processes that are expected to generally grow in magnitude one of the curves in the graphic (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 byinterpolation 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").[29] 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.[30] Alternativelypolynomial interpolation orspline interpolation is used where piecewisepolynomial functions are fitted in 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 calledregression). 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 tointerpolation, which produces estimates between known observations, but extrapolation is subject to greateruncertainty and a higher risk of producing meaningless results.
In general, a function approximation problem asks us to select afunction 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,approximation theory is the branch ofnumerical analysis that investigates how certain known functions (for example,special functions) can be approximated by a specific class of functions (for example,polynomials orrational functions) that often have desirable properties (inexpensive computation, continuity, integral and limit values, etc.).
Second, the target function, call itg, 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 thedomain andcodomain ofg, several techniques for approximatingg may be applicable. For example, ifg is an operation on thereal numbers, techniques ofinterpolation,extrapolation,regression analysis, andcurve fitting can be used. If thecodomain (range or target set) ofg is a finite set, one is dealing with aclassification problem instead. A related problem ofonline time series approximation[31] 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.
Instatistics,prediction is a part ofstatistical inference. One particular approach to such inference is known aspredictive 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 asforecasting.
Fully formed statistical models forstochastic 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 asJulia,Python,R,SAS,SPSS and many others.
Forecasting on large scale data can be done withApache Spark using the Spark-TS library, a third-party package.[32]
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 usingchange-point detection, or by modeling the time-series as a more sophisticated system, such as a Markov jump linear system.
Time series data may be clustered, however special care has to be taken when considering subsequence clustering.[33][34]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)
Subsequence time series clustering resulted in unstable (random) clustersinduced by the feature extraction using chunking with sliding windows.[35] 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 arandom walk). This means that the found cluster centers are non-descriptive for the dataset because the cluster centers are always nonrepresentative sine waves.
Models for time series data can have many forms and represent differentstochastic processes. When modeling variations in the level of a process, three broad classes of practical importance are theautoregressive (AR) models, theintegrated (I) models, and themoving-average (MA) models. These three classes dependlinearly on previous data points.[36] Combinations of these ideas produceautoregressive moving-average (ARMA) andautoregressive integrated moving-average (ARIMA) models. Theautoregressive fractionally integrated moving-average (ARFIMA) model generalizes the former three. Another important generalization is the time-varying autoregressive (TVAR) model, in which the AR coefficients are allowed to change over time, enabling the model to capture evolving or non-stationary dynamics. 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 forvector 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 (which may not have a causal effect on the observed 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".
Time-varying autoregressive (TVAR) models are especially useful for analyzing non-stationary time series in which the underlying dynamics evolve over time in complex ways, not limited to classical forms of variation such as trends or seasonal patterns. Unlike classical AR models with fixed parameters, TVAR models allow the autoregressive coefficients to vary as functions of time, typically represented through basis function expansions whose form and complexity are determined by the user, allowing for highly flexible modeling of time-varying behavior, which enables them to capture specific non-stationary patterns exhibited by the data. This flexibility makes them well suited to modeling structural changes, regime shifts, or gradual evolutions in a system's behavior. TVAR time-series models are widely applied in fields such as signal processing[37][38], economics[39], finance[40], reliability andcondition monitoring[41][42][43], telecommunications[44][45], neuroscience[46], climate sciences[47], and hydrology[48], where time series often display dynamics that traditional linear models cannot adequately represent. Estimation of TVAR models typically involves methods such as kernel smoothing[49], recursive least squares[50], or Kalman filtering[51].
Non-linear dependence of the level of a series on previous data points is of interest, partly because of the possibility of producing achaotic 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 innonlinear autoregressive exogenous models. Further references on nonlinear time series analysis: (Kantz and Schreiber),[52] and (Abarbanel)[53]
Among other types of non-linear time series models, there are models to represent the changes of variance over time (heteroskedasticity). These models representautoregressive conditional heteroskedasticity (ARCH) and the collection comprises a wide variety of representation (GARCH, TARCH, EGARCH, FIGARCH, CGARCH, etc.). 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 adoubly stochastic model.
In a recent work on "model-free" analyses (a term often used to refer to analyses that do not rely on modeling the processes evolution over time with a parametric mathematical expression), wavelet transform based methods (for example locally stationary wavelets and wavelet decomposed neural networks) have gained favor.[54] Multiscale (often referred to as multiresolution) techniques decompose a given time series, attempting to illustrate time dependence at multiple scales. See alsoMarkov switching multifractal (MSMF) techniques for modeling volatility evolution.
Ahidden 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 simplestdynamic Bayesian network. HMM models are widely used inspeech recognition, for translating a time series of spoken words into text.
Many of these models are collected in the python packagesktime.
A number of different notations are in use for time-series analysis. A common notation specifying a time seriesX that is indexed by thenatural numbers is written
Ergodicity implies stationarity, but the converse is not necessarily the case. Stationarity is usually classified intostrict stationarity and wide-sense orsecond-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 areseasonally stationary or non-stationary. Situations where the amplitudes of frequency components change with time can be dealt with intime-frequency analysis which makes use of atime–frequency representation of a time-series or signal.[55]
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)[63]
^Lin, Jessica; Keogh, Eamonn; Lonardi, Stefano; Chiu, Bill (2003). "A symbolic representation of time series, with implications for streaming algorithms".Proceedings of the 8th ACM SIGMOD workshop on Research issues in data mining and knowledge discovery. New York: ACM Press. pp. 2–11.CiteSeerX10.1.1.14.5597.doi:10.1145/882082.882086.ISBN978-1-4503-7422-4.S2CID6084733.
^Aghabozorgi, Saeed; Seyed Shirkhorshidi, Ali; Ying Wah, Teh (October 2015). "Time-series clustering – A decade review".Information Systems.53:16–38.doi:10.1016/j.is.2015.04.007.S2CID158707.
^Li, Aimin; Siqi, Xiong; Junhuai, Li (April 2023). "AngClust: Angle Feature-Based Clustering for Short Time Series Gene Expression Profiles".IEEE/ACM Transactions on Computational Biology and Bioinformatics.20 (2):1574–1580.Bibcode:2023ITCBB..20.1574L.doi:10.1109/TCBB.2022.3192306.PMID35853049.
^Keogh, Eamonn; Kasetty, Shruti (2002). "On the need for time series data mining benchmarks: A survey and empirical demonstration".Proceedings of the eighth ACM SIGKDD international conference on Knowledge discovery and data mining. pp. 102–111.doi:10.1145/775047.775062.ISBN1-58113-567-X.
^Halli, S. S.; Rao, K. V. (1992).Advanced Techniques of Population Analysis. Springer Science & Business Media. p. 165.ISBN978-0-306-43997-1.functions are fulfilled if we have a good to moderate fit for the observed data.
^Motulsky, Harvey; Christopoulos, Arthur (2004).Fitting Models to Biological Data Using Linear and Nonlinear Regression: A Practical Guide to Curve Fitting. Oxford University Press.ISBN978-0-19-803834-4.[page needed]
^Regression Analysis By Rudolf J. Freund, William J. Wilson, Ping Sa. Page 269.[date missing]
^Daud, Hanita; Sagayan, Vijanth; Yahya, Noorhana; Najwati, Wan (2009). "Modeling of Electromagnetic Waves Using Statistical and Numerical Techniques".Visual Informatics: Bridging Research and Practice. Lecture Notes in Computer Science. Vol. 5857. pp. 686–695.doi:10.1007/978-3-642-05036-7_65.ISBN978-3-642-05035-0.
^Hauser, John R. (2009).Numerical Methods for Nonlinear Engineering Models. Springer Science & Business Media. p. 227.ISBN978-1-4020-9920-5.
^Klosterman, Richard E. (1990).Community Analysis and Planning Techniques. Rowman & Littlefield Publishers. p. 1.ISBN978-0-7425-7440-3.
^Yoe, Charles E. (March 1996). An Introduction to Risk and Uncertainty in the Evaluation of Environmental Investments (Report). U.S. Army Corps of Engineers. p. 69.DTICADA316839.
^Friedman, Milton (December 1962). "The Interpolation of Time Series by Related Series".Journal of the American Statistical Association.57 (300):729–757.doi:10.1080/01621459.1962.10500812.
^Gandhi, Sorabh; Foschini, Luca; Suri, Subhash (2010). "Space-efficient online approximation of time series data: Streams, amnesia, and out-of-order".2010 IEEE 26th International Conference on Data Engineering (ICDE 2010). pp. 924–935.doi:10.1109/ICDE.2010.5447930.ISBN978-1-4244-5445-7.S2CID16072352.
^Li, Aimin; Siqi, Xiong; Junhuai, Li (April 2023). "AngClust: Angle Feature-Based Clustering for Short Time Series Gene Expression Profiles".IEEE/ACM Transactions on Computational Biology and Bioinformatics.20 (2):1574–1580.Bibcode:2023ITCBB..20.1574L.doi:10.1109/TCBB.2022.3192306.PMID35853049.
^Keogh, Eamonn; Lin, Jessica (August 2005). "Clustering of time-series subsequences is meaningless: implications for previous and future research".Knowledge and Information Systems.8 (2):154–177.doi:10.1007/s10115-004-0172-7.
^Baptista de Souza, Douglas; Kuhn, Eduardo Vinicius; Seara, Rui (January 2019). "A Time-Varying Autoregressive Model for Characterizing Nonstationary Processes".IEEE Signal Processing Letters.26 (1):134–138.Bibcode:2019ISPL...26..134B.doi:10.1109/LSP.2018.2880086.
^Souza, Douglas Baptista de; Leao, Bruno Paes (5 November 2024). "Data Augmentation of Multivariate Sensor Time Series using Autoregressive Models and Application to Failure Prognostics".Annual Conference of the PHM Society.16 (1).arXiv:2410.16419.doi:10.36001/phmconf.2024.v16i1.4145.
^Gutierrez, D.; Salazar-Varas, R. (August 2011). "EEG signal classification using time-varying autoregressive models and common spatial patterns".2011 Annual International Conference of the IEEE Engineering in Medicine and Biology Society. pp. 6585–6588.doi:10.1109/IEMBS.2011.6091624.ISBN978-1-4577-1589-1.PMID22255848.
^Diodato, Nazzareno; Di Salvo, Cristina; Bellocchi, Gianni (18 March 2025). "Climate driven generative time-varying model for improved decadal storm power predictions in the Mediterranean".Communications Earth & Environment.6 (1): 212.Bibcode:2025ComEE...6..212D.doi:10.1038/s43247-025-02196-2.
^Zhang, Ting; Wu, Wei Biao (1 June 2012). "Inference of time-varying regression models".The Annals of Statistics.40 (3).arXiv:1208.3552.doi:10.1214/12-AOS1010.
^Chu, Y. J.; Chan, S. C.; Zhang, Z. G.; Tsui, K. M. (May 2012). "A new recursive algorithm for time-varying autoregressive (TVAR) model estimation and its application to speech analysis".2012 IEEE International Symposium on Circuits and Systems. pp. 1026–1029.doi:10.1109/ISCAS.2012.6271402.ISBN978-1-4673-0219-7.
^Zhang, Z. G.; Chan, S. C.; Chen, X. (December 2013). "A new Kalman filter-based recursive method for measuring and tracking time-varying spectrum of nonstationary signals".2013 9th International Conference on Information, Communications & Signal Processing. pp. 1–4.doi:10.1109/ICICS.2013.6782838.ISBN978-1-4799-0434-1.
^Kantz, Holger; Thomas, Schreiber (2004).Nonlinear Time Series Analysis. London: Cambridge University Press.ISBN978-0-521-52902-0.
^Abarbanel, Henry (Nov 25, 1997).Analysis of Observed Chaotic Data. New York: Springer.ISBN978-0-387-98372-1.
^Boashash, B. (ed.), (2003)Time-Frequency Signal Analysis and Processing: A Comprehensive Reference, Elsevier Science, Oxford, 2003ISBN0-08-044335-4
^Nikolić, Danko; Mureşan, Raul C.; Feng, Weijia; Singer, Wolf (March 2012). "Scaled correlation analysis: a better way to compute a cross-correlogram".European Journal of Neuroscience.35 (5):742–762.doi:10.1111/j.1460-9568.2011.07987.x.PMID22324876.S2CID4694570.
^Li, Aimin; Siqi, Xiong; Junhuai, Li (April 2023). "AngClust: Angle Feature-Based Clustering for Short Time Series Gene Expression Profiles".IEEE/ACM Transactions on Computational Biology and Bioinformatics.20 (2):1574–1580.Bibcode:2023ITCBB..20.1574L.doi:10.1109/TCBB.2022.3192306.PMID35853049.
^abSakoe, H.; Chiba, S. (February 1978). "Dynamic programming algorithm optimization for spoken word recognition".IEEE Transactions on Acoustics, Speech, and Signal Processing.26 (1):43–49.doi:10.1109/TASSP.1978.1163055.S2CID17900407.
^Chevyrev, Ilya; Kormilitzin, Andrey (2016). "A Primer on the Signature Method in Machine Learning".arXiv:1603.03788 [stat.ML].
^Ropella, G.E.P.; Nag, D.A.; Hunt, C.A. (2003). "Similarity measures for automated comparison of in silico and in vitro experimental results".Proceedings of the 25th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (IEEE Cat. No.03CH37439). pp. 2933–2936.doi:10.1109/IEMBS.2003.1280532.ISBN978-0-7803-7789-9.S2CID17798157.
Shumway R. H., Stoffer D. S. (2017),Time Series Analysis and its Applications: With R Examples (ed. 4), Springer,ISBN978-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.