Estimating Volatility from Irregularly Spaced Returns
Summary
The document considers how to estimate annualized daily volatility from portfolio balances recorded after trades at uneven intervals. It presents a simple estimator under a zero-drift Wiener model: square each log return, divide by the elapsed time between observations, and average those scaled squared returns to estimate variance. The corresponding volatility is the square root of that estimate.
The rationale is maximum likelihood: each log return is modeled as normally distributed with variance proportional to its time interval. The answer derives the estimator from the likelihood and notes that allowing drift can require numerical optimization, such as BFGS, when no closed-form solution is available. The document does not compare its proposed estimator with the questioner's alternatives or provide empirical validation. Its assumptions matter: it treats volatility as constant over time and assumes no drift, so results may be less suitable when returns have meaningful drift or changing volatility. The sampling setup also needs careful handling of elapsed-time units when annualizing.
Key ideas
- Scale each squared log return by the elapsed time between observations to account for irregular sampling.
- The estimator is maximum likelihood under a zero-drift Wiener model with constant volatility.
- Taking the square root of the estimated variance gives volatility in the time units used for the intervals.
- A drift term can complicate estimation and may require numerical optimization.
- The model assumptions and time-unit conversion affect the usefulness of the resulting Sharpe ratio.
Tags
Full text
# Estimating daily volatility of unevenly/irregularly spaced time series data
# Estimating daily volatility of unevenly/irregularly spaced time series data
Say I have time-series data that is unevenly spaced, with anything between 4-50 hours of spacing in between. The data comes from a trading account history, which has captured the balance of the portfolio after each trade.
I'd like to calculate the annualised daily volatility of this account in order to compute a sensible Sharpe ratio. As such, I am assuming volatility does not vary with time.
I've read How do you estimate the volatility of a sample when points are irregularly spaced? but do not have access to the knowledge, experience or computational power required to solve for the maximum in the formula proposed.
What would be a reasonably good way to approximate the daily volatility of this time series? I can think of a few solutions and would be interested to hear if you have comments on them or if you had other ideas.
- Solution #1: Pretend my data is, in fact, regularly spaced
- Solution #2: Cut all but the last data point of each day
- Solution #3: As #2 but fill any gaps with some short EMA estimate (perhaps making use of Eckner, 2015)
- Solution #4: Use a method akin to that oulined in pp.38 of Eckner, 2014, (if I've understood it correctly) and approximating the vol to the ATR scaled by $ \sqrt{ \frac{ \pi }{ 8 \rho } } $
## Answer by JoseOrtiz3 (score 1)
https://quant.stackexchange.com/a/71165
A simple estimate of the volatility $\sigma$ of an asset given $N$ samples of asset prices $S_i$ at times $t_i$ is:
$$ \sigma^2 = \frac{1}{N} \sum_{i=1}^{N} \frac{\log(S_i / S_{i-1})^2}{t_i - t_{i-1}} $$
This is the maximum likelihood estimate of $\sigma$ when the asset price is assumed to be a Wiener process with no drift. In this case, the transition probability of observing $x_i=\log(S_i/S_{i-1})$ is given by:
$$ P(x_i) = \frac{1}{\sigma \sqrt{2\pi(t_i - t_{i-1})}} \exp({\frac{-{x_i}^2}{2 \sigma^2 (t_i-t_{i-1})}}) $$
The estimate maximizes $\prod_{i=1}^{N} P(x_i)$. It can be derived by differentiating the logarithm of this product with respect to $\sigma$ and setting this to zero.
A more complicated model may include drift (e.g. this answer), but maximizing the log likelihood may require an optimization algorithm like BFGS if an analytical solution can't be found. In this case, giving the gradient and a good initial guess to the solver will massively speed up the solution time.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.