Skip to content

two fund rf fix - #139

Merged
rreece merged 2 commits into
mainfrom
rreece/two-fund-rf-fix
Sep 7, 2026
Merged

rreece merged 2 commits into
mainfrom
rreece/two-fund-rf-fix

Conversation

@rreece

@rreece rreece commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Subset of the fixes from this PR:

that one may be abandoned because it has some unfocused discussion added by Claude.

rreece and others added 2 commits September 7, 2026 17:24
The tangent portfolio depends on the risk-free rate, but the two-fund
section defined it as V^-1 mu / b (the r_f = 0 case) while the one-fund
section defined it as V^-1 (mu - r_f 1) / (b - a r_f).  Same symbol, two
different portfolios, and the mixing coefficient psi = a (c - b r*) / d
was only correct for the first.

Mixing w_tan(r_f) with that psi returns weights that sum to one and lie
on the frontier, so the obvious checks pass, but at the return

    r* + (r* - r_min) (r_f - r_f') / (r_min - r_f)

rather than at r*.  The error vanishes at r* = r_min and diverges as
r_f -> r_min.  The TODO this replaces prescribed exactly that recipe.

Everything is now written for general r_f: w_tan(r_f), r_tan, sigma_tan,
and psi(r_f), with the r_f terms shown cancelling in the closed form for
w*, which is the form to implement.

Also fixes sigma_tan^2 in the one-fund section, where the middle
expression had a plain Euclidean norm over a quadratic form and did not
equal the right-hand side it was set equal to.

Verified numerically: psi(r_f) reproduces the target return for every
r_f, and the mismatch error matches the expression above exactly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HbjLTzvQcA82ZiV9eFR5TF
@rreece
rreece merged commit 0d1f39e into main Sep 7, 2026
1 check passed
@rreece
rreece deleted the rreece/two-fund-rf-fix branch September 7, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant