Volatility and the square root of time

When I was a rookie, I asked one of the senior members of my team how to compute the volatility of an asset. His answer was as follow:

That’s simply an annualized standard deviation. If you are using daily data:

  1. Compute the daily returns of the asset,
  2. Compute the standard deviation of these returns,
  3. Multiply the standard deviation by the square root of 260 (because there are about 260 business days in a year).

“Of course, he added, if you are using weekly returns you have to multiply by the square root of 52 and if you are using monthly data you should multiply by the square root of 12. Simple as that.

And so I did for years, not even trying to understand why I was multiplying the standard deviation by the square root of time.

Time passed by and one day, I found time to solve that mystery. Then, I understood why this formula makes perfect sense but, more importantly, I realized that the calculations made by most people I know in the financial industry, including seasoned investment professionals, are dead wrong.

Let me explain.

Discrete returns

Let $P_t$ be the price of an asset (that doesn’t pay any interim income such as dividends or coupons for the sake of simplicity) on day $t$. Then, the way most people would compute the return ($\delta_t$) on that asset from day $t-1$ to day $t$ is:

$$\delta_t = \frac{P_t}{P_{t-1}} - 1$$

Now suppose we have price data for $T$ days with $t \in{\{0, 1, 2, .., T\}}$ and, therefore, $T-1$ daily of $\delta_t$, and we want to compute the return over the whole period ($\delta_T$). We would use:

$$\delta_T = \prod_{t=1}^T(1+\delta_t)-1$$

For instance, using the data for the DAX from the EuStockMarkets dataset in R:

> P <- as.numeric(EuStockMarkets[, "DAX"])
> T <- length(P)
> 
> dP <- P[-1]/P[-T]-1
> prod(1+dP)-1
[1] 2.360688
>

Indeed, it's equivalent to:

> P[T]/P[1]-1
[1] 2.360688
>

And the mean return $\bar{\delta_t}$ over the same period is given by:

$$\bar{\delta_t} = (1+\delta_T)^{1/T}-1$$

In R:

> rT <- prod(1+dP)-1
> (1+rT)^(1/T)-1
[1] 0.0006519036
>

Or:

$$\bar{\delta_t} = \left( \frac{P_T}{P_0} \right)^{1/T}-1$$

Note we use $P_0$ because $\delta_1$ is the return between $t=0$ and $t=1$. In R:

> (P[T]/P[1])^(1/T)-1
[1] 0.0006519036
>

Using all this, it's easy to compute what the annualized return of the DAX was over that period. We have a daily mean return ($\bar{\delta_t}$) and we assume a year is 260 business days long; it follows that:

$$\bar{\delta_{260}} = (1+\bar{\delta_t})^{260}-1$$

In R:

> mT <- (1+rT)^(1/T)-1
> (1+mT)^260-1
[1] 0.1846409
>

In words: over that period, the DAX has returned 18.5% per annum on average.

Now, back to the subject: what is the volatility — that is, the annualized standard deviation — of our daily returns ($\delta_t$)? We know how to compute the standard deviation of daily returns; in R:

> sd(dP)
[1] 0.01028088
>

And, according to my former colleague, we should multiply this by $\sqrt{260}$:

> sd(dP)*sqrt(260)
[1] 0.1657742
>

Well, guess what: this is wrong and, not only it is wrong, it doesn't mean anything.

Continuous returns

Using discrete returns is absolutely correct for most uses but, when computating a volatility (and, therefore, a Sharpe ratio or an information ratio) you should use log returns or, as I like to call them, continuous returns:

$$\delta_t = \ln{\left(\frac{P_t}{P_{t-1}}\right)}$$

Or, equivalently:

$$\delta_t = \ln{(P_t)} - \ln{(P_{t-1})}$$

Let me explain why.

The critical property of continuous returns is that the total (continuous) return over the whole period (the $T$ days) is a sum:

$$\delta_T = \sum_{t=1}^T\delta_t$$

In R:

> dP <- diff(log(P))
> sum(dP)
[1] 1.212146
>

Is, indeed, equivalent to:

> log(P[T]/P[1])
[1] 1.212146
>

As a result, the mean daily (continuous) return over the whole period ($\bar{\delta_t}$) is simply the arithmetic mean of the daily (continuous) return:

> mean(dP)
[1] 0.0006520417
>

