# Interpreting and scaling of Realized Variance with sample data

I have some question about realized variance(RV) and I have some sample prices below to work with. You can run the R code below to build a vector of log returns. Three are 78 5-minute buckets in a trading day (from open to close) so the log returns vector has length(logreturns) = 78.

The calculation for RV is the sum of the squared log returns. Where X is the log PRICE and n is the number of buckets in a day RV equals:
$$RV = \sum\limits_{i=1}^{n} (X_{t_{i+1}} - X_{t_{i}})^2$$

So below I calculate RV, then get the volatility by take square root, then annualize it. .

RV = sum(logreturns^2)
RV
 2.509554e-05
daily_volatility = sqrt(RV)
daily_volatility
 0.005009545 # i.e. open to close volatility  = .49%
annualized_volatility = sqrt(260)*volatility
annualized_volatility
 0.08033328  # on an annualized basis that is 8.03%


Question 0: My price time series was built using the last tick in each 5-minute bucket. Would it be better to use the VWAP in each bucket instead of the last tick in each bucket? VWAP would be defined as the product of the PRICEs of all the tick (P) and VOLUME of all the ticks (V) in a 5-minute bucket divided by the sum of the volume of all the ticks in a bucket 5 minute bucket. ie.VWAP = (P*V)/sum(V)

Question 1: Can it then be interpreted that the volatility for this day was .5%? or 8.03% on an annualized basis?

Now I am measuring RV so that I can use it in post-trade regressions looking at trade costs. I will be measuring volatility from the time the market opens to the time time a trade takes place. For example if a trade takes place in the 16th minute there will be 3 5-minute buckets used in the RV calculation. If another trade takes place in the 76th minute there will be 15 5-minute buckets used. I believe I need to scale the RVs to a daily RV before I can use them in a regression. This is because, using the example above, if the 16th minute RV and the 76th minute RV are the same that would be misleading because the 16th minute RV is not on the same time scale. So...

Question 2: How should one properly scale RVs calculated from different number of buckets? For example using the logreturns vector lets say a trade takes place in the 21 minute so I will use the first 4 5-minute buckets to calculate an RV:

RV = sum(logreturns[1:4]^2) # HERE ONLY USE 1st 4 BUCKETS
daily_volatility = sqrt(RV)
daily_volatility
 0.001503846  # here the volatility using the first 4 buckets is .15%


How should this 0.001503846 be scaled so that it can be used in post trade regressions with different RVs.

I was thinking scaling by the number of buckets used to get:

scaled_volatility = daily_volatility * sqrt(78/4)
 0.006640803  #daily volatility would be .66%
scaled_volatility_annualized = daily_volatility * sqrt(78/4)*sqrt(260)
 0.1070797  # annualized volatility would be 10.7%


Would that be correct?

Question 3: Does it even make sense to check the annualized RV number against a close-to-close volatility number? Should there be any expectation that they are similar or different?

