Closed AniketBhanu closed 5 years ago
Thanks for the report! Looks like this was introduced in the code all the way back in commit eb0fd34332fca1cdef34849404dd4d249785bc76. The documentation wasn't updated until commit 697012f51eb1e5941f693e9334dfefbb2ae00c88, where you can see the equations for text and LaTeX for "yang.zhang"
are different.
As per the reference manual on
volatility(calc="yang.zhang")
, the calculation of k should be:k <- (alpha)/(1 + (n + 1)/(n - 1))
whereas, the calculation in the source code is:
k <- (alpha - 1)/(alpha + (n + 1)/(n - 1))
I believe that the calculation in the source code is correct and the documentation needs to be updated.