And, you guessed it, the annualized (continuous) return of the DAX was over that period is given by:

> mean(dP)*260
[1] 0.1695309
>

Starting from this, let's go for a (random) walk.

Random walk

Following Jules Regnault [1], consider a random variable $\delta_t$ that follow some distribution (we don’t care which one) over $T$ periods and just make two basic assumptions: (i) the distribution is stable across time and (ii) the observations of $\delta_t$ are independent one from another.

Denoting $\mu$ the mean of the distribution which is supposed to be stable (assumption i), we know that the sum of $T$ observations will follow a mean $\mu_T$ given by:

$$\mu_T = \mu \times T$$

Now, that distribution also has a standard deviation ($\sigma$): what is the standard deviation of the sum of $T$ observations?

Thanks to the Bienaymé formula [2], we know that the variance of the sum of uncorrelated (assumption ii) random variables is the sum of their variances:

$$Var{\left(\sum_{t=1}^T\delta_t \right)} = \sum_{t=1}^T Var{(\delta_t)}$$

Since we have assumed the distribution is stable (assumption i), so does the variante ($\sigma^2$). From which:

$$Var{\left(\sum_{t=1}^T\delta_t \right)} = \sigma^2 \times T$$

Therefore, standard deviation of the sum of $T$ observations:

$$\sqrt{Var{\left(\sum_{t=1}^T\delta_t \right)}} = \sigma \times \sqrt{T}$$

Here you go: here is the square root of time.

