Closes #LATEX-FINAL-FIX - Fix LaTeX syntax and backslash escaping in CryptoDemo

This commit is contained in:
Antigravity Agent
2026-06-17 19:07:23 +02:00
parent 0b42b82a27
commit 9ceea5a13a
3 changed files with 22 additions and 10 deletions

View File

@@ -343,6 +343,18 @@ This document tracks all modifications, npm packages, active compilation states,
* **Active Bugs**: None. * **Active Bugs**: None.
* **Type Checker Status**: Verified 100% clean type verification (`npx tsc --noEmit` returns exit code 0). * **Type Checker Status**: Verified 100% clean type verification (`npx tsc --noEmit` returns exit code 0).
---
## [2026-06-17] - KaTeX Rendering & Escape Character Repair (#LATEX-FINAL-FIX)
### Fixed
* **LaTeX Syntax Formatting**: Resolved LaTeX rendering corruption in the "Explain Calibration" dropdown container and the "Mathematical Formulation Accordion" inside [CryptoDemo.tsx](file:///c:/Users/jannr/.gemini/antigravity/scratch/investment-sandbox/components/modules/crypto/CryptoDemo.tsx) by replacing double-escaped backslashes with single backslashes in raw strings, ensuring proper compilation and correct mathematical representation.
### Active Bugs / Compile Status
* **Active Bugs**: None.
* **Type Checker Status**: Verified 100% clean type verification (`npx tsc --noEmit` returns exit code 0).

View File

@@ -45,7 +45,7 @@ This document serves as the permanent, centralized system architecture design an
* *Features*: Destructured the dual-column layout inside `CryptoDemo.tsx` into centered full-width panels. Added human-readable time conversion for pending countdowns, interactive calibration details toggle, individual horizon accuracy tracking, and an accordion detail toggle showing correctness checkmarks for all 5 models. * *Features*: Destructured the dual-column layout inside `CryptoDemo.tsx` into centered full-width panels. Added human-readable time conversion for pending countdowns, interactive calibration details toggle, individual horizon accuracy tracking, and an accordion detail toggle showing correctness checkmarks for all 5 models.
* *Status*: **Fully Operational (Production Lock)**. * *Status*: **Fully Operational (Production Lock)**.
* **Phase 9.5: Quantitative Hotfix: strict calendar time-locks, local row hiding, Hit Ratio Counter correction, and LaTeX repairs** * **Phase 9.5: Quantitative Hotfix: strict calendar time-locks, local row hiding, Hit Ratio Counter correction, and LaTeX repairs**
* *Features*: Integrated strict system date time-locks to prevent look-ahead resolution. Implemented non-destructive row hiding (`isHidden`) preserving local storage data. Corrected hit ratio formatting and LaTeX formatting. * *Features*: Integrated strict system date time-locks to prevent look-ahead resolution. Implemented non-destructive row hiding (`isHidden`) preserving local storage data. Corrected hit ratio formatting. Repaired KaTeX math formatting inside dropdowns and accordions by converting all double-escaped backslashes to clean single-escaped raw strings.
* *Status*: **Fully Operational (Production Lock)**. * *Status*: **Fully Operational (Production Lock)**.
--- ---

View File

@@ -968,10 +968,10 @@ export default function CryptoDemo() {
<strong>Hit Ratio Counter (Successes vs. Failures)</strong>: Tracks the running count of correct directional predictions (<InlineMath math="\alpha" />) against incorrect ones (<InlineMath math="\beta" />) since initialization. <strong>Hit Ratio Counter (Successes vs. Failures)</strong>: Tracks the running count of correct directional predictions (<InlineMath math="\alpha" />) against incorrect ones (<InlineMath math="\beta" />) since initialization.
</p> </p>
<p className="leading-relaxed"> <p className="leading-relaxed">
<strong>Bayesian Confidence (<InlineMath math="\\mathbb{E}[\\theta]" />)</strong>: Represents the posterior probability expectation that the model is correct, calculated using conjugate Beta updating: <strong>Bayesian Confidence (<InlineMath math="\mathbb{E}[\theta]" />)</strong>: Represents the posterior probability expectation that the model is correct, calculated using conjugate Beta updating:
</p> </p>
<div className="py-1 overflow-x-auto"> <div className="py-1 overflow-x-auto">
<BlockMath math="\\mathbb{E}[\\theta] = \\frac{\\alpha}{\\alpha + \\beta}" /> <BlockMath math="\mathbb{E}[\theta] = \frac{\alpha}{\alpha + \beta}" />
</div> </div>
<p className="leading-relaxed"> <p className="leading-relaxed">
This mathematical calibration dampens overconfident signals when models suffer from historical drift. This mathematical calibration dampens overconfident signals when models suffer from historical drift.
@@ -1502,19 +1502,19 @@ export default function CryptoDemo() {
We model the error rate confidence interval of the model using a Beta distribution. The prior error state is represented by the parameters <InlineMath math="\alpha" /> (Successes) and <InlineMath math="\beta" /> (False Alarms): We model the error rate confidence interval of the model using a Beta distribution. The prior error state is represented by the parameters <InlineMath math="\alpha" /> (Successes) and <InlineMath math="\beta" /> (False Alarms):
</p> </p>
<div className="py-2 overflow-x-auto text-slate-200"> <div className="py-2 overflow-x-auto text-slate-200">
<BlockMath math="P \\sim \\text{Beta}(\\alpha, \\beta) \\quad \\text{with expected value } \\mathbb{E}[P] = \\frac{\\alpha}{\\alpha + \\beta}" /> <BlockMath math="P \sim \text{Beta}(\alpha, \beta) \quad \text{with expected value } \mathbb{E}[P] = \frac{\alpha}{\alpha + \beta}" />
</div> </div>
<p className="mb-2"> <p className="mb-2">
With a new ML signal <InlineMath math="P_{\\text{ML}}" />, we perform a conjugate Bayes update with a confidence weight <InlineMath math="w" />: With a new ML signal <InlineMath math="P_{\text{ML}}" />, we perform a conjugate Bayes update with a confidence weight <InlineMath math="w" />:
</p> </p>
<div className="py-2 overflow-x-auto text-slate-200"> <div className="py-2 overflow-x-auto text-slate-200">
<BlockMath math="\\alpha_{\\text{post}} = \\alpha + w \\cdot P_{\\text{ML}}, \\quad \\beta_{\\text{post}} = \\beta + w \\cdot (1 - P_{\\text{ML}})" /> <BlockMath math="\alpha_{\text{post}} = \alpha + w \cdot P_{\text{ML}}, \quad \beta_{\text{post}} = \beta + w \cdot (1 - P_{\text{ML}})" />
</div> </div>
<div className="py-2 overflow-x-auto text-slate-200"> <div className="py-2 overflow-x-auto text-slate-200">
<BlockMath math="P_{\\text{Posterior}} = \\frac{\\alpha_{\\text{post}}}{\\alpha_{\\text{post}} + \\beta_{\\text{post}}}" /> <BlockMath math="P_{\text{Posterior}} = \frac{\alpha_{\text{post}}}{\alpha_{\text{post}} + \beta_{\text{post}}}" />
</div> </div>
<p className="text-slate-400"> <p className="text-slate-400">
If the model is historically highly unstable (high <InlineMath math="\\beta" />), the Bayesian term corrects an overconfident ML signal downwards, safeguarding the robustness of the system. If the model is historically highly unstable (high <InlineMath math="\beta" />), the Bayesian term corrects an overconfident ML signal downwards, safeguarding the robustness of the system.
</p> </p>
</div> </div>
@@ -1524,10 +1524,10 @@ export default function CryptoDemo() {
The Random Forest simulates an ensemble of 10 weak decision trees. Each tree splits the data based on threshold criteria (e.g., 'Funding Rate &lt; -0.04%' and 'Open Interest &gt; 10%'): The Random Forest simulates an ensemble of 10 weak decision trees. Each tree splits the data based on threshold criteria (e.g., 'Funding Rate &lt; -0.04%' and 'Open Interest &gt; 10%'):
</p> </p>
<div className="py-2 overflow-x-auto text-slate-200"> <div className="py-2 overflow-x-auto text-slate-200">
<BlockMath math="\\text{ML}_{\\text{prob}} = \\frac{1}{M} \\sum_{m=1}^{M} T_m(\\mathbf{x})" /> <BlockMath math="\text{ML}_{\text{prob}} = \frac{1}{M} \sum_{m=1}^{M} T_m(\mathbf{x})" />
</div> </div>
<p className="text-slate-400"> <p className="text-slate-400">
where <InlineMath math="T_m(\\mathbf{x})" /> is the predicted output value of the <InlineMath math="m" />-th decision tree for the feature vector <InlineMath math="\\mathbf{x}" />. where <InlineMath math="T_m(\mathbf{x})" /> is the predicted output value of the <InlineMath math="m" />-th decision tree for the feature vector <InlineMath math="\mathbf{x}" />.
</p> </p>
</div> </div>
</div> </div>