# R code to build price vector
prices= c(69.354346196)
prices= rbind(prices,69.290432)
prices= rbind(prices,69.300752759)
prices= rbind(prices,69.219979108)
prices= rbind(prices,69.208148518)
prices= rbind(prices,69.246598516)
prices= rbind(prices,69.316969994)
prices= rbind(prices,69.382236297)
prices= rbind(prices,69.439047295)
prices= rbind(prices,69.303030426)
prices= rbind(prices,69.215724903)
prices= rbind(prices,69.235499743)
prices= rbind(prices,69.228075019)
prices= rbind(prices,69.226522461)
prices= rbind(prices,69.278545753)
prices= rbind(prices,69.279946134)
prices= rbind(prices,69.294667184)
prices= rbind(prices,69.325204623)
prices= rbind(prices,69.296794394)
prices= rbind(prices,69.271009358)
prices= rbind(prices,69.258763087)
prices= rbind(prices,69.230728678)
prices= rbind(prices,69.250976948)
prices= rbind(prices,69.275912906)
prices= rbind(prices,69.266953813)
prices= rbind(prices,69.275524358)
prices= rbind(prices,69.257009203)
prices= rbind(prices,69.248320494)
prices= rbind(prices,69.239413345)
prices= rbind(prices,69.169838829)
prices= rbind(prices,69.15291089)
prices= rbind(prices,69.181671655)
prices= rbind(prices,69.171275889)
prices= rbind(prices,69.149855396)
prices= rbind(prices,69.181647188)
prices= rbind(prices,69.116412877)
prices= rbind(prices,69.169805719)
prices= rbind(prices,69.17149549)
prices= rbind(prices,69.171311493)
prices= rbind(prices,69.150704259)
prices= rbind(prices,69.168990869)
prices= rbind(prices,69.167502639)
prices= rbind(prices,69.169828509)
prices= rbind(prices,69.136281414)
prices= rbind(prices,69.137206043)
prices= rbind(prices,69.108438269)
prices= rbind(prices,69.10342004)
prices= rbind(prices,69.165636224)
prices= rbind(prices,69.193646811)
prices= rbind(prices,69.2072143)
prices= rbind(prices,69.232462739)
prices= rbind(prices,69.255101895)
prices= rbind(prices,69.278061272)
prices= rbind(prices,69.33507867)
prices= rbind(prices,69.378308505)
prices= rbind(prices,69.373578935)
prices= rbind(prices,69.42822269)
prices= rbind(prices,69.433781902)
prices= rbind(prices,69.448787913)
prices= rbind(prices,69.441731914)
prices= rbind(prices,69.444092485)
prices= rbind(prices,69.440302981)
prices= rbind(prices,69.379244744)
prices= rbind(prices,69.430264889)
prices= rbind(prices,69.441485395)
prices= rbind(prices,69.492248013)
prices= rbind(prices,69.513478661)
prices= rbind(prices,69.567990492)
prices= rbind(prices,69.580500697)
prices= rbind(prices,69.51972368)
prices= rbind(prices,69.561692927)
prices= rbind(prices,69.563459496)
prices= rbind(prices,69.538617278)
prices= rbind(prices,69.58494135)
prices= rbind(prices,69.564894664)
prices= rbind(prices,69.548091511)
prices= rbind(prices,69.604420178)
prices= rbind(prices,69.574414993)
prices= rbind(prices,69.632808692)
logreturns = diff(log(prices))#log returns

• Can you please define VWAP? Aug 4, 2015 at 0:15

I'll address things in order as I encountered them in the question.

First, your formula for RV only makes sense if $X_{t_i}$ is the log-price, not log-return. If this was just a mistype it would probably be best if you edited the question to correct it. If it is not a mistype, let me know, because then you have bigger problems...

Answer 0: I have no idea what VWAP is. However, I can tell you that the standard in the academic literature is to use the most recent observation in each bucket. Assuming VWAP is some kind of smooth function over all the observations in the bucket, you might find that RV calculated using VWAP is smaller on average than RV calculated using the most recent observation. Whether or not this is a good thing is really application dependent. 2018 Edit: Okay, so VWAP is volume-weighted average price. I probably should have guessed that. I've never looked into VWAP. I did once look into weighted best-bid/best-ask, ie instead of bid-ask midpoint, weight the best bid and best ask by the respective best bid volumes and best ask volumes. Using this price proxy resulted in high frequency variance estimates that were significantly larger than when using transaction of bid-ask midpoint data. I ended up abandoning it entirely as the numbers did not look sensible from a heuristic perspective.

Answer 1: Using the notation you describe in the question, realised volatility is an estimate of the true volatility of a return that spans the time-period $[t_1, t_n]$. You can scale the number up or down but this only changes the units. It does not change the interpretation. However you choose to scale the number, the estimator itself still only pertains to the interval $[t_1, t_n]$.

Put another way, an RV estimator that spans $[t_1, t_n]$ can not be interpreted as an estimator for a different time-span, such as $[t_1, t_{n+1}]$ except under the strict assumption that true volatility is constant (and this assumption is almost never valid in financial markets).

