# Measure for Combined Percentiles in Time-series Data

Edited: on the first revision the first paragraph was mistakenly dropped.

Suppose I am interested in buying an asset, such as a stock or foreign exchange, and would like to compare its price to its historical prices, taken daily. It is assumed that a lower price indicates a stronger indication for buying that asset. One way to do this would be to look at its prices in the last $$n$$ days, and determine the percentile of the current price with relation to the last n prices.

However, that percentile might be very different for different values of $$n$$. An asset might be on the 5th percentile with relation to the last month ("cheep"), on the 40th percentile with relation to the last 3 months ("ok"), and on the 85th percentile with relation to the last 12 months ("expensive").

One approach I can think of is taking the percentile values for all time-windows from $$n_1$$ to $$n_2$$, where $$n_1 < n_2$$:

$$P_i(x_0, \ldots, x_i) = \text{Percentile}(x_0 | \{x_1, x_1, \ldots, x_i \}), \forall i=n_1, n_1 + 1, \ldots, n_2 - 1, n_2$$

Where $$x_i$$ indicates the price observed $$i$$ periods back from now.

Then we can somehow calculate a combined measure of these values - either using simple average or weighted average (weighted according to the size of the window, age of observations, or any other way). Similarly this could be done with median instead of average. For example:

$$\hat{P}_{n_1}^{n_2} = \frac{1}{n_2-n_1+1} \sum_{i=n_1}^{n_2} P_i$$

Is the simple average of $$n_2 - n_1 + 1$$ periods

I could not find any reference to a similar existing approach, so I'm wondering:

1. Does such approach, or a similar one, already exists?
2. Do you think this might be a good measure for assessing the relative price of an asset, with regard to different time-scales?
• Taking mean of lagged percentiles will be biased at least because the larger lag percentiles depend on short lag percentiles, thus your variable is not independent. – Alexey Burnakov Apr 3 at 12:20