Finance: Calculate Compound Annual Growth Rate

Last Updated on September 5, 2021 by shibatau

I.What do you learn?

 

You will learn how to calculate Compound Annual Growth Rate with Python。

Let’s take an example. I am supposed to have three investment trusts and will get some return from each of them if I sell them all now.

I want to know which is the most efficient investment.

 

 

II.スクリプト

 

I have created two functions, CAGR and PERIODS.

You can see the scripts on Google Colaboratory.

 

https://colab.research.google.com/drive/10qDHG59KA3no1ChkGcy6I1pVimOSs1_X?usp=sharing

 

I have calculated the returns of the investment trusts using the CAGRs that I’ve gotten. They seems to be correct. The results are shown below.

 

 

About shibatau

I was born and grown up in Kyoto. I studied western philosophy at the University and specialized in analytic philosophy, especially Ludwig Wittgenstein at the postgraduate school. I'm interested in new technology, especially machine learning and have been learning R language for two years and began to learn Python last summer. Listening toParamore, Sia, Amazarashi and MIyuki Nakajima. Favorite movies I've recently seen: "FREEHELD". Favorite actors and actresses: Anthony Hopkins, Denzel Washington, Ellen Page, Meryl Streep, Mia Wasikowska and Robert DeNiro. Favorite books: Fyodor Mikhailovich Dostoyevsky, "The Karamazov Brothers", Shinran, "Lamentations of Divergences". Favorite phrase: Salvation by Faith. Twitter: @shibatau

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.