Why Mean Rolling Volatility Can Differ from Full-Series Volatility
Summary
The document asks why the average of rolling standard deviations can differ from the standard deviation of a full time series. Its example contrasts a stable series with one that has a level shift halfway through the sample. The author expects the rolling estimate to track the full-sample estimate, but observes that windows spanning the jump produce a pronounced rise in rolling volatility. The question also raises whether rolling volatility can support estimates of changing quantiles or distributional behavior.
No answer or quantitative derivation is included, so the document does not establish a general relationship between the two statistics. Its example does illustrate a key issue: the full-sample standard deviation reflects variation across the whole period, including the level shift, while each rolling estimate depends on the observations inside its particular window. The result therefore depends on the window and the time pattern in the data. The example is illustrative and uses a short synthetic series; it does not resolve behavior for heavy-tailed or jump processes.
Key ideas
- The average of rolling standard deviations need not equal the full-series standard deviation.
- A level shift can inflate rolling estimates for windows that include observations on both sides of the shift.
- Rolling volatility depends on the window length and the path of the data.
- The document poses the statistical question but does not provide an answer or derivation.
Tags
Full text
# Disalignment between global standard deviation and mean of rolling standard deviation
# Disalignment between global standard deviation and mean of rolling standard deviation
Ciao,
I am working on proprerties of time series. I was trying to deduce an estimate of standard deviation of a process from the series of rolling standard deviation but I've got some issues when I deal with Leavy Process.
I report here a dummy code in Python I am using for this test:
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def computeRollingStdMean(df, n, column):
return df[column].rolling(n).std().mean()
N = 100
df = pd.DataFrame({ "noise": ( np.random.rand(N)*2-1)*0.1 })
df["StockA"] = ( [20]*(N/2)+[10]*(N/2) ) +df.noise
df["StockB"] = [15]*N + df.noise
df["StdRollingA"] = df.StockA.rolling(50).std()
df["StdRollingB"] = df.StockB.rolling(50).std()
result = pd.DataFrame({"Window" : [ 2, 5, 10, 20, 30, 40, 50, 100 ]})
result["sigmaTargetA"] = df.StockA.std()
result["sigmaTargetB"] = df.StockB.std()
result["sigmaMeanrollingA"] = [ computeRollingStdMean(df, x, column = "StockA") for x in result.Window ]
result["sigmaMeanrollingB"] = [ computeRollingStdMean(df, x, column = "StockB") for x in result.Window ]
```
From the result table you can see I have an issue with Stock A, that with jump.
In particular my guess would that the mean of the rolling standard deviation would be close to the global standard deviation. Infact this happen for Stock B where there are not jumps.
Of course my statement should depends on the rolling window and it is trivially true when the window has the same dimension of the time series $N$ (since there is no rolling process at the end in this case ).
By plotting rolling std time series I am not surprise of the plot of StockA. At the end rolling operator is like a convolution so that I would expect a "hill-like" plot when the rolling window hits the spyke.
But I also thought that, taking the mean, it would not change so much the std estimation.
> Can you give a qualitative (or quantitative) meaning to this phenomena?
I am studying rolling standard deviation since I want to deduce other informations such as quantiles, and distriubtion behaviour in time but I must be sure that the std process I've build is coherent.
Thanks for your help,
AMShown 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.