Chapter 1
Chapter 1
Dakota Wixom
Quantitative Analyst | QuantCourse.com
Course overview
Learn how to analyze investment return distributions, build
portfolios and reduce risk, and identify key factors which are
driving portfolio returns.
Portfolio Investing
Factor Investing
Historical drawdown
import pandas as pd
StockPrices = pd.read_csv('StockData.csv', parse_dates=['Date'])
StockPrices = StockPrices.sort_values(by='Date')
StockPrices.set_index('Date', inplace=True)
Dakota Wixom
Quantitative Analyst | QuantCourse.com
Moments of distributions
Probability distributions have the following moments:
1) Mean (μ)
2) Variance ( σ2 )
3) Skewness
4) Kurtosis
Mean = μ
Variance = σ2
Skewness = 0
Kurtosis = 3
σ=1
μ=0
import numpy as np
np.mean(StockPrices["Returns"])
0.0003
import numpy as np
((1+np.mean(StockPrices["Returns"]))**252)-1
0.0785
Variance = σ2
O en represented in
mathematical notation as σ,
or referred to as volatility
import numpy as np
np.std(StockPrices["Returns"])
0.0256
np.std(StockPrices["Returns"])**2
0.000655
import numpy as np
np.std(StockPrices["Returns"]) * np.sqrt(252)
0.3071
Dakota Wixom
Quantitative Analyst | QuantCourse.com
Skewness is the third moment
of a distribution.
0.225
Leptokurtic: When a
distribution has positive
excess kurtosis (kurtosis
greater than 3)
2.44
The null hypothesis of the Shapiro-Wilk test is that the data are
normally distributed.