O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Calculating the volatility of stocks

The volatility of a stock is a measurement of the amount of change of variance in the price of a stock over a specific time-period. It is common to compare the volatility of a stock to another stock to get a feel for which may have less risk, or to a market index to compare the stock's volatility to the overall market. Generally, the higher the volatility, the riskier the investment is in that stock.

Volatility is calculated by taking a rolling-window standard deviation on the percentage change in a stock (and scaling it relative to the size of the window). The size of the window affects the overall result. The wider a window, the less representative the measurement will become. As the window narrows, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required