Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

How can I calculate the stock volatility in percentage? Do i have to use sd() function without any other calculation ?

Thanks

share|improve this question

3 Answers

BNaul's answer is probably not the one you're looking for. If you want to calculate Black-Scholes style volatility, you need to calculate an annualized volatility of log-returns. That means, calculate the log return series $\ln(s_t/s_{t-1})$ for each $t$, take the standard deviation, and then adjust it by the square root of time to obtain the annualized figure. This volatility can be used in pricing models that require Black Scholes vol.

share|improve this answer

You're looking for the standard deviation of log returns, appropriately annualized and converted to percentage (i.e. multiplied by 100).

Here is an example of computing annual vol from daily prices:

library(tseries)
data <- get.hist.quote('VOD.L')
price <- data$Close
ret <- log(lag(price)) - log(price)
vol <- sd(ret) * sqrt(250) * 100

Notes:

  1. The above code should really be using prices adjusted for corporate actions (dividends, splits etc).
  2. 250 is the (approximate) number of trading days in a year.
share|improve this answer

When volatility is described as a percentage, that means it's being given as a fraction of the mean. So if the standard deviation of the price is 10 and the mean is 100, then the price could be described as 10% volatile.

In R terms, this would mean:

vol_percent = sd(price) / mean(price)

EDIT: This could also have been easily found on the Wikipedia article for volatility.

share|improve this answer
Re the edit: Your answer disagrees with the Wikipedia article: "The annualized volatility σ is the standard deviation of the instrument's yearly logarithmic returns." That's the value appearing in the Block-Scholes and other stochastic models. Multiply it by 100 to express it in percent. – whuber Aug 25 '11 at 19:09
Huh. The definition I was familiar with was the one from the introduction: "Volatility is normally expressed in annualized terms, and it may either be an absolute number ($5) or a fraction of the mean (5%)." I'm not a finance guy by any means, though, so if you or someone else wants to give a more thorough answer then that would be welcome. – bnaul Aug 25 '11 at 19:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.