"""Calculate an excess-return Sharpe estimate.

Risk-free return and asset observations must use the same period; the sample deviation uses n-1.
All inputs are synthetic teaching examples. Run: python 08_sharpe-excess-return.py
"""
from tv_math import *

s=sharpe([0,.01,.02],0,1)
assert abs(s-1)<1e-12
print(s)
