5

I am trying to inspect a circular time series (a long time series of angular measures in 0-360°). The main aim would be to identify abrupt changes in the time series, but as a start I would like to plot it and visually inspect it. What is the best way? I am aware of the Fisher & Lee 1994 paper, but I found it difficult to implement in R.

REFERENCE

Fisher, N. I., and A. Lee. "Time series analysis of circular data." Journal of the Royal Statistical Society: Series B (Methodological) 56.2 (1994): 327-339.

whuber
  • 322,774
  • 1
    The term "circular time-series" may be quite misleading as it sounds as if you were talking about circular time. – Tim May 18 '23 at 08:33
  • "but as a start I would like to plot it and visually inspect it." You can not just plot it ignoring the periodic behaviour? Or potentially, if the step sizes never exceed $180^\circ$ try to unwrap the series by adding $k \cdot 360^\circ$ where you figure out $k$ with some algorithm. – Sextus Empiricus May 18 '23 at 09:19
  • Than you for your comment. That was my first thought and what I did at the beginning, but ignoring the circularity around 0-360° gives a graph very difficult to interpret. Moreover, step size often is > 180° – Calcifer May 18 '23 at 10:55
  • @Calcifer the stepsize is >180 because you cross the boundary from 0 to 360 or because the actual steps are that large? – Sextus Empiricus May 18 '23 at 11:07
  • Instead of the raw time series you can possibly plot the differences between -180 and +180. (and model it with a von Mises distribution) – Sextus Empiricus May 18 '23 at 11:07
  • "to identify abrupt changes in the time series" What do you consider an abrupt change? If the stepsize is 360 degrees, is that an abrupt change? Or do you only care about the effect on the time series. (which is zero for a step of 360 degrees) – Sextus Empiricus May 18 '23 at 11:14
  • "That was my first thought and what I did at the beginning" can you show the result of such a plot. – Sextus Empiricus May 18 '23 at 11:16
  • If you're familiar with the topological concept of winding number and its integral formula in Complex Analysis, then you're all set, because you can view the time series as sampling the polar angles of a continuous path in the plane. The answer I posted gives a simple implementation and a conventional visualization. – whuber May 18 '23 at 17:44

1 Answers1

1

One way (out of many) is to adjust the data by whole periods to make them vary more continuously over time.

Specifically, modify the time series $(x)=(x_1,x_2,\ldots,)$ to a time series $(y)=(y_1,y_2,\ldots)$ that is congruent to $(x)$ modulo the period $\tau.$ Begin with $$y_1=x_1 + k\tau$$ where $k$ is any integer you choose to make $y_1$ a "nice" starting value. At each successive time $i+1,$ predict $y_{i+1}$ as $\hat y_{i+1} = y_i$ and then adjust it modulo $\tau$ to make the prediction as close as possible to the observed value:

$$y_{i+1} = x_{i+1} + \left[\frac{\hat y_{i+1} - x_{i+1}}{\tau}\right]\tau.\tag{*}$$

The bracket $[\ ]$ means to round to the nearest integer.

It is explicit in these two formulas that for every $i,$ $y_i$ differs from $x_i$ by an integral multiple of $\tau.$ Thus, $(y)$ is a valid representative of $(x).$ This construction makes successive values of $y_i$ as close as possible to what you might expect based on the preceding values: that's what I mean by "more continuously."

This is simple to code. In R for example, with the time series data in a vector x, create the adjusted vector y with

tau <- 360                             # ... or 2*pi or whatever
y <- x                                 # Allocates storage for `y`
k <- -1; y[1] <- x[1] %% tau + k * tau # Optional: `k` should be integral
for (i in seq_along(y)[-1]) y[i] <- x[i] + tau * round((y[i-1] - x[i]) / tau)

Now you may simply plot $(y).$ If you like, overplot the original data $(x).$ In this figure $(x)$ is plotted as black circles and $(y)$ as gray squares, connected by red line segments.

enter image description here

The results might be meaningless with highly noisy data but they can still be helpful:

enter image description here

If there is some kind of underlying continuity, you now have a chance of seeing it while still displaying the original data.

Of course, if you have a model for the time series that lets you forecast one step into the future, you might do better by forecasting $y_{i+1}$ from preceding values rather than using the naive forecast embodied in $(*).$ If you don't have a model, you might consider modeling $(y)$ rather than $(x)$ and then (if $(y)$ is very noisy) iterating the modification procedure $(*)$ using this provisional model. The idea is that $(y)$ is likely a better manifestation of the evolution of the data over time than is $(x)$ and studying it might reveal information lost by recording $(x)$ modulo $\tau.$ This opens up the entire world of time series modeling techniques to analyze circular data, at very little cost.

whuber
  • 322,774
  • 1
    For an implementation of this idea in higher (response) dimensions see https://stats.stackexchange.com/a/34401/919. – whuber May 18 '23 at 14:42