Skip to content
All library documents

Measuring Time-Series Distance from a Positive Limit

Article Quant Q&A · Author: Bober02

Summary

The document asks how to summarize the closeness of a time series to a fixed, positive limit when the series may cross, approach, or remain far below it. One proposed measure is the pointwise relative gap, calculated as the difference between the limit and the current value divided by the limit, followed by a weighted average across observations. This representation can be positive below the limit and negative when the series exceeds it.

The response broadly endorses the approach and suggests using logarithmic changes to make percentage comparisons symmetric when measuring movement in either direction. It also proposes standardizing observed distances by subtracting their mean and dividing by their standard deviation over a chosen window, producing a z-score-like measure of how unusual the current distance is. These suggestions are general measurement ideas, not a tested trading strategy; the document does not specify weighting choices, window length, or how to handle all possible values and limit-crossing patterns.

Key ideas

  • A relative gap can express each observation's distance from a positive limit as a proportion of that limit.
  • A weighted average of pointwise gaps can summarize distance across a series.
  • Logarithmic changes can make percentage comparisons symmetric across upward and downward moves.
  • Standardizing distances by their mean and standard deviation measures deviation in standard deviation units.

Tags

Full text
# Limits analysis


# Limits analysis












I have a few time series of models to analyse in terms of how far/close they are to their underlying limit. The limit is a simple value on the y-axis (always positive), and the series can act arbitrary with respect to that - it can be negative for most of the time, then jump up and oscillate, or stay close under the limit, or even break the limit a couple of times... My question is how to best capture the "closeness" of the time series?

My current idea is as follows: for each data point we calculate distance = (limit - curr_value)/limit. This can be very big, if the values are negative (far from limit), close to zero and negative if breaching. I would then compute a weighted average of all values.

Does this make sense at all, or perhaps a different strategy should be used? Thanks a lot for your opinions.

## Answer by Matt Wolf (score 1)

https://quant.stackexchange.com/a/4786

Despite the rather unconventional terminology used I would say you are pretty much spot on with what you are doing and what you try to achieve. I would, however use log returns in order to get an identical percentage no matter whether you measure the distance from 100 -> 90 or 90 -> 100, for example. You can also standardize the value you capture by differencing the observed distance and mean distance and then divide the difference by the observed standard deviation of the distances over a specified amount of data points, similar to z-value. That gives you the difference in terms of standard deviations.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.