# What are the statistical properties of a standard deviation calculated on a series of 'deviations from short term moving averages'?

Say I have a vector of daily price changes for an asset and calculate the standard deviation of daily returns in the usual way (eg. from end of day, daily price changes). Let's call this result A.

Now assume that for the same asset, I also have a series of daily average prices (eg each daily average calculated from an hourly data series), from which I calculate the 'deviation from the daily average', once per day, say at the end of each day. Again I calculate the standard deviation (covering the same number of days as in A), and call it result B.

What is the mathematical relationship between result A and result B? I assume there must be an easy way to convert between the two, but am unsure how to go about this. Let's assume for simplicity that the returns are standard normal iid (though it would also be interest to hear about how relaxing this assumption affects the answer - eg. if one assumes first order auto-correlation or mean reversion).

Thanks, Yug

• I don't see what case A axactly is; you mean you have one value for each day ?
– user83346
Commented Mar 28, 2016 at 6:56
• just edited. hope it's clear now. Both series have same number of points (one per day), but one is a daily change, and the other is a deviation from the daily average. Commented Mar 28, 2016 at 6:58

I assume that each day $d$ you have 24 values $v_{d,h}$, the first series has values $v_d^{(A)}=v_{d,24}$, the second $v_d^{(B)}=\frac{1}{24}\sum_h v_{d,h}$.

If the values within one day are independent and have a distriution with a standard deviation $\sigma$ and each observation can be considered as ''randomly drawn'' then each observation in the first series has standard deviation $\sigma$ and for the second the standard deviation is $\frac{\sigma}{\sqrt{24}}$ (see P.S. below).

So the first series has observations $v_d^{(A)}=v_{d,24},d=1,2,\dots,N$ and standard devitaion $\sigma_d^{(A)}=\sigma,d=1,2,\dots,N$ and the second $v_d^{(B)}=\frac{1}{24}\sum_h v_{d,h},d=1,2,\dots,N$ and standard deviation $\sigma_d^{(B)}=\frac{\sigma}{\sqrt{24}},d=1,2,\dots,N$.

If you now average over the days, assuming that you have data for $N$ days and that the observations are independent, the the average for case A has standard deviation $\frac{1}{\sqrt{N}} \sigma$ and the average for case B has has standard deviation $\frac{1}{\sqrt{N}}\frac{\sigma}{\sqrt{24}}$

P.S. if $x_i,i=1,2\dots,n$ is randomly drawn from a distribution with standard deviation $\sigma$ then the average of $x_i$ is a random variable with standard deviation $\frac{\sigma}{\sqrt{n}}$

EDIT 20140402:

To answer your comment; if I take more than 24 values each day (let's say $N$) then, as $N$ increases, the standard deviation on the series $v_d^{(B)}=\frac{1}{N}\sum_i v_{d,i}$ will decrease, that is correct. Note that it is a standard deviation of averages.

Let us do a little simulation in R:

# The number of 'samples' taken in a day
N<-24
# The length of the series
lenSeries<-100

#the serie containing the last value of each day
sL<-vector(mode="numeric", length=lenSeries)
#the series containing the daily average of the N daily samples
sA<-vector(mode="numeric", length=lenSeries)

#construct both series using random sampling from a standard normal distribution
for ( i in 1:lenSeries ) {

# take the random samples for one day
x<-rnorm(N)
# series A contains the last value of the day
sL[i]<-x[N]
# series B contains the average of the N values in a day
sA[i]<-mean(x)

}

# standard deviation of the series with the last value of the day
sd(sL)

# standard deviation of the series with the average of the day
sd(sA)

Now try for N<-100 , N<-1000, N<-10000, ... and look at the sd(sA).

You should also compare sd(sA) with 1/sqrt(N) (note that for standard normal $\sigma=1$, hence $1/\sqrt{N}$).

• Not sure I follow completely; " each observation in the first series has standard deviation σ and for the second the standard deviation is σ/√24". If σ represents the daily standard standard deviation in each case then it would mean that as the number of intraday intervals increases to infinity, then the standard deviation of the daily average would fall to zero, which it clearly doesn't. Commented Apr 2, 2016 at 14:08
• This is exactly how it is, see the edit at the end of my answer. Note that we are talking about the standard deviation of a series that contains averages. The simulation shows that it does converge to zero ..., you see ?
– user83346
Commented Apr 2, 2016 at 15:50
• I think i see where we are misunderstanding each other now. The standard deviation I'm interested in is one of 'changes' rather than 'levels'. If sL and sA represent price levels, then simulation looks fine until the point at which the standard deviation is calculated. The standard deviations should be sd(sL[i]-sL[i-1]) for series A, and sd(sL[i]-sA[i]) for series 2. I think this way it's a potentially more interesting problem. I appreciate your thoughts on it. Commented Apr 3, 2016 at 13:03