goal-based-allocation

Author: Artur Sepp

GoalBasedAllocation is a Python library for dynamic mean-variance allocation and terminal-wealth risk under a two-regime jump-diffusion with an absorbing wealth floor. It solves the policy from a Riccati system, computes survival, the floor atom, the jump overshoot and the terminal wealth distribution from Laplace transforms, aggregates multi-asset mandates to one effective asset, and prices European options and variance swaps under the same model. Monte Carlo validates the analytics; it does not implement them. The package is the companion code to Sepp (2026), Dynamic Mean-Variance Portfolio Allocation under Regime-Switching Jump-Diffusions with Absorbing Barriers and Distribution Matching (SSRN 6534579).

Software citation: CITATION.cff.

Start here

  1. Install and run the quickstart. The installation command is python -m pip install goal-based-allocation, and the quickstart evaluates one balanced mandate offline in seconds.

  2. Read Notation and conventions before comparing a number with the manuscript: regimes are numbered from one in the paper and from zero in the code, jump sizes are exponential means, and several functions fix the horizon, initial wealth and riskless rate.

  3. Check Model boundaries to confirm that the question fits the published model.

The goal-based allocation handbook

The methodology chapters form one book. Each chapter defines its method with formulas and concise proofs, states its conventions in a seven-row card, works an example whose every quoted number the test suite checks against an independent computation, and links to the functions that implement it. Where the implementation and the manuscript differ, the chapter says so and shows the evidence. Symbols keep one meaning throughout; see the conventions and the bibliography.

Part I: The model

  • The regime-switching jump-diffusion: the regime chain, exponential jumps at transitions, compensators, total return against diffusion drift, and the paper’s asset classes and floors.

  • Buy-and-hold moments: exact moments of terminal wealth by a \(2 \times 2\) matrix exponential, consumption scaling and the stationary benchmark.

Part II: Dynamic mean-variance allocation

Part III: The Laplace transform framework

Part IV: Terminal wealth and investor profiles

Part V: Derivatives under the same model

Reference

Project resources

This software is research code distributed without warranty and does not provide investment advice.