Tobin's Annualized Standard Deviation in Pandas

1.5k Views Asked by At

I am seeking to confirm that I have correctly calculated Tobin's formula for determining annualized standard deviation based on a series of monthly returns.

The most widespread (and easiest) way to calculate annualized standard deviation is to multiply the monthly standard deviation by the square root of 12.

formula

Morningstar, however, defers to James Tobin's formula for annualized standard deviation, as linked here.

formula

Here's my representation of this formula in pandas, where observations is a data frame containing monthly returns.

observations.apply(lambda x: np.sqrt((((observations.std() ** 2) + ((1+observations.mean())**2))**12) - (1+observations.mean())**24) ).ix[:,0]
1

There are 1 best solutions below

0
On BEST ANSWER

It's quite easy to vectorize your formula. I feel that beginners to pandas should never be allowed to use apply or ix. These should be your last options.

# variance is just square of std so you can use var
var = observations.var()
mean_one = observations.mean() + 1

np.sqrt(((var + (mean_one**2))**12) - mean_one**24)