Python for Finance: Are stock returns normally distributed?

Published at : 22 Feb 2022

Today we investigate whether stock returns are normally distributed! First, I show the difference between simple returns and log returns, highlighting the main reason log returns are preferred for financial analysis.

Then we explore whether CBA (ASX listed stock, Commonwealth Bank of Australia) log returns are normally distributed. We do this by considering several visual and statistical techniques; Quantile-Quantile Plots, Box Plots, Histograms, and numerically by Hypothesis Testing with Kolmogorov Smirnov and Shapiro Wilk tests.

Full code available on my website: https://asxportfolio.com/shares-python-for-finance-normally-distributed

00:00 Intro
00:27 Why use log returns?
02:18 Simple returns
07:28 Log returns
10:44 Are log returns normally distributed?
16:08 Quantile-Quantile Plots
18:00 Box Plots
19:20 Kolmogorov Smirnov test
22:10 Shapiro Wilk tests

As a high-level programming language, Python is a great tool for financial data analysis, with quick implementation and well documented API data sources, statistical modules and other frameworks related to the financial industry. We will be using Jupyter Lab as an interactive web browser editor for this series due to ease of use and presenting code in a live notebook is ideal for this tutorial series.

This is the third video of many on the topic of Python for Finance. The series will include general techniques used for financial analysis and act as an introduction for more in-depth tutorials that we may explore later (such as time series modelling, building financial dashboards, machine learning ect.).

★ ★ ASX Portfolio Patreon Community ★ ★
Get access to Jupyter Notebooks and join a small niche community of like-minded quants on discord.
https://www.patreon.com/asxportfolio

★ ★ 📚 BOOK RECOMMENDATIONS 📚 ★ ★
📚 Stochastic Calculus for Finance I: The Binomial Asset Pricing Model
📚 Stochastic Calculus for Finance II: Continuous-Time Models
📚 Implementing Derivative Models
📚 Statistical Analysis of Financial Data in R

★ ★ FREE RESOURCES ★ ★
EDUCATION: https://asxportfolio.com
Option Pricing Calculator: https://asxportfolio.com/bsmodel
ASX Options List: https://www.asxoptions.com/company-directory/

★ ★ CONTACT US ★ ★
EMAIL: asxportfolio@gmail.com

Disclaimer:
All ideas, opinions, recommendations and/or forecasts, expressed or implied in this content, are for informational and educational purposes only and should not be construed as financial product advice or an inducement or instruction to invest, trade, and/or speculate in the markets. Any action or refraining from action; investments, trades, and/or speculations made in light of the ideas, opinions, and/or forecasts, expressed or implied in this content, are committed at your own risk an consequence, financial or otherwise.

Python for Finance: Are stock returns normally distributed?

python for financefinancepython


Are You Wasting Your Time Training For Strength?

Are You Wasting Your Time Training For Strength?

The BEST Quartz Watches in 2022 - Affordable to Luxury

The BEST Quartz Watches in 2022 - Affordable to Luxury

100,000 Steps In 24hrs (Extreme Discomfort) | 7000+ Calories

100,000 Steps In 24hrs (Extreme Discomfort) | 7000+ Calories

VANS SNOWBOARDING PRESENTS: ELLES | Snow | VANS

VANS SNOWBOARDING PRESENTS: ELLES | Snow | VANS

Re:Zero OST - Longing For Sunbeams (Extended)

Re:Zero OST - Longing For Sunbeams (Extended)

ROAST YOURSELF CHALLENGE - Amara Que Linda

ROAST YOURSELF CHALLENGE - Amara Que Linda

Diplomacy Is Not An Option, Ultra-Hardcore Mode, Peasant's Side

Diplomacy Is Not An Option, Ultra-Hardcore Mode, Peasant's Side

Outdated E1 - Outdated at 24

Outdated E1 - Outdated at 24

4 Ingredient Meals in 15 Minutes with Erwan

4 Ingredient Meals in 15 Minutes with Erwan

Jakob Ingebrigsten smashes world indoor record | Lievin World Indoor Tour GOld

Jakob Ingebrigsten smashes world indoor record | Lievin World Indoor Tour GOld

The EXACT FRAMEWORK I used to grow a $46.2M business in 3 years....in 70 minutes

The EXACT FRAMEWORK I used to grow a $46.2M business in 3 years....in 70 minutes

FUTURE PALACE - A World in Tears (OFFICIAL VISUALIZER)

FUTURE PALACE - A World in Tears (OFFICIAL VISUALIZER)

ILL New Gameplay Trailer (2022) 4K

ILL New Gameplay Trailer (2022) 4K

I Forgot My Phone

I Forgot My Phone

World of Warcraft Will Finally Allow Horde, Alliance to Play Together - IGN Daily Fix

World of Warcraft Will Finally Allow Horde, Alliance to Play Together - IGN Daily Fix