What we are computing here is the standard deviation of a sum and this is indeed how we accumulate continuous returns; not the way we accumulate periodic returns (it's a product). In other words, that formula only make sense if your daily (weekly, monthly... whatever) returns are computed as continuous returns.

The volatility is simply that very same calculation over a standard period of one year (here, $T=260$ days). In R:

> P <- as.numeric(EuStockMarkets[, "DAX"])
> T <- 260
> dP <- diff(log(P))
> mean(dP)*T
[1] 0.1695309
> sd(dP)*sqrt(T)
[1] 0.166096
>

Even better, since we have assumed that our $\delta_t$ are independent, the Central Limit Theorem tells us that, after a large enough number of observations ($T$), their sum should follow (or, at least, be close of) — guess what — a normal distribution.

In other words, with our two assumptions and using continuous returns, we are able to compute the mean and the standard deviation of a normal distribution; which basically means that we knows everything else.

A demo

Let's make a step-by-step demo with the DAX data.

P <- as.numeric(EuStockMarkets[, "DAX"])
dP <- diff(log(P))
T <- 260
# After T days, we should have:
mT <- mean(dP)*T
sT <- sd(dP)*sqrt(T)

Now, we’re going to use ecdf to generate 1000 random series of length T that follow the empirical distribution of the DAX:

N <- 1000
dist <- ecdf(dP)
Rt <- matrix(quantile(dist, runif(T*N)), T, N)

Let's plot them:

Ct <- apply(Rt, 2, cumsum)
cols <- heat.colors(N)
op <- par(mar = rep(5, 4))
plot(1:T, Ct[, 1], type = "n", ylim = c(-.5, .7), cex.lab = .7,
 cex.axis = .7, cex.main = .8, main = "Figure 1")
for(i in 1:N) lines(1:T, Ct[, i], col = cols[i])
par(op)

You shoud get something like:

Now let's see what the distribution looks like after T days:

# The mean:
mean(Ct[T, ])
# Compare to:
mT
# The standard deviation:
sd(Ct[T, ])
# Compare to:
sT

Lastly, compare the empirical distribution at time T with a normal distribution with mean mT and standard deviation sT:

# Density estimate:
d <- density(Ct[T, ], from = -.5, to = .8)

# Normal distribution with our estimated mean/sd (volatility):
y <- dnorm(d$x, mT, sT)

# Plot:
op <- par(mar = rep(5, 4))
plot(d$x, d$y, type = "l", xlim = c(-.5, .8), cex.lab = .7,
 cex.axis = .7, cex.main = .8, main = "Figure 2")
lines(d$x, y, col = "red")
par(op)

It should look like this:

Pretty close right?

From this, one can compute the probability associated with any level of return and it is clear that the higher the volatility, the more likely you are to face losses [3].

Takeaways

First and should you only remember one thing from that post: a volatility should always be computed using continuous (a.k.a log) returns. Any other calculation is false. Period.

Second, most financial models don’t assume anything about the distribution of (say) daily returns: saying that, after $T$ periods, the distribution will be normally distributed is just a consequence of the CLT.

Lastly, the whole random walk thing is based on just two assumptions (i and ii); if you’re looking for weeknesses, this is where you should start.

---
[1] Jules Augustin Frédéric Regnault, a French stock broker who first suggested the concept of a random walk of prices in 1863.
[2] Named after Irénée-Jules Bienaymé (1796-1878), one of the last great French statisticians.
[3] For price probabilities, you'll need to use the corresponding log-normal distribution (see ?dlnorm).

13 commentaires:

  1. Votre homme a-t-il soudain dit qu'il voulait divorcer et vous voulez que vous retourniez tous les deux quand il y a encore de l'amour dans la famille? Ne cherchez plus, car le Dr Ajayi, le grand lanceur de sorts, est fait pour vous. Par profession, je suis banquier, lorsque mon mariage de 7 ans s'est écrasé, cela m'a vraiment brisé le cœur et a même affecté mon travail car je pensais toujours et je ne me concentrais pas. J'aime vraiment mon mari, donc je cherche des moyens que je peux utiliser pour le récupérer après avoir vécu séparément pendant environ 5 mois. Je suis tombé sur un témoignage d'un homme qui a dit qu'il avait pu obtenir une promotion d'emploi avec l'aide du grand lanceur de sorts Dr Ajayi alors j'ai pris son contact et je l'ai contacté, je lui ai expliqué les problèmes de mariage et il m'a assuré que les choses iraient mieux pour moi mais a dit certaines choses qui doivent être faites pour atteindre mon but, j'ai suivi ses instructions et aujourd'hui je vis heureux avec mon mari, c'est vraiment un homme merveilleux et béni par ses dieux. Contactez le Dr Ajayi pour tout type de problèmes de vie sur son numéro Viber ou WhatsApp:+2347084887094 ou Email: drajayi1990@gmail.com vous ne regretterez pas de l'avoir rencontré.

    RépondreSupprimer
  2. BIENVENUE À LA MAISON DU DR DR AJAYI SPELL BÉNÉDIE PAR SES GRANDS ANCÊTRES.

    Retour émotionnel rapide entre lesbiennes et femmes gays et stériles pour le retour immédiat de l'amour. Contactez Viber ou numéro Whatsapp: +2347084887094 ou Email: drajayi1990@gmail.com
    Avez-vous un problème de mariage?
    Avez-vous des problèmes avec la justice?
    Avez-vous des problèmes avec votre patron?
    Souhaitez-vous recevoir votre permis de conduire?
    Vous sentez-vous menacé par ceux qui vous entourent?
    Êtes-vous en train de gaspiller de l'argent sans vous en rendre compte?
    Avez-vous des problèmes pour tomber enceinte?
    Vous avez des questions sur les fausses couches?
    Voulez-vous connaître votre avenir?
    Vous ne satisfaites pas votre conjoint?
    Votre patron vous a-t-il envoyé un emploi?
    Votre petit ami vient de vous quitter?
    Vous ne vous sentez pas comme les autres?
    Cherchez-vous un bon travail? ..
    Contactez le numéro Viber ou Whatsapp: +2347084887094
    Email: drajayi1990@gmail.com pour tous vos besoins.
    * DISPONIBLE 24/7 de la journée.
    * Les résultats sont garantis à 100%.

    RépondreSupprimer
  3. bonne journée les amis, ce n'est pas un problème sans solution, mais seulement si vous cherchez de l'aide aux bons endroits, j'avais un terrible gâchis dans mon mariage parce que mon mari m'a quitté pour une autre femme après 5 ans de mariage et la partie choquante est que nous n'avons eu aucune forme de malentendu, instantanément je sais que quelque chose n'allait pas parce que je le supplie de rentrer à la maison mais il a refusé et a agi de façon étrange envers moi, cela m'a fait chercher de l'aide et j'ai eu la chance de tomber sur un lanceur de sorts contact en ligne, il a été abandonné par un homme qui a décrit comment le lanceur de sorts Dr Ajayi l'a aidé à gagner gros à la loterie. J'ai pris contact avec le Dr Ajayi et lui ai expliqué ma situation, il a posé quelques questions auxquelles je donne les bonnes réponses, je lui ai aussi donné de l'argent pour acheter des choses qu'il utilisera pour le travail et après trois jours de sort j'ai mon mari de retour à la maison avec moi, c'est un miracle. contactez le Dr Ajayi pour tout type de travail de sort. Viber / WhatsApp: +2347084887094 ou Email: drajayi1990@gmail.com

    RépondreSupprimer
  4. I feel very happy to share my great and wonderful testimony with everyone on this site..: I was married for 4 years to my husband and all of a sudden another woman came into the picture he started hating me and he was abusive.but i still loved him with all my heart and wanted him at all cost.... He filed for divorce and my whole life was turning apart and i didn't know what to do, he moved out of the house and abandoned me and the kids... my very close friend told me about trying spiritual means to get my husband back and introduced me to a spell caster so i decided to try it. although i didn't believe in all those things then when he did the special prayers and spell, after 2 days, my husband came back and was pleading that he had realized his mistakes I just couldn't believe it, anyway we are back together now and we are happy in case anyone needs help here is his email address; Account
    doctorirekenagba@gmail.com His spells is for a better life OR call his number
    +2347059630655 or contact him on WHATSAPP

    RépondreSupprimer
  5. Laba diena Aš labai laiminga pasidalinusi tuo liudijimu su visais, kurie turėjo problemų santuokoje. Aš buvau vedęs daugiau nei trejus metus ir negalėjau pagimdyti vaiko. Dėl to mano vyras pradėjo draugauti su moterimis ir vis grįždavo namo kiekvieną vakarą, o ne praleisdamas daug laiko su manimi jis naudojasi taip, kaip mes turime problemų, jis išsiskyrė iš manęs ir paliko mane sudaužyta širdimi. Aš buvau vieniša daugiau nei dvejus metus, buvau liūdna ir nusivyliau, kad praradau visą savo viltį, nes mano gydytojas man pasakė, kad yra jokiu būdu negalėjau pastoti, tai iš tikrųjų daro mane apgailėtiną, kol aš sutikau draugą, kuris man papasakojo apie DR FAYOSA iš interneto, kaip jis padėjo jam ir daugybei moterų, turinčių panašių mano problemų, todėl susisiekiau su juo sekmadienį, kai buvau vienas per šį el. laišką: (Fayosasolusionhome@gmail.com) ir aš jam paaiškinau savo problemas, jis papasakojo man būtinus dalykus, kuriuos reikia pateikti, kad jis galėtų ištarti vėl sujungtą balandžių burtą, kad sugrąžintų mano buvusį vyrą, kurį aš padariau. ir jis atsiuntė pulą maloni malda, kurią turėjau pasakyti vidurnaktį, kol jis liejo meilės burtą. Tai buvo stebuklas. Praėjus 48 valandoms mano vienintelis vyras paskambino man ir paprašė taikos. Kitą dieną jis grįžo pas mane ir atsiprašė už visa, ką padarė. ir man pasakė, kad yra visiškai pasirengęs palaikyti bet kurį norimą dalyką, aš greitai paskambinau DR FAYOSA ir papasakojau jam, kas tuo metu vyko. Jis taip pat paruošė ir atsiuntė man vaistažolę, kuri, jo teigimu, išgydys visas nepageidaujamas ligas. ar infekcijos, trukdančios man pastoti, tada, prieš susitikdamas su vyru, man patarė, kaip tai naudoti. Štai po šios vietinių žolelių ir šaknies vartojimo, po kelių savaičių pradėjau jausti kokią nors ankstyvą ryto ligą, ir tai yra nėštumo požymiai visame pasaulyje. , nuėjau pas gydytoją patvirtinti ir štai, kad buvau nėščia ir pagimdžiau gražius vaikus šių metų gegužės 21 d., pasižadėjau pranešti visam pasauliui apie DR FAYOSA, kad išgelbėsiu savo santuoką. Aš dabar turiu vaiką didžiuojuosi, kad šiandien pašaukiu bet kurį Moterys, manančios, kad tai neįmanoma, čia yra galimybė jums šypsotis ir atnešti laimę savo šeimai. Maloniai susisiekite su DR FAYOSA el. paštu: (Fayosasolusionhome@gmail.com) arba „Whatsapp“ +2348151918774. Iš tiesų, jis yra Dievo siųstas vyras, kad jis sugrąžintų mano pamestas meilužis ir atneš tau laimę, kai praradai visas viltis

    RépondreSupprimer
  6. Are you in need of finance? we give out guarantee cash at 3% interest rate. Contact us on any kind of finance now: financialserviceoffer876@gmail.com whatspp Number +918929509036 Dr James Eric

    RépondreSupprimer
  7. Volví con mi ex novio con la ayuda del Dr. Fayosa, el mejor lanzador de hechizos en línea y recomiendo al Dr. Fayosa a cualquiera que tenga problemas espirituales o problemas en su relación, quiero testificar de cómo recuperé mi novio después de que rompió conmigo, hemos estado juntos durante 2 años, recientemente descubrí que mi novio estaba teniendo una aventura con otra chica, cuando lo enfrenté, me llevaron a peleas y finalmente rompió conmigo, intenté todo lo que podría recuperarlo, pero todo fue en vano hasta que vi una publicación en un foro de relaciones sobre un lanzador de hechizos que ayuda a las personas a recuperar su amor perdido a través del hechizo de amor, al principio lo dudé, pero decidí intentarlo, cuando contacté a este lanzador de hechizos, me dijo qué hacer y lo hice, luego me hizo un hechizo de amor y me alegro de decirlo 28 horas después, mi novio realmente me llamó y me dijo que me extrañaba mucho, ¡tan asombroso! Así fue como volvió ese mismo día, con mucho amor y alegría, y se disculpó por su error y por el dolor que me causó, Entonces a partir de ese día, nuestra relación ahora era más fuerte que antes, Todo gracias al Dr. Fayosa es tan poderoso y decidí compartir mi historia en Internet que el Dr. Fayosa es un lanzador de hechizos real y poderoso que siempre rezaré para vivir mucho tiempo para ayudar a sus hijos en el momento de problemas, si estás aquí y necesitas su ex de vuelta o su esposo se mudó con otra mujer, no llore más, comuníquese con este poderoso lanzador de hechizos ahora, aquí está su contacto: correo electrónico (Fayosasolusionhome@gmail.com) o directamente en whats-app 2348151918774

    RépondreSupprimer
  8. I URGENTLY NEED MY EX BACK WITH THE HELP OF A POWERFUL LOVE SPELL CASTER . dr.makinidrmurugu@gmail.com

    My name is Doris John. My ex-husband and I had always managed to stay friendly after our divorce. But I always wanted to get back together with him, All it took was a visit to this spell casters website, because my dream was to start a new life with my husband, and live happily with him.. This spell caster requested for a specific love spell for me and my husband, and i accepted it. And this powerful spell caster began to work his love spell. And 48 hours after this spell caster worked for me,my husband called me back for us to be together again, and he was remorseful for all his wrong deeds.The spell is work perfectly and my husband is now back to me again.My “husband” is back and we went to court and withdraw our divorce papers ASAP. This is nothing short of a miracle Thank you Dr.Amigo for your powerful spells. Words are not enough.

    Email: dr.makinidrmurugu@gmail.com
    https://drmakinidrmurugu.blogspot.com
    Whatsapp: +90 538 069 4285
    dr.makinidrmurugu@gmail.com

    RépondreSupprimer
  9. I URGENTLY NEED MY EX BACK WITH THE HELP OF A POWERFUL LOVE SPELL CASTER . dr.makinidrmurugu@gmail.com

    My name is Doris John. My ex-husband and I had always managed to stay friendly after our divorce. But I always wanted to get back together with him, All it took was a visit to this spell casters website, because my dream was to start a new life with my husband, and live happily with him.. This spell caster requested for a specific love spell for me and my husband, and i accepted it. And this powerful spell caster began to work his love spell. And 48 hours after this spell caster worked for me,my husband called me back for us to be together again, and he was remorseful for all his wrong deeds.The spell is work perfectly and my husband is now back to me again.My “husband” is back and we went to court and withdraw our divorce papers ASAP. This is nothing short of a miracle Thank you Dr.Amigo for your powerful spells. Words are not enough.

    Email: dr.makinidrmurugu@gmail.com
    https://drmakinidrmurugu.blogspot.com
    Whatsapp: +90 538 069 4285
    dr.makinidrmurugu@gmail.com

    RépondreSupprimer
  10. To anyone out there who thinks love spells don't work, I’m here to tell you that Lord Zakuza love spell is the best and most powerful. I am a wealthy man who has lots of assets and possessions but I have difficulty with women. Whenever I try to settle down with any, we end up breaking up and I had no idea of why I was going through such an experience in my relationship. It was so worrying that I couldn’t be myself anymore and I started searching for help everywhere even at my place of work. I was going through my work activities online and I came across a testimony of a lady called ( Febe Anouk ) regarding how Lord Zakuza helped her to restore her relationship with his love spell, I had to give it a try because I needed my Ex lover back that I love so much. I visited Lord Zakuza website online and I told him everything I was going through. Lord Zakuza consoled me and promised to help me out with my situation by preparing a love spell for me. I followed the instructions given by him to me and within 48 hours, my Ex lover came looking for me and pleaded for forgiveness. Since I came in contact with Lord Zakuza, things have changed for good in my life and right now, I am married with two beautiful kids and my home is blessed. All thanks to Lord Zakuza I am forever thankful to you. Visit his website for any help via lordzakuzaspells.com or WhatsApp him on +1 740-573-9483. Try him and your life will be blessed.

    RépondreSupprimer
  11. I want to give a testimony about my HIV virus that was cured by a great
    spell caster Dr Osasu. Since last 4 months I have being a HIV AID patient.
    I never think I live long again and am so grateful about Dr Osasu who cured
    my HIV AIDS last week. I was in a great pain so I told one of my best
    friends; and she told me that there is a spell caster that can cure my HIV
    she read someone testimony from a website on-line on how Dr Osasu cure her
    from HIV AIDS and she also collected Dr Osasu website and email. She gave
    me Dr Osasu email, I emailed him he talked to me and he perform the
    necessary rituals and he told me that after two weeks I should go for a
    test. Which I did, when the doctor told me that am now a HIV negative I
    couldn't believe myself I went to see another doctor the result was still
    the same contact DR Osasu via email
    com You can alarm o call him or add him on WhatsApp +2347064365391

    RépondreSupprimer
  12. Salut au monde ! Je m'appelle Clifford, j'ai été si malchanceux de gagner des loteries plus de 6 ans auparavant. Un jour fidèle, j'étais sur Internet et j'ai vu une série de bonnes critiques sur la façon dont le Dr Ibinoba a aidé beaucoup de gens à gagner en suivant simplement ses instructions, alors je l'ai contacté via son WhatsApp. Je lui ai dit exactement ce que je voulais, a-t-il assuré moi qu'il me fera gagner, j'étais tellement dans le doute au début parce que j'ai essayé toutes les méthodes que je connais mais en vain. Après la lecture, il m'a dit ce que je devais faire pour gagner, alors j'ai fait tout ce qu'il m'a demandé, le lendemain, il m'a donné des numéros à jouer, à ma plus grande surprise, j'ai gagné 8 000 $, c'était incroyable mais vrai. Dr Ibinoba, je vous dois tout, merci d'un million de façons d'avoir exaucé mon souhait. C'est un homme bon et il peut aussi vous aider, contactez-le aujourd'hui pour obtenir de l'aide. Sa ligne personnelle, appelez-le/WhatsApp +2348085240869

    RépondreSupprimer
  13. Jeanson James Ancheta wizard, I will like to appreciate this organization, all the gratitude and appreciation goes to this organization,they are the best, I can’t appreciate them enough I don’t know how or where to start from, first of all I will like to say am so grateful and thankful for this organization for being part of my progress over the years they have help me to recover my $55, 000 worth of stolen cryptocurrency, this would not have been possible without their help and support, at first I didn’t believe they will be able to help me recover the money but later on I was astonished, and amazed on how they were able to help me recover my money without stress it was very easy for him help me to recover my money am super excited and grateful to them, for their help. Contact him using email:(jeansonjamesanchetawizard62@gmail.com) or WhatsApp number: +447529524472.

    RépondreSupprimer

Votre mot de passe

On ne va pas épiloguer pendant 150 ans, vous avez besoin : De mots de passe très forts (à partir de 128 bits), un par site (sauf, éventuel...