import React from 'react'; import { BookOpen, X } from 'lucide-react'; import 'katex/dist/katex.min.css'; import { BlockMath, InlineMath } from 'react-katex'; interface EconometricsMathModalProps { isOpen: boolean; onClose: () => void; } export default function EconometricsMathModal({ isOpen, onClose }: EconometricsMathModalProps) { 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 */}

Econometrics Workspace - Math & Logic Specification

Institutional Specification Manual

{/* Modal Body */}

1. Econometrics Workspace Engine

Estimates asset reactions to macroeconomic shocks using panel regression, predictions accuracy, and survival durability.

A. Ingestion & Storage Pipeline

A background manager checks event parameters against the simulated current workstation local time (2026-06-11). If an active event's date is in the past:

  • FMP API fetches relative prices for (60-day historical window).
  • Asset curves and the user's manual score are frozen under archivedEvents in econometrics_storage.json.
  • Future edits to the active matrix will never modify archived price vectors.

B. Endogenous Calibration

Active future matrix cells pre-fill suggested scores by looking up the corresponding historical LMM coefficient and scaling it to our native score scale:

C. Linear Mixed Model (LMM) Panel Regression

The engine estimates direct event drift and impact returns, isolating asset-level intercepts as random deviances and purging macro volatility using VIX indices:

{"Where:"}
{"- "}{" is the log-return "}{" of asset "}{" at relative index "}{"."}
{"- "}{" design matrix elements isolate Pre-Event Drift ("}{") and Post-Event Impact ("}{") while controlling for systemic covariates (VIX)."}
{"- "}{" random intercept captures unique baseline asset variance."}
{"- "}{" residuals noise."}

D. ROC Classifier & Youden Threshold

Evaluates prediction accuracy on binary outcomes (rebound return > 0). The Youden index maximizes classifier sensitivity and specificity:

Logistic Probability Projection:

Optimal Youden Index (J):

{"Inverting probability optimal threshold "}{" back to native score "}{" via Logit:"}

E. Kaplan-Meier Survival Curve

Measures trend durability. Survival rates represent the probability of an asset holding its predicted direction before reversing:

{"Where:"}
{"- "}{" is the number of active asset-run observations at risk at day "}{"."}
{"- "}{" is the number of trend-reversal events recorded on day "}{"."}

Reversal trigger with 1% Volatility Buffer:

); }