I am using TTR in R and I am trying to understand the Yang Zhang volatility estimator (without drift). The following equations seem to imply a single value:
$$ \sigma = \sqrt{{\sigma_o^2}+k\sigma_c^2+(1-k)\sigma_{rs}^2} $$
$$\sigma_o^2 = \frac{1}{N-1}\sum_{i=1}^{N}ln{\frac{o_i}{c_{i-1}}^2}$$ $$\sigma_c^2 = \frac{1}{N-1}\sum_{i=1}^{N}ln{\frac{c_i}{o_{i-1}}^2}$$ $$\sigma_{rs}^2 = \frac{1}{N-1}\sum_{i=1}^{N}(ln{\frac{h_i}{c_i}})(ln{\frac{h_i}{o_i}}) + (ln{\frac{l_i}{c_i}})(ln{\frac{l_i}{o_i}})$$ $$k = \frac{0.34}{1.34 + \frac{N+1}{N-1}}$$
However when I run volatility(my_data, n = 100, calc = "yang.zhang")
I get a vector with a bunch of NAs in front of it. What is my volatility estimate? Is it the last value in the data frame, if so what are the remaining values at the other data points? I apologize if this is trivial - but I cant seem to find anything in the TTR documentation.
Thank you!