# When is a data set a time series?

Time is a concept from the real world. In mathematics and statistics, however, we operate on numbers. When does a number, as a mathematical abstraction, correspond to "time"? Any data set which includes a numerical variable can be sorted by that variable. The variable can be even labeled as $$t$$, but this alone shouldn't make the set a time series.

Is being a time series:

• a property of the data set by itself; or
• our assumption, based on our domain knowledge, about the process that generated the data; or
• a label by which we justify the choice of tools for analyzing the data; or
• something else (what?); or
• a combination of the above?

To make it more clear what my confusion is about, below are some examples, along with my guess whether it is a time series or not:

• Brownian motion: Position of a particle at time $$t$$ depends, in part, on its position at $$t-1$$. Time series.
• Moon brightness: The brightness at time $$t$$ depends on the Moon's relative position to the Sun and the Earth. This position is a function of time, but time is not causal to the brightness. Not a time series.
• Epidemic: The number of infected persons at time $$t$$ depends, in part, on the number of infected persons at time $$t-1$$, because the already infected spread the infection further. Time series.
• Road accident deaths over years: The number of deaths depends on car safety (seat belts, airbags, etc.), road quality, policing, etc. These have changed over time, but neither time nor past numbers are the cause for the current numbers. Not a time series.

So, if my guesses above are right, it looks as if "time-seriesness" were a question of causality. If past realization(s) of a random variable, $$x_{t-1}, x_{t-2}, ...$$ have a causal effect on its future values, it's a time series. If there is a confounder to the past and future values, it's not a time series. In general, however, we don't know about causality and confounders in advance (and, often, not even after concluding the statistical analysis). Hence, we cannot know whether we should treat a data set as time series or not.

Or, do we consider data to be time-series already if time can be used as a proxy for the unknown confounder(s)? (In that case, all of my four examples above would be time series).

Or. am I on a completely wrong path?

• The formal definition of time series does not require a conceptualization of time: see stats.stackexchange.com/a/126830/919. In particular, it does not model causality.
– whuber
Sep 10, 2021 at 3:13

#### This raises an under-appreciated point about the scope of "time-series analysis"

I think you have hit on an under-appreciated point in time-series analysis here, which is that mathematically these models can also legitimately model data indexed by some other variable that does not represent "time" in the real world. If we step back from the terminology used in the field and just look at the bare bones of the mathematics of the models, we see that the field of "time-series analysis" uses statistical models with the following general features:

• There are data values $$x_t$$ indexed by an index $$t$$, and this latter index can be either an integer (for "discrete-time" models) or a real number (for "continuous-time" models).

• Models in this field may incorporate deterministic effects on the index $$t$$ (e.g., a linear trend, a polynomial trend, a sinusoidal wave, etc.).

• Models in this field may incorporate "auto-regressive" statistical relationships, whereby we can write an equation for $$x_t$$ that depends on one or more values $$x_r$$ for $$r and random error (and possibly also some exogenous variables).

• Although models can often be manipulated into other forms, the defining form of the model never involves effects that reference larger values of the index $$t$$. So, for example, in the defining equation for the data value $$x_t$$ we would not include any effect referencing $$x_r$$ for any $$r>t$$. In this sense, the definition of the model treats the index $$t$$ as an ordering where effects can only reference "previous" values (or "current" values of other variables).

• In more complicated models, we may have multiple series of data values $$x_t$$, $$y_t$$, $$z_t$$, etc., and we incorporate cross-referencing effects between them. Again, these models obey the general rule that their defining forms only reference "current" or "previous" values.

Now, it is entirely possible that models obeying the above properties might be useful in describing phenomena where we have data $$x_t$$ referenced by an index $$t$$ that does not represent time. In this case, we would model the data using a "time series model" even though the dataset is not actually a time-series --- i.e., the index referencing the data does not refer to time. In theory, it is possible that $$t$$ might represent a spatial variable, or a temperature variable, or something else that is not time. Obviously the models in time-series analysis are only really applicable when indices that are "directional" in the sense that they the requirements above, so some kinds of spatial models (which have effects that operate in both directions in space) would not meet these requirements.

In any case, as you can see, the scope of "time-series analysis" is technically larger than just models for data indexed by time. This is one of the points that I try to get across to students when teaching time-series analysis, but it is often forgotten through the force of repetition of the time-based terminology used to describe the models. It is a nice thing to bear in mind, in case you encounter statistical problems where you have data indexed by another directional variable, where you want to use a model with the above properties. In this case you can use "time-series analysis" even though your data does not vary with time.

