# Realized Variance as an approximation of the Integrated Variance

Realized Variance is written as $$RV_{[0,T]}^{n} = \sum_{j = 1}^{n} r_{j,n}^2$$, where $$r_{j,n}$$ is the log return for the $$j$$th increment, and $$n$$ is the total number of sample points in the time period $$[0,T]$$.

Integrated Variance (also Quadratic Variation in the case of a geometric Brownian motion stock price model), is $$IV = \int_0^{T}\sigma^2 dt$$, where $$T$$ is the total number of years.

I know that as we have more data points ($$n \to \infty$$), that $$RV \to IV$$ in probability. This makes sense to me as $$IV$$ can be written $$\int_0^T(\text{d}\ln S)^2$$, and so if we have an infinite number of sampling points in $$[0,T]$$ then $$RV$$ is the sum of the square of log returns over infinitesimal increments.

I have seen that with variance swaps (not sure if my understanding is correct) that realized variance can be approximated for $$n$$ days as $$RV = \sum_{j = 1}^{n} r_{j}^2$$. I can see this as a very crude approximation of $$\int_0^T(\text{d}\ln S)^2$$, where $$T = \frac{n}{252}$$, where there are very few sampling points, but am wondering what kind of approximation could be made to show that the $$IV \approx RV$$.

I am trying to see if I can get an intuitive understanding of how such a crude approximation could possibly be close to the actual $$IV$$, but am having trouble. For example, with a Riemann sum and a 'normal' integral from Calculus, $$\int_0^L f(x)\,dx$$ can be approximated using $$\sum_{i=1}^{n}{f(x_i)\Delta x} = \sum_{i=1}^{n} \frac{L}{n}f(iL/n)$$, and this makes sense to me as we are just assuming $$f(x)$$ is constant over the increments.

While trying to do something similar with $$RV$$ and $$IV$$, I break up $$IV = \int_0^T(\text{d}\ln S)^2 = \sum_{i = 1}^n\int_{{\frac{i-1}{252}}}^{\frac{i}{252}}(\text{d}\ln S)^2$$, for each day involved. Then I can directly compare with the $$RV$$ approximation $$\sum_{j = 1}^{n} r_{j}^2$$, and for this approximation to make sense I am trying to show that $$\int_{{\frac{i-1}{252}}}^{\frac{i}{252}}(\text{d}\ln S)^2 \approx r_i^2$$, under some sort of simplification. If this was an integral with the $$\int f(x)dx$$ or even $$\int df(x)$$, I can see how to simplify and show that they are approximately equal, but I don't know what to do with $$\int_{{\frac{i-1}{252}}}^{\frac{i}{252}}(\text{d}\ln S)^2$$, since the increment of the log stock price is squared.

I tried writing $$r_i = \ln S_{\frac{i}{252}} - \ln S_{\frac{i-1}{252}}$$ but would only be able to reach a straight forward simplification if $$\text{d} \ln S$$ was not squared. Here $$r_i^2 = (\int_{{\frac{i-1}{252}}}^{\frac{i}{252}}(\text{d}\ln S))^2$$ and this is clearly not the same as $$\int_{{\frac{i-1}{252}}}^{\frac{i}{252}}(\text{d}\ln S)^2$$. I am wondering if there is some valid approximation that would make this be true, but can't seem to justify it.

I'd appreciate some help in trying to reach a valid approximation. I know that as the mesh size becomes finer that the two should converge, but I wanted to get an idea of how we could intuitively show that $$RV$$ is an approximation of $$IV$$ similar to how a Riemann sum is comparable to an Integral. Thanks in advance!