import React from 'react'; import { BookOpen } from 'lucide-react'; import 'katex/dist/katex.min.css'; import { BlockMath, InlineMath } from 'react-katex'; interface PortfolioMathModalProps { isOpen: boolean; onClose: () => void; } export default function PortfolioMathModal({ isOpen, onClose }: PortfolioMathModalProps) { React.useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { if (e.key === 'Escape') { onClose(); } }; if (isOpen) { window.addEventListener('keydown', handleKeyDown); } return () => { window.removeEventListener('keydown', handleKeyDown); }; }, [isOpen, onClose]); if (!isOpen) return null; return (
{/* Modal Header */}

Portfolio Sandbox - Math & Logic Specification

Institutional Specification Manual

{/* Modal Body */}

5. Portfolio Sandbox & Rebalancing Engine

Estimates aggregate portfolio drawdowns and controls covariance drift boundaries.

A. Synthetic Portfolio Model & Asset Weightings

Constructs a continuous synthetic asset representing your active weight allocations and its daily return track:

Active Percentage Weighting () Calculation:

Synthetic Portfolio Log Return ():

B. Linear Mixed Effects Panel Regression (LMM)

Solves the system-wide macro response model across all historical event instances using a Swamy-Arora GLS estimator:

Panel Model Specification with VIX Controls:

where:
- is the relative day offset from event date .
- and are relative phase indicators.
- is the background market-wide volatility covariate.
- is the random group intercept (event instance shock).
- is the residual error.

Optimal Kelly Criterion Position Sizing:

C. Reinvestment & Optimization Generation

Integrates signals across three engines: Scanner (underpriced value), Econometrics (macro event post-event betas), and Insiders (corporate buying). Ranks candidates and suggests target reallocations.

); }