Free learning pack¶
- MIT OCW Portfolio Theory I–III
https://ocw.mit.edu/courses/15-401-finance-theory-i-fall-2008/pages/video-lectures-and-slides/portfolio-theory/ - CFA Portfolio Risk and Return Part I
https://www.cfainstitute.org/insights/professional-learning/refresher-readings/2026/portfolio-risk-return-part-1 resources/portfolio_foundations.md
Do not search for more material until these are insufficient.
PREDICT¶
Without code: an asset rises 50% and then falls 50%. Is cumulative return 0%? Write the ending value of $100.
Formula¶
Simple return: r_t = P_t/P_(t-1) - 1
Portfolio return: r_p = w^T r
Cumulative return: prod(1+r_t)-1
MANUAL FIRST¶
Type the following structure yourself rather than pasting from the reference page.
In [ ]:
Copied!
import numpy as np
import pandas as pd
prices = pd.Series([100.0, 105.0, 102.0, 108.0])
def my_simple_returns(prices):
# TODO: type your implementation
raise NotImplementedError
import numpy as np
import pandas as pd
prices = pd.Series([100.0, 105.0, 102.0, 108.0])
def my_simple_returns(prices):
# TODO: type your implementation
raise NotImplementedError
Code to type after your attempt¶
Open reference/concepts/portfolio_return.md only after trying. Then manually type the vector dot-product implementation and compare results.
Experiment¶
Compare arithmetic average return against actual compounded return.
Promote¶
Compare with src/pm/returns.py. Do not simply replace your notebook code; understand each line.
Test¶
pytest tests/test_returns.py
ORAL CHECK¶
Why does volatility drag make +x% and -x% asymmetric?