quantitative-finance

Enforce quantitative finance conventions and numerical stability in Python code.

Updated May 12, 2026
One-click install
npx skills add https://github.com/RorySullivan1/claudeBrain --skill quantitative-finance-rorysullivan1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: quantitative-finance
Source: https://github.com/RorySullivan1/claudeBrain/tree/main/example-project/.claude/skills/quantitative-finance
Command: npx skills add https://github.com/RorySullivan1/claudeBrain --skill quantitative-finance-rorysullivan1

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The domain floor for writing correct quantitative code. The job is to get the math conventions and the numerics right — a result that is off by an annualization factor, a sign, or a day-count basis is wrong even when the code is clean.

Core Features & Use Cases

  • State your conventions: Every quant number carries hidden assumptions: compounding frequency, day-count, annualization factor, sign of a cash flow, whether a rate is decimal or percent. Make them explicit in code and comments; most "bugs" are convention mismatches, not logic errors.
  • Validate against closed form: When a formula has an analytic answer (Black–Scholes for a European option, analytic VaR for a normal P&L, a bond's price from its yield), test the implementation against it before trusting it on real data.
  • Numerical stability is correctness: Floating-point math is not real-number math. Work in log-space for products of probabilities, avoid subtracting nearly equal numbers, and watch ill-conditioned matrices.
  • Library selection: Use numpy, scipy, pandas, statsmodels; rely on established libraries for curves, probabilistic models, and linear algebra.

Quick Start

Provide a simple Black-Scholes pricing problem and verify the computed price against the analytic value.

Frequently Asked Questions about quantitative-finance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce correct day-count and compounding conventions in Python quantitative finance code?

Enforcing correct quantitative finance conventions requires making assumptions like day-count basis, compounding frequency, and annualization factors explicit in your code and comments to prevent mismatch errors. This ensures consistency across pricing, risk metrics, and validation tasks.

Why does my Black-Scholes option pricing output mismatch analytic benchmarks?

Black-Scholes pricing outputs mismatch analytic benchmarks due to hidden convention errors in annualization factors, day-counts, or compounding. Validating your implementation against closed-form analytic answers before running real data identifies and corrects these numerical discrepancies.

How do I prevent floating-point numerical stability issues in risk metrics calculations?

Preventing floating-point numerical stability issues in risk metrics requires working in log-space for probability products, avoiding subtraction of nearly equal numbers, and monitoring ill-conditioned matrices to maintain mathematical correctness.

What is the best way to validate quantitative finance results against analytic benchmarks in Python?

The best way to validate quantitative finance results is testing implementations against closed-form analytic answers, such as Black-Scholes for European options or analytic VaR for normal P&L, ensuring the computed values match before applying them to real market data.

Can I use numpy and scipy for convention-aware financial pricing and validation?

Yes, you can use numpy, scipy, pandas, and statsmodels for convention-aware financial pricing and validation. Relying on these established libraries for curves, probabilistic models, and linear algebra provides robust guardrails for numerical stability.

What are common limitations when applying numerical stability guardrails to quant finance models?

Limitations when applying numerical stability guardrails include the inherent differences between floating-point math and real-number math, requiring careful handling of ill-conditioned matrices and nearly equal number subtractions to avoid incorrect pricing or risk metric outputs.