Note, I am not saying you can't scale your RV estimators up so that they are all in annualized units. Feel free to talk about your RV estimator as being ~8% in annualised units. There is nothing wrong with that. I am merely stating that you must never forget that the estimator itself was derived only from data spanning $[t_1, t_n]$.

Answer 2: This is a hard one to answer without knowing exactly what you are trying to do with your regressions. For example, if you only care about the statistical significance of your estimated coefficients, then the question of scaling is irrelevant as it will have no effect on the statistical significance of your estimators. This is because scaling a sequence of random variables by a constant has no effect on the correlation with other random variables. (Note, I'm assuming here you are doing a relatively common method of estimation like OLS - I can think of some exotic estimation methods where it might make a difference).

On the other hand, if you want to make ad hoc comparisons between the magnitude of your estimated coefficients, then yes, it might prove useful to scale all your realised variance estimators up to the same units. You can do this using the square-root of time as you have discussed in the question, but just keep in mind my warnings about interpretation from Answer 1.

UPDATE: Based on the regression problem that OP describes in the comments my analysis is as follows: If you want to use realised volatility estimators from many different spans of time to estimate the coefficient (beta term) in the described regression then it is very important that you scale the realised volatilities to all be in the same units, e.g. annualized. This is because your regression appears to be attempting to isolate the effect of "spot" (I'm using that term loosely here - apologies to any purists reading) volatility on trading costs. But if you don't scale all RV to the same units, you'll also be measuring the effect of time of day on trading costs, because RVs from earlier in the day are measured over a shorter span and so will be smaller. I'm assuming the object is to isolate the effect of volatility on trading costs, which means we want to eliminate any other effects. So in this case, scaling realised variances so they're all measured in the same units makes good sense to me.

Answer 3: I am not really sure what you mean by close-to-close volatility number. I'm guessing you mean the sample variance estimator calculated using close-to-close returns that, together, span a year. If this is the case, then as I stated in Answer 1, the comparison is only meaningful if true volatility is constant over the entire year (which would never happen in financial markets).

• Thank you Colin. Yes X is the log Price. I edited the question. Regarding question 2 I am measuring RV to get an idea of market conditions before a trade. Volatility is a market condition. I.e. How volatile is the market today before I traded? I am using RV to answer that question. I am going to apply the RV in a regression like trade cost = Beta_0 + Beta_1*Volatility where Volatility is the square root of the RV as seen in the code. (continued) Aug 4, 2015 at 3:56
• I was thinking scaling would be necessary there. My reasoning was if you have trade1 that takes place at time n1 (so the RV1 is from [t1,t_n1]) and trade2 that takes place at time n2 (so the RV2 is from [t1,t_n2]) AND n1<n2 AND if you assume RV1 = RV2 then the regression would interpret RV1 and RV2 as having the same RV. i.e the same market conditions existed before I traded trade1 as before I traded trade2.(continued) Aug 4, 2015 at 3:57
• I didn't think that made sense because obviously there was more variation in a shorter period of time for trade1 compared to trade2 so I was going to scale up all the RVs to daily or annualized RV so that in this case the scaled-RV1 would be greater than the scaled-RV2 understanding that scaling makes an assumption that the volatility is constant as you pointed out. My thinking here is that the time matters somehow when comparing RVs from [t1,t_n1] vs. [t1, t_n2]. Can you clarify if/how the time interval is irrelvant here? (continued) Aug 4, 2015 at 3:57
• To me it's intuitive to compare like with like i.e. daily RV vs. daily RV (understanding that scaling assumes constant volatility) and it is unintuitive to compare 10 minute RV with 360 minute RV. Does this example clarify or is scaling still not needed here? Aug 4, 2015 at 3:58
• @joesyc I've added an update to the answer to reflect the regression you describe. If you think I've answered the question satisfactorily, don't forget to upvote (click the up arrow next to my answer) and mark the question answered (click the tick mark). Aug 4, 2015 at 4:12