Price of Risk with Mean-Variance Utility
Computing a mean-variance investor's optimal share in a risky asset, or how that share changes with the price of risk.
You invest your savings for one year, splitting it between a risk-free account and a health-care sector stock fund. The fund's price of risk is its Sharpe ratio S = (expected return - risk-free rate) / standard deviation, with returns as decimals. You choose the share w of your savings in the fund to maximize the mean-variance utility U = E[r] - (A/2) Var(r) of the portfolio's one-year return r, with returns measured as decimals, not percentages, and risk aversion A = gamma. You can borrow at the risk-free rate, so the share in the fund may be above 100% (borrowing to invest more than your savings). The fund's standard deviation is std dev% and stays the same, while its price of risk rises from price of risk start to price of risk end. By how many percentage points does the optimal share of your savings in the fund change? Round to two decimals, negative for a decrease.
Use it
from datasets import load_dataset
ds = load_dataset("narunraman/steer_me", "price_of_risk")curl "https://steer-benchmark.cs.ubc.ca/api/sample?element_name=price_of_risk&n=5&seed=42"
See the Reference for the parameters.