To be sure that I answer your title question, please note that any dataset containing a series of observations indexed by time is ---by definition--- a time-series. This is a contextual question regarding the meaning of the variable $$t$$, not a mathematical question. This means that you will need to look at context and the meaning of your variables to determine whether or not your dataset is a time-series. However, the relevant issue for whether or not the field of "time-series analysis" is applicable is whether or not the model forms developed in that field are appropriate to the data. The vast majority of actual time-series datasets can be dealt with fruitfully by the models in "time-series analysis" or regression, but other datasets not involving time can sometimes be dealt with using these models.

• Thanks, this clarifies a lot. So, if I understand correctly, a data set is not by itself a time series, but only in connection with the model we choose. Regarding your 3rd point: Isn't an auto-regressive relationship essential for "time-seriesness"? Without it, we could model the trend as a function of $t$, making it basically a regression, right? Sep 10, 2021 at 8:20
• Not all time series are autoregressive.
– whuber
Sep 10, 2021 at 14:06
– Ben
Sep 10, 2021 at 15:30

I would say the simplest answer is that a time-series is any dataset where event time is a feature. It doesn't need to be correlated with anything in any way, but you also can't assume it's not.

Event time here is defined as a unique numeric index $$T$$ corresponding to a partial ordering of the set of events such that for any pair of events $$A$$ and $$B$$, if $$T_A = T_B$$ then $$A$$ and $$B$$ were concurrent up to the 'resolution' of the index.

This means only reporting a Unix timestamp up to the hour value is fine, but reporting the year and the UTC hour on a wall clock as an integer alone is not - 1 PM can refer to the same hour in any number of days.

Event time as an index has a bunch of properties that makes it distinct from any random numerical feature, even an orderable one. Even with no causality in the common sense of the word the values of $$Y_2$$ become more and more correlated with the values of $$Y_1$$ as $$T_2 - T_1$$ goes to zero. With causality on top, the data-generating process is effectively a Markov chain of some (arbitrarily high or low) dimensionality.

• Can I use it as a definition: "A data set is a time series if it contains a variable $T$ and a variable $Y$, and the correlation between $Y(T=t_i)$ and $Y(T=t_j)$ increases as $t_i \rightarrow t_j$"? Mar 18, 2020 at 12:42

A time-series data set is just data collected through time. For calling it a time series, it doesn't matter if futures values are a function of past values or not. So in your moon brightness example, if you measure the brightness and record the time of measurement, it's time-series data. Even the number of road accident deaths for each year is time-series data.

Suppose, I roll a die 100 times and note down the outcome of each roll, this data set is also time series.

Now, given time-series data, one useful thing to do is to forecast the future values of the series. For doing this, one way is to model the time series as a sequence of random variables and look for correlation among these variables, referred to as autocorrelation in time series terminology. If this correlation exists, it can be used to forecast values ahead even if there may not be a causal relationship between future and past values. Remember, correlation is not causation, but the correlation is still very useful in forecasting.

This is a good place to get more information on time series data and what you can do with it.

• So, if I understand you correctly, everything can be thought of as "time series": All observations were made at some point in time. It's just that for many data sets the time information is censored, so we cannot apply time series analysis on them. But we should, if we could, right? Mar 18, 2020 at 12:03
• Right. You can sort the observations in the order of their timestamps. If this sequence has useful information, you can use them in your models. Mar 24, 2020 at 5:12
• "Just data collected through time" overlooks several key points. One is that "time series" is almost always applied to data either collected at equal time intervals (or at least summarized over equally spaced intervals). Another is that a great number of datasets having nothing to do with time series are collected over time. (The exceptions are those obtained with snapshots of something, such as an instantaneous image.) Ergo, time has to play a particular role in the conceptualization and analysis of the data before it can be termed a "time series."
– whuber
Sep 10, 2021 at 14:08

I think that, in practice, a time-series is a method, not a data type, one of those developed such as ARIMA to address problems when data is causally ordered and thus X can predict Y differently at different points in time, and autocorrelation is an issue. But that is another way of saying I guess that if autocorrelation is tied to time and a change in the impact of a predictor on the response variable over time (at different lags) occurs you have time-series data.