Refresh QuantLab with a simpler Apple-inspired interface
Browse filesFiles changed (4)
- DESIGN.mdAdded+7
- app.js+10-8
- index.html+17-17
- style.css+1-3
1234567# QuantLab interface
Apple-inspired analytical workspace, requested 26 October 2026. Use the platform system font, a cool neutral canvas (#f5f5f7), white working surfaces, near-black text (#1d1d1f), secondary text (#626268), and functional blue (#0071e3). Main surfaces use 16px radii; controls use 9–10px. Desktop spacing 48px, mobile 20px. Controls are at least 44px tall; mobile inputs are 16px.
Forecast is the default task. Data choice precedes one update action. Synthetic settings, model explanations, benchmark access, scores and machine-readable audits use native disclosure controls. CSV fields appear only for CSV mode. Keep status and data provenance visible. Plain-language chart titles explain their purpose; exact units and scoring definitions stay adjacent. Calculators explain outcomes before numerical solver details.
Four views: Forecast, Calculators, Scenarios, How it works. Preserve keyboard focus, labeled inputs, live result announcements, reduced motion, browser-local data handling, and the distinction between scenario assumptions and calibrated estimates. No imagery or decorative glass is needed. No paid services or external font dependencies.12345673 unmodified lines11121314151617181920212211 unmodified lines34353637383940414243444546474849'use strict';const $=id=>document.getElementById(id),percent=x=>(100*x).toFixed(2)+'%',fmt=x=>Number(x).toFixed(4);let currentReport=null,busy=false,worker=null;const INK='#141414',BLUE='#1d5fbf',GRAY='#858b93';function escapeXML(value){return String(value).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));}function svg(content,label){return `<svg viewBox="0 0 440 220" role="img" aria-label="${escapeXML(label)}">${content}</svg>`;}function grids(max=1){let s='';for(let i=0;i<=4;i++){let y=175-150*i/4;s+=`<line class="grid" x1="40" x2="430" y1="${y}" y2="${y}"/><text x="32" y="${y+4}" text-anchor="end">${(max*i/4*100).toFixed(0)}%</text>`;}return s;}3 unmodified linesfor(const [cls,color,label]of [[0,BLUE,'Downside'],[2,INK,'Up']]){const bins=Array.from({length:10},()=>[]);rows.forEach(row=>bins[Math.min(9,Math.floor(row.probabilities[cls]*10))].push(row));let points=[];bins.forEach(bin=>{if(!bin.length)return;const p=bin.reduce((a,r)=>a+r.probabilities[cls],0)/bin.length,o=bin.reduce((a,r)=>a+(cls===0?r.actual_log_return<-.02:r.actual_log_return>0),0)/bin.length;const x=40+p*390,y=175-o*150;points.push([x,y]);s+=`<circle cx="${x}" cy="${y}" r="${Math.min(8,3+Math.sqrt(bin.length)/3)}" fill="${color}" opacity=".8"><title>${label}: predicted ${percent(p)}, observed ${percent(o)}, n=${bin.length}</title></circle>`;});if(points.length>1)s+=`<path d="${points.map(([x,y],i)=>`${i?'L':'M'}${x},${y}`).join(' ')}" fill="none" stroke="${color}" stroke-width="1"/>`;}s+='<text x="40" y="199">0%</text><text x="430" y="199" text-anchor="end">100% predicted</text><text x="125" y="219" fill="#1d5fbf">Downside</text><text x="255" y="219">Up</text>';$('calibration-chart').innerHTML=svg(s,'Reliability bins: mean predicted probability versus observed event frequency');}function drawScores(metrics){const names=Object.keys(metrics).sort((a,b)=>metrics[a].log_loss-metrics[b].log_loss),max=Math.max(...names.map(n=>metrics[n].log_loss))*1.13;let s='';names.forEach((name,i)=>{const step=150/names.length,y=20+i*step,w=metrics[name].log_loss/max*275;s+=`<text x="100" y="${y+15}" text-anchor="end">${escapeXML(name)}</text><rect x="112" y="${y}" height="${Math.min(25,step-6)}" width="${w}" fill="${name==='empirical'?BLUE:INK}"/><text x="${118+w}" y="${y+15}">${fmt(metrics[name].log_loss)}</text>`;});s+='<text x="112" y="202">0</text><text x="430" y="202" text-anchor="end">Multiclass log loss</text>';$('score-chart').innerHTML=svg(s,'Out-of-sample log loss for each model, lower is better');}function setBusy(value,message){busy=value;$('run').disabled=value;$('benchmark').disabled=value;$('run').textContent=value?'Fitting chronological models…':'Run chronological experiment';$('status').classList.remove('error');if(message)$('status').textContent=message;}function fail(message){setBusy(false);$('status').textContent=message;$('status').classList.add('error');}function render(report,source,dates,diagnostics){currentReport={...report,source,diagnostics};const q=report.latest_forecast.probabilities;$('stats').replaceChildren();for(const [label,value]of [['P(downside)',percent(q[0])],['P(positive)',percent(q[2])],['Test log loss',fmt(report.selected_metrics.log_loss)],['Unseen observations',report.test_observations.toLocaleString()]]){const div=document.createElement('div'),span=document.createElement('span'),strong=document.createElement('strong');span.textContent=label;strong.textContent=value;div.append(span,strong);$('stats').append(div);}const kind=report.precomputed?'PRECOMPUTED PYTHON BENCHMARK':source.synthetic?'SYNTHETIC · BROWSER FIT':'LOCAL CSV · BROWSER FIT';$('status').textContent=`${kind} · ${source.rows.toLocaleString()} closes · latest model: ${report.latest_forecast.model}. ${report.precomputed?'Saved run; Python libraries are not executing here.':'Models fit in your browser. CSV contents are not sent to a modeling server.'}`;const vol=report.latest_forecast.candidate_volatility_annualized; $('volatility-note').textContent=vol?`Latest residual volatility: EWMA ${percent(vol.ewma)}, constant ridge ${percent(vol.ridge)} annualized. Assumes 252 equal-length observations; CSV gaps may invalidate this scaling.`:'This saved Python benchmark predates the browser EWMA challenger.';drawProbabilities(q);drawTimeline(report.predictions,dates);drawCalibration(report.predictions);drawScores(report.candidate_metrics);11 unmodified linesif(worker)worker.terminate();worker=new Worker('worker.js');worker.onmessage=event=>{if(event.data.error){fail(event.data.error);return;}const report=event.data.report;report.predictions.forEach(r=>{r.feature_date=dates[r.feature_index];r.target_date=dates[r.target_index];});report.latest_forecast.feature_date=dates.at(-1);render(report,source,dates,event.data.diagnostics);};worker.onerror=()=>fail('Browser calculation could not finish. Try fewer observations or download the Python project.');worker.postMessage({closes});}catch(error){fail(error.message);}}$('experiment').addEventListener('submit',event=>{event.preventDefault();run();});$('csv-file').addEventListener('change',()=>{if($('csv-file').files.length)$('data-source').value='csv';});$('benchmark').addEventListener('click',async()=>{if(busy)return;setBusy(true,'Loading a saved Python benchmark; no Python models are executing…');try{const response=await fetch('benchmark.json');if(!response.ok)throw Error('The benchmark file could not be loaded.');const report=await response.json();render(report,report.source,null,report.diagnostics);}catch(error){fail(error.message);}});$('download').addEventListener('click',()=>{if(!currentReport)return;const blob=new Blob([JSON.stringify(currentReport,null,2)],{type:'application/json'}),url=URL.createObjectURL(blob),a=document.createElement('a');a.href=url;a.download='quantlab-report.json';a.click();setTimeout(()=>URL.revokeObjectURL(url),1000);});document.querySelectorAll('[data-view]').forEach(button=>button.addEventListener('click',()=>{document.querySelectorAll('[data-view]').forEach(b=>{const active=b===button;b.classList.toggle('active',active);b.setAttribute('aria-pressed',String(active));});document.querySelectorAll('.view').forEach(section=>section.hidden=section.id!==button.dataset.view);}));function updateGame(){try{$('game-output').textContent=JSON.stringify(QuantLabs.game($('game').value),null,2);}catch(error){$('game-output').textContent=error.message;}}$('game').addEventListener('change',updateGame);function updateRisk(){try{const data=new FormData($('risk-form')),value=name=>Number(data.get(name));$('risk-output').textContent=JSON.stringify({black_scholes:QuantLabs.blackScholes(value('spot'),value('strike'),value('years'),.03,value('vol')),quarter_kelly_binary_fraction:QuantLabs.kelly(value('probability'),value('odds'))},null,2);}catch(error){$('risk-output').textContent=error.message;}}$('risk-form').addEventListener('submit',event=>{event.preventDefault();updateRisk();});updateGame();updateRisk();run();function updateIV(){const out=$('iv-output');try{const data=new FormData($('iv-form')),value=name=>Number(data.get(name));const result=QuantScenarios.impliedVolatility({spot:value('spot'),strike:value('strike'),years:value('years'),rate:value('rate'),premium:value('premium'),type:data.get('type')});out.classList.remove('lab-error');out.textContent=JSON.stringify({...result,annualized_volatility_percent:result.volatility*100,scope:'European no-dividend Black–Scholes implied volatility; risk-neutral pricing input, not a real-world return probability.'},null,2);}catch(error){out.classList.add('lab-error');out.textContent=error.message;}}$('iv-form').addEventListener('submit',event=>{event.preventDefault();updateIV();});function drawScenario(grid,kind){const left=grid[0].x,right=grid.at(-1).x,key=kind==='pdf'?'pdf':'cdf',comparison=kind==='pdf'?'gaussianPdf':'gaussianCdf';const max=kind==='pdf'?Math.max(...grid.map(p=>Math.max(p.pdf,p.gaussianPdf)))*1.05:1;let s='';for(let i=0;i<=4;i++){const y=175-i*150/4,value=max*i/4;s+=`<line class="grid" x1="45" x2="425" y1="${y}" y2="${y}"/><text x="38" y="${y+4}" text-anchor="end">${kind==='cdf'?Math.round(value*100)+'%':value.toFixed(value>10?0:1)}</text>`;}for(const [column,color,dash]of [[comparison,GRAY,'4 3'],[key,BLUE,'']]){const d=grid.map((p,i)=>`${i?'L':'M'}${45+(p.x-left)/(right-left)*380},${175-p[column]/max*150}`).join(' ');s+=`<path d="${d}" fill="none" stroke="${color}" stroke-width="1.5" stroke-dasharray="${dash}"/>`;}s+=`<text x="45" y="200">${(left*100).toFixed(1)}%</text><text x="425" y="200" text-anchor="end">${(right*100).toFixed(1)}%</text><text x="235" y="219" text-anchor="middle">Log return · blue jump mixture / gray normal</text>`;$(kind==='pdf'?'jump-pdf':'jump-cdf').innerHTML=svg(s,kind==='pdf'?'Jump-mixture and same-moment normal probability densities':'Jump-mixture and same-moment normal cumulative probabilities');}function updateJump(){const status=$('jump-status');try{const data=new FormData($('jump-form')),value=name=>Number(data.get(name));const result=QuantScenarios.jumpDistribution({mu:value('mu'),sigma:value('sigma'),intensity:value('intensity'),jumpMean:value('jumpMean'),jumpStd:value('jumpStd'),years:value('horizon')/252,threshold:value('threshold')});status.classList.remove('lab-error');const error=Math.abs(result.gridPdfMass-result.gridCDFMass);status.textContent=error>.005?'Plot resolution warning: the PDF grid does not accurately integrate this scenario. Use the direct CDF probabilities and inspect the numerical audit.':'Scenario calculated locally. Probabilities follow your assumptions; they are not calibrated forecasts.';if(error>.005)status.classList.add('lab-error');$('jump-stats').replaceChildren();for(const [label,text]of [['Scenario downside',percent(result.downsideProbability)],['Matched normal downside',percent(result.gaussianDownsideProbability)],['Poisson mass omitted',result.omittedPoissonMass.toExponential(2)]]){const div=document.createElement('div'),span=document.createElement('span'),strong=document.createElement('strong');span.textContent=label;strong.textContent=text;div.append(span,strong);$('jump-stats').append(div);}drawScenario(result.grid,'pdf');drawScenario(result.grid,'cdf');const {grid,...audit}=result;$('jump-audit').textContent=JSON.stringify(audit,null,2);}catch(error){status.classList.add('lab-error');status.textContent=error.message;$('jump-stats').replaceChildren();$('jump-pdf').replaceChildren();$('jump-cdf').replaceChildren();$('jump-audit').textContent='No valid scenario. Correct the inputs and calculate again.';}}12345673 unmodified lines11121314151617181920212211 unmodified lines343536373839404142434445464748495051'use strict';const $=id=>document.getElementById(id),percent=x=>(100*x).toFixed(2)+'%',fmt=x=>Number(x).toFixed(4);let currentReport=null,busy=false,worker=null;const INK='#34343a',BLUE='#0066cc',GRAY='#767680';function escapeXML(value){return String(value).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));}function svg(content,label){return `<svg viewBox="0 0 440 220" role="img" aria-label="${escapeXML(label)}">${content}</svg>`;}function grids(max=1){let s='';for(let i=0;i<=4;i++){let y=175-150*i/4;s+=`<line class="grid" x1="40" x2="430" y1="${y}" y2="${y}"/><text x="32" y="${y+4}" text-anchor="end">${(max*i/4*100).toFixed(0)}%</text>`;}return s;}3 unmodified linesfor(const [cls,color,label]of [[0,BLUE,'Downside'],[2,INK,'Up']]){const bins=Array.from({length:10},()=>[]);rows.forEach(row=>bins[Math.min(9,Math.floor(row.probabilities[cls]*10))].push(row));let points=[];bins.forEach(bin=>{if(!bin.length)return;const p=bin.reduce((a,r)=>a+r.probabilities[cls],0)/bin.length,o=bin.reduce((a,r)=>a+(cls===0?r.actual_log_return<-.02:r.actual_log_return>0),0)/bin.length;const x=40+p*390,y=175-o*150;points.push([x,y]);s+=`<circle cx="${x}" cy="${y}" r="${Math.min(8,3+Math.sqrt(bin.length)/3)}" fill="${color}" opacity=".8"><title>${label}: predicted ${percent(p)}, observed ${percent(o)}, n=${bin.length}</title></circle>`;});if(points.length>1)s+=`<path d="${points.map(([x,y],i)=>`${i?'L':'M'}${x},${y}`).join(' ')}" fill="none" stroke="${color}" stroke-width="1"/>`;}s+='<text x="40" y="199">0%</text><text x="430" y="199" text-anchor="end">100% predicted</text><text x="125" y="219" fill="#1d5fbf">Downside</text><text x="255" y="219">Up</text>';$('calibration-chart').innerHTML=svg(s,'Reliability bins: mean predicted probability versus observed event frequency');}function drawScores(metrics){const names=Object.keys(metrics).sort((a,b)=>metrics[a].log_loss-metrics[b].log_loss),max=Math.max(...names.map(n=>metrics[n].log_loss))*1.13;let s='';names.forEach((name,i)=>{const step=150/names.length,y=20+i*step,w=metrics[name].log_loss/max*275;s+=`<text x="100" y="${y+15}" text-anchor="end">${escapeXML(name)}</text><rect x="112" y="${y}" height="${Math.min(25,step-6)}" width="${w}" fill="${name==='empirical'?BLUE:INK}"/><text x="${118+w}" y="${y+15}">${fmt(metrics[name].log_loss)}</text>`;});s+='<text x="112" y="202">0</text><text x="430" y="202" text-anchor="end">Multiclass log loss</text>';$('score-chart').innerHTML=svg(s,'Out-of-sample log loss for each model, lower is better');}function setBusy(value,message){busy=value;$('run').disabled=value;$('benchmark').disabled=value;$('run').textContent=value?'Fitting chronological models…':'Update forecast';$('status').classList.remove('error');if(message)$('status').textContent=message;}function fail(message){setBusy(false);$('status').textContent=message;$('status').classList.add('error');}function render(report,source,dates,diagnostics){currentReport={...report,source,diagnostics};const q=report.latest_forecast.probabilities;$('stats').replaceChildren();for(const [label,value]of [['Downside · below −2%¹',percent(q[0])],['Positive return',percent(q[2])],['Prediction error²',fmt(report.selected_metrics.log_loss)],['Unseen observations',report.test_observations.toLocaleString()]]){const div=document.createElement('div'),span=document.createElement('span'),strong=document.createElement('strong');span.textContent=label;strong.textContent=value;div.append(span,strong);$('stats').append(div);}const kind=report.precomputed?'Saved Python example':source.synthetic?'Simulated example':'Your CSV';$('status').textContent=`${kind} · ${source.rows.toLocaleString()} closes · latest model: ${report.latest_forecast.model}. ${report.precomputed?'Saved run; Python libraries are not executing here.':'Models fit in your browser. CSV contents are not sent to a modeling server.'}`;const vol=report.latest_forecast.candidate_volatility_annualized; $('volatility-note').textContent=vol?`Latest residual volatility: EWMA ${percent(vol.ewma)}, constant ridge ${percent(vol.ridge)} annualized. Assumes 252 equal-length observations; CSV gaps may invalidate this scaling.`:'This saved Python benchmark predates the browser EWMA challenger.';drawProbabilities(q);drawTimeline(report.predictions,dates);drawCalibration(report.predictions);drawScores(report.candidate_metrics);11 unmodified linesif(worker)worker.terminate();worker=new Worker('worker.js');worker.onmessage=event=>{if(event.data.error){fail(event.data.error);return;}const report=event.data.report;report.predictions.forEach(r=>{r.feature_date=dates[r.feature_index];r.target_date=dates[r.target_index];});report.latest_forecast.feature_date=dates.at(-1);render(report,source,dates,event.data.diagnostics);};worker.onerror=()=>fail('Browser calculation could not finish. Try fewer observations or download the Python project.');worker.postMessage({closes});}catch(error){fail(error.message);}}$('experiment').addEventListener('submit',event=>{event.preventDefault();run();});function syncSource(){const csv=$('data-source').value==='csv';$('csv-controls').hidden=!csv;$('demo-settings').hidden=csv;$('observations').required=!csv;$('seed').required=!csv;}$('data-source').addEventListener('change',syncSource);$('csv-file').addEventListener('change',()=>{if($('csv-file').files.length)$('data-source').value='csv';syncSource();});syncSource();$('benchmark').addEventListener('click',async()=>{if(busy)return;setBusy(true,'Loading a saved Python benchmark; no Python models are executing…');try{const response=await fetch('benchmark.json');if(!response.ok)throw Error('The benchmark file could not be loaded.');const report=await response.json();render(report,report.source,null,report.diagnostics);}catch(error){fail(error.message);}});$('download').addEventListener('click',()=>{if(!currentReport)return;const blob=new Blob([JSON.stringify(currentReport,null,2)],{type:'application/json'}),url=URL.createObjectURL(blob),a=document.createElement('a');a.href=url;a.download='quantlab-report.json';a.click();setTimeout(()=>URL.revokeObjectURL(url),1000);});document.querySelectorAll('[data-view]').forEach(button=>button.addEventListener('click',()=>{document.querySelectorAll('[data-view]').forEach(b=>{const active=b===button;b.classList.toggle('active',active);b.setAttribute('aria-pressed',String(active));});document.querySelectorAll('.view').forEach(section=>section.hidden=section.id!==button.dataset.view);}));function updateGame(){try{const g=QuantLabs.game($('game').value);$('game-output').textContent=g.mixed?'A balanced mixed strategy\n\nEach player chooses either action with 50% probability. Neither can improve by changing strategy alone. The expected payoff is zero: one player’s gain is the other’s loss.':'Individual incentives, shared cost\n\nDefect is each player’s dominant strategy. Both defecting is the Nash equilibrium, with a payoff of 1 each. Both cooperating gives 3 each, so the equilibrium is not Pareto efficient.';}catch(error){$('game-output').textContent=error.message;}}$('game').addEventListener('change',updateGame);function updateRisk(){try{const data=new FormData($('risk-form')),value=name=>Number(data.get(name));const price=QuantLabs.blackScholes(value('spot'),value('strike'),value('years'),.03,value('vol'));$('risk-output').textContent=`European call ${price.call.toFixed(4)}\nEuropean put ${price.put.toFixed(4)}\n\nQuarter-Kelly fraction ${percent(QuantLabs.kelly(value('probability'),value('odds')))}\n\nOption values use the same price units as spot. Kelly applies only to the specified fixed-payoff binary bet.`;}catch(error){$('risk-output').textContent=error.message;}}$('risk-form').addEventListener('submit',event=>{event.preventDefault();updateRisk();});updateGame();updateRisk();run();function updateIV(){const out=$('iv-output');try{const data=new FormData($('iv-form')),value=name=>Number(data.get(name));const result=QuantScenarios.impliedVolatility({spot:value('spot'),strike:value('strike'),years:value('years'),rate:value('rate'),premium:value('premium'),type:data.get('type')});out.classList.remove('lab-error');out.textContent=`Implied annual volatility ${percent(result.volatility)}\n\nThe volatility that reproduces your premium under European, no-dividend Black–Scholes pricing. This is a risk-neutral pricing input, not a real-world return probability.\n\nSolver details\n${JSON.stringify(result,null,2)}`;}catch(error){out.classList.add('lab-error');out.textContent=error.message;}}$('iv-form').addEventListener('submit',event=>{event.preventDefault();updateIV();});function drawScenario(grid,kind){const left=grid[0].x,right=grid.at(-1).x,key=kind==='pdf'?'pdf':'cdf',comparison=kind==='pdf'?'gaussianPdf':'gaussianCdf';const max=kind==='pdf'?Math.max(...grid.map(p=>Math.max(p.pdf,p.gaussianPdf)))*1.05:1;let s='';for(let i=0;i<=4;i++){const y=175-i*150/4,value=max*i/4;s+=`<line class="grid" x1="45" x2="425" y1="${y}" y2="${y}"/><text x="38" y="${y+4}" text-anchor="end">${kind==='cdf'?Math.round(value*100)+'%':value.toFixed(value>10?0:1)}</text>`;}for(const [column,color,dash]of [[comparison,GRAY,'4 3'],[key,BLUE,'']]){const d=grid.map((p,i)=>`${i?'L':'M'}${45+(p.x-left)/(right-left)*380},${175-p[column]/max*150}`).join(' ');s+=`<path d="${d}" fill="none" stroke="${color}" stroke-width="1.5" stroke-dasharray="${dash}"/>`;}s+=`<text x="45" y="200">${(left*100).toFixed(1)}%</text><text x="425" y="200" text-anchor="end">${(right*100).toFixed(1)}%</text><text x="235" y="219" text-anchor="middle">Log return · blue jump mixture / gray normal</text>`;$(kind==='pdf'?'jump-pdf':'jump-cdf').innerHTML=svg(s,kind==='pdf'?'Jump-mixture and same-moment normal probability densities':'Jump-mixture and same-moment normal cumulative probabilities');}function updateJump(){const status=$('jump-status');try{const data=new FormData($('jump-form')),value=name=>Number(data.get(name));const result=QuantScenarios.jumpDistribution({mu:value('mu'),sigma:value('sigma'),intensity:value('intensity'),jumpMean:value('jumpMean'),jumpStd:value('jumpStd'),years:value('horizon')/252,threshold:value('threshold')});status.classList.remove('lab-error');const error=Math.abs(result.gridPdfMass-result.gridCDFMass);status.textContent=error>.005?'Plot resolution warning: the PDF grid does not accurately integrate this scenario. Use the direct CDF probabilities and inspect the numerical audit.':'Scenario calculated locally. Probabilities follow your assumptions; they are not calibrated forecasts.';if(error>.005)status.classList.add('lab-error');$('jump-stats').replaceChildren();for(const [label,text]of [['Scenario downside',percent(result.downsideProbability)],['Matched normal downside',percent(result.gaussianDownsideProbability)],['Poisson mass omitted',result.omittedPoissonMass.toExponential(2)]]){const div=document.createElement('div'),span=document.createElement('span'),strong=document.createElement('strong');span.textContent=label;strong.textContent=text;div.append(span,strong);$('jump-stats').append(div);}drawScenario(result.grid,'pdf');drawScenario(result.grid,'cdf');const {grid,...audit}=result;$('jump-audit').textContent=JSON.stringify(audit,null,2);}catch(error){status.classList.add('lab-error');status.textContent=error.message;$('jump-stats').replaceChildren();$('jump-pdf').replaceChildren();$('jump-cdf').replaceChildren();$('jump-audit').textContent='No valid scenario. Correct the inputs and calculate again.';}}
1 unmodified line2345678910111213141516171819202122232425262728293031323334353637383940411 unmodified line<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="theme-color" content="#f2f4f7"><meta name="description" content="Browser-local probability research with chronological validation and a reproducible Python benchmark."><meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self'; worker-src 'self'; connect-src 'self'; img-src 'self' data:; object-src 'none'; base-uri 'none'"><title>QuantLab · probability research</title><link rel="stylesheet" href="style.css"><script src="labs.js" defer></script><script src="scenarios.js" defer></script><script src="app.js" defer></script></head><body><a class="skip" href="#results">Skip to results</a><header><div><h1>QuantLab <span>/ probability research</span></h1><p>Forecast the next observed close. Inspect calibration before trusting conviction.</p></div><a class="source-link" href="python-project.zip" download>Download Python project ↗</a></header><nav aria-label="Research views"><button class="tab active" data-view="workbench" aria-pressed="true">Forecast workbench</button><button class="tab" data-view="mathematics" aria-pressed="false">Mathematics lab</button><button class="tab" data-view="distributions" aria-pressed="false">Distribution lab</button><button class="tab" data-view="methods" aria-pressed="false">Methods & limits</button></nav><main><section id="workbench" class="view"><aside><form id="experiment"><h2>Experiment setup</h2><p class="small">No paid compute. CSV data stays in your browser.</p><label for="data-source">Data source</label><select id="data-source"><option value="synthetic">Synthetic demo</option><option value="csv">Local CSV</option></select><label for="csv-file">CSV · date,close</label><input id="csv-file" type="file" accept=".csv,text/csv"><p class="hint">714–2,500 rows · 2 MiB maximum · adjusted closes · ascending ISO dates</p><label for="observations">Synthetic observations</label><input id="observations" type="number" min="850" max="2500" step="50" value="1200" required><label for="seed">Random seed</label><input id="seed" type="number" min="0" max="100000" step="1" value="42" required><div class="model-list"><h3>Browser models</h3><p>Empirical frequency<br>Ridge + Gaussian residuals<br>EWMA residual volatility<br>Multinomial logistic</p><span class="hint">Train → calibrate → unseen test.<br>Selection uses calibration scores only.</span></div><button id="run" class="primary" type="submit">Run chronological experiment</button></form><div class="benchmark-control"><h2>Python benchmark</h2><p class="small">Inspect a saved, verified run with scikit-learn, XGBoost, LightGBM, Optuna and SHAP.</p><button id="benchmark" class="secondary">Load precomputed benchmark</button><p class="hint">Synthetic data · 900 observations.<br>Python libraries do not run on this static host.</p></div></aside><div id="results" tabindex="-1"><div id="status" role="status" aria-live="polite">Preparing a browser-local synthetic experiment…</div><div class="stats" id="stats"><div><span>P(downside)</span><strong>—</strong></div><div><span>P(positive)</span><strong>—</strong></div><div><span>Test log loss</span><strong>—</strong></div><div><span>Unseen observations</span><strong>—</strong></div></div><p class="small" id="volatility-note"></p><div class="charts"><section class="plot"><h2>Next observed close</h2><p>Mutually exclusive log-return events</p><div id="probability-chart" class="chart"></div></section><section class="plot"><h2>Downside through time</h2><p>Probabilities on unseen observations</p><div id="timeline-chart" class="chart"></div></section><section class="plot"><h2>Calibration</h2><p>Sample counts matter; sparse bins are noisy</p><div id="calibration-chart" class="chart"></div></section><section class="plot"><h2>Candidate comparison</h2><p>Outer-test log loss · lower is better</p><div id="score-chart" class="chart"></div></section></div><section class="scores"><h2>Same-history evidence</h2><p id="score-note" class="small">Comparative test scores appear after a run.</p><div class="table-scroll"><table><caption class="sr-only">Candidate test scores</caption><thead><tr><th scope="col">Model</th><th scope="col">Scored rows</th><th scope="col">Log loss</th><th scope="col">Brier</th><th scope="col">Up Brier</th><th scope="col">Downside Brier</th></tr></thead><tbody id="scores-body"></tbody></table></div></section><div class="audit-grid"><details><summary>Chronology & run audit</summary><pre id="audit">No completed run.</pre></details><details><summary>Distribution diagnostics</summary><pre id="diagnostics">No completed run.</pre></details><details><summary>SHAP & Python provenance</summary><pre id="explanations">Load the precomputed Python benchmark to inspect its tree explanation.</pre></details></div><button id="download" class="secondary" disabled>Download current report JSON</button><p class="hint">A probability forecast is not an executable trade. No historical investment edge is established.</p></div></section><section id="mathematics" class="view" hidden><h2>Incentives, prices & sizing</h2><p>Separate mathematical examples. These assumptions do not establish a market forecasting edge.</p><div class="lab-grid"><section class="plot"><h3>Two-player games</h3><label for="game">Game</label><select id="game"><option value="prisoner">Prisoner’s dilemma</option><option value="matching">Matching pennies</option></select><pre id="game-output"></pre></section><section class="plot"><h3>Option prices & binary Kelly</h3><form id="risk-form"><div class="input-grid"><label>Spot<input name="spot" type="number" min="1" step="1" value="100" required></label><label>Strike<input name="strike" type="number" min="1" step="1" value="100" required></label><label>Years<input name="years" type="number" min="0.01" max="10" step="0.01" value="1" required></label><label>Annual volatility<input name="vol" type="number" min="0.01" max="3" step="0.01" value="0.2" required></label><label>Binary win probability<input name="probability" type="number" min="0" max="1" step="0.01" value="0.55" required></label><label>Net binary payoff odds<input name="odds" type="number" min="0.1" max="10" step="0.1" value="1" required></label></div><button class="secondary">Calculate</button></form><pre id="risk-output" aria-live="polite"></pre><p class="hint">Black–Scholes: European, no dividends, constant volatility and 3% rate. Kelly: capped quarter-Kelly for a fixed-payoff binary bet, not an equity allocation.</p></section></div><section class="plot iv-lab"><h3>Implied volatility from an option premium</h3><p>European Black–Scholes inversion; no dividends. Risk-neutral pricing inputs stay separate from historical forecast probabilities.</p><form id="iv-form"><div class="input-grid"><label>Spot<input name="spot" type="number" min="0.01" value="100" step="0.01" required></label><label>Strike<input name="strike" type="number" min="0.01" value="100" step="0.01" required></label><label>Maturity · years<input name="years" type="number" min="0.001" max="10" value="1" step="0.001" required></label><label>Annual continuously compounded rate<input name="rate" type="number" min="-1" max="1" value="0.03" step="0.01" required></label><label>Observed premium · same units as spot<input name="premium" type="number" min="0" value="9.4134" step="0.0001" required></label><label>Option type<select name="type"><option value="call">Call</option><option value="put">Put</option></select></label></div><button class="secondary">Solve implied volatility</button></form><pre id="iv-output" aria-live="polite"></pre></section></section><section id="distributions" class="view" hidden><h2>Jump-diffusion distribution explorer</h2><p class="scenario-note">User-specified scenarios, separate from the forecast workbench. No parameters are fitted to uploaded prices. These are not option-implied or calibrated market probabilities.</p><div class="scenario-layout"><form id="jump-form"><h3>Annual parameters</h3><label>Expected simple-return drift<input name="mu" type="number" min="-1" max="1" step="0.01" value="0.06" required></label><label>Diffusion volatility<input name="sigma" type="number" min="0.01" max="2" step="0.01" value="0.2" required></label><label>Expected jumps per year<input name="intensity" type="number" min="0" max="50" step="0.5" value="2" required></label><label>Mean log jump size<input name="jumpMean" type="number" min="-1" max="1" step="0.01" value="-0.08" required></label><label>Log jump standard deviation<input name="jumpStd" type="number" min="0" max="1" step="0.01" value="0.1" required></label><label>Horizon · observations<input name="horizon" type="number" min="1" max="252" step="1" value="21" required></label><label>Downside log-return threshold<input name="threshold" type="number" min="-2" max="2" step="0.01" value="-0.02" required></label><button class="primary">Calculate scenario distribution</button><p class="hint">252 equal-length observations per year assumed. All return parameters are decimals. Jump compensation preserves the chosen expected simple-return drift.</p></form><div><div id="jump-status" role="status" aria-live="polite"></div><div class="stats" id="jump-stats"></div><div class="charts"><section class="plot"><h3>Probability density · PDF</h3><p>Density can exceed one; area gives probability.</p><div id="jump-pdf" class="chart"></div></section><section class="plot"><h3>Cumulative probability · CDF</h3><p>Blue: jump mixture. Gray: moment-matched normal.</p><div id="jump-cdf" class="chart"></div></section></div><details><summary>Scenario assumptions & numerical mass audit</summary><pre id="jump-audit"></pre></details></div></div></section><section id="methods" class="view prose" hidden><h2>What runs here</h2><p>This is a free Static Hugging Face Space. Browser models fit locally in a web worker. CSV contents are read by your browser; they are not uploaded to a modeling server. No API key, external data feed or paid compute is required.</p><h3>Validation contract</h3><p>At close t, returns, momentum, realized volatility and drawdown use only observations through t. Models fit on earlier rows, then calibrate and select on a later block. A one-row embargo separates each boundary. Initial training uses 500 rows, calibration 150 and outer test blocks 200. Never tune using the outer test charts.</p><p>The target is the next observed close’s log return. Downside is below −0.02 log return, approximately −1.98% simple return; the middle event includes both boundaries, and the final event is a positive return. Probabilities sum to one.</p><h3>EWMA challenger</h3><p>The ridge mean stays frozen within each fold. Residual variance updates online with a fixed 20-observation half-life, using only outcomes already known before each forecast. Its own target never updates its own variance. The audit records volatility and timing; annualization assumes 252 equal-length observations and is only illustrative for gapped CSVs.</p><h3>Two distinct execution modes</h3><p><b>Browser experiment:</b> empirical frequencies, ridge with Gaussian residual probabilities, EWMA residual-volatility probabilities, and multinomial logistic regression are fitted to the selected data. Synthetic JavaScript draws differ from Python even with the same seed.</p><p><b>Precomputed Python benchmark:</b> a saved 900-observation synthetic run actually fitted scikit-learn, XGBoost and LightGBM, completed three training-only Optuna trials, computed SHAP and recorded MLflow metrics. Loading it does not execute those libraries. Download the full Python/Gradio project to run them locally.</p><h3>Implementation limits</h3><p>Calibration reuses data for temperatures and model choice. Financial tails and nonstationarity can invalidate normal residual assumptions. Tiny test samples and sparse reliability bins are especially unreliable. SHAP explains uncalibrated raw class margins, not causal effects. Close-based information does not imply executable same-close fills. No costs, live trading or economic backtest is included.</p><p>TFT, DeepSurv, PPO, calibrated rough-volatility models, SPDE solvers and quantum algorithms remain unimplemented. Qiskit has no defined task here; TensorFlow would duplicate the optional PyTorch backend. The downloadable project records all requested books and access limits; full books were not read.</p><p>The implied-volatility solver and jump-mixture PDF/CDF explorer are independently implemented standard methods inspired by <a href="https://github.com/quantmind/quantflow">Quantflow</a>. No upstream source is copied and the Python package is not installed in this static host.</p><p><a href="METHODS.md">Detailed method & provenance notes</a> · <a href="python-project.zip" download>Full Python source and tests</a></p></section></main><footer><span>QuantLab · research estimates, explicit assumptions.</span><span>Browser-local modeling / no paid compute</span></footer></body></html>1 unmodified line2345678910111213141516171819202122232425262728293031323334353637383940411 unmodified line<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="theme-color" content="#f5f5f7"><meta name="description" content="Browser-local probability research with chronological validation and a reproducible Python benchmark."><meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self'; worker-src 'self'; connect-src 'self'; img-src 'self' data:; object-src 'none'; base-uri 'none'"><title>QuantLab · probability research</title><link rel="stylesheet" href="style.css?v=20261026"><script src="labs.js" defer></script><script src="scenarios.js" defer></script><script src="app.js?v=20261026" defer></script></head><body><a class="skip" href="#results">Skip to results</a><header><div><h1>QuantLab<span>Probability, made clearer.</span></h1><p>Explore what could happen next. Understand the evidence behind every estimate.</p></div><a class="source-link" href="python-project.zip" download>Download Python project</a></header><nav aria-label="Research views"><button class="tab active" data-view="workbench" aria-pressed="true">Forecast</button><button class="tab" data-view="mathematics" aria-pressed="false">Calculators</button><button class="tab" data-view="distributions" aria-pressed="false">Scenarios</button><button class="tab" data-view="methods" aria-pressed="false">How it works</button></nav><main><section id="workbench" class="view"><aside><form id="experiment"><h2>Start with your data.</h2><p class="small">Try the example, or explore your own closing prices. Everything runs in your browser.</p><label for="data-source">Data source</label><select id="data-source"><option value="synthetic">Synthetic demo</option><option value="csv">Local CSV</option></select><div id="csv-controls" hidden><label for="csv-file">CSV · date,close</label><input id="csv-file" type="file" accept=".csv,text/csv"><p class="hint">714–2,500 rows · 2 MiB maximum · adjusted closes · ascending ISO dates</p></div><details id="demo-settings"><summary>Example settings</summary><label for="observations">Synthetic observations</label><input id="observations" type="number" min="850" max="2500" step="50" value="1200" required><label for="seed">Random seed</label><input id="seed" type="number" min="0" max="100000" step="1" value="42" required></details><details class="model-list"><summary>Models & validation</summary><h3>Browser models</h3><p>Empirical frequency<br>Ridge + Gaussian residuals<br>EWMA residual volatility<br>Multinomial logistic</p><span class="hint">Train → calibrate → unseen test.<br>Selection uses calibration scores only.</span></details><button id="run" class="primary" type="submit">Update forecast</button></form><details class="benchmark-control"><summary>Explore the Python benchmark</summary><p class="small">Inspect a saved, verified run with scikit-learn, XGBoost, LightGBM, Optuna and SHAP.</p><button id="benchmark" class="secondary">Load precomputed benchmark</button><p class="hint">Synthetic data · 900 observations.<br>Python libraries do not run on this static host.</p></details></aside><div id="results" tabindex="-1"><div class="results-heading"><h2>Your forecast.</h2><p>Three possible outcomes for the next closing price.</p></div><div id="status" role="status" aria-live="polite">Preparing a browser-local synthetic experiment…</div><div class="stats" id="stats"><div><span>P(downside)</span><strong>—</strong></div><div><span>P(positive)</span><strong>—</strong></div><div><span>Test log loss</span><strong>—</strong></div><div><span>Unseen observations</span><strong>—</strong></div></div><p class="hint">¹ Below −0.02 log return (about −1.98% price change). ² Multiclass log loss; lower is better.</p><p class="small" id="volatility-note"></p><div class="charts"><section class="plot"><h2>What could happen next?</h2><p>Three outcomes. One complete probability distribution.</p><div id="probability-chart" class="chart"></div></section><section class="plot"><h2>Risk over time</h2><p>Estimated downside on data the model had not seen</p><div id="timeline-chart" class="chart"></div></section><section class="plot"><h2>Do estimates match reality?</h2><p>Closer to the dashed line is better. Small samples are noisy.</p><div id="calibration-chart" class="chart"></div></section><section class="plot"><h2>How the models compare</h2><p>Prediction error on unseen data · lower is better</p><div id="score-chart" class="chart"></div></section></div><details class="scores"><summary>Compare detailed model scores</summary><p id="score-note" class="small">Comparative test scores appear after a run.</p><div class="table-scroll"><table><caption class="sr-only">Candidate test scores</caption><thead><tr><th scope="col">Model</th><th scope="col">Scored rows</th><th scope="col">Log loss</th><th scope="col">Brier</th><th scope="col">Up Brier</th><th scope="col">Downside Brier</th></tr></thead><tbody id="scores-body"></tbody></table></div></details><div class="audit-grid"><details><summary>Chronology & run audit</summary><pre id="audit">No completed run.</pre></details><details><summary>Distribution diagnostics</summary><pre id="diagnostics">No completed run.</pre></details><details><summary>SHAP & Python provenance</summary><pre id="explanations">Load the precomputed Python benchmark to inspect its tree explanation.</pre></details></div><button id="download" class="secondary" disabled>Export research report · JSON</button><p class="hint">A probability forecast is not an executable trade. No historical investment edge is established.</p></div></section><section id="mathematics" class="view" hidden><h2>Explore the mathematics.</h2><p>Separate mathematical examples. These assumptions do not establish a market forecasting edge.</p><div class="lab-grid"><section class="plot"><h3>Two-player games</h3><label for="game">Game</label><select id="game"><option value="prisoner">Prisoner’s dilemma</option><option value="matching">Matching pennies</option></select><pre id="game-output"></pre></section><section class="plot"><h3>Option prices & binary Kelly</h3><form id="risk-form"><div class="input-grid"><label>Spot<input name="spot" type="number" min="1" step="1" value="100" required></label><label>Strike<input name="strike" type="number" min="1" step="1" value="100" required></label><label>Years<input name="years" type="number" min="0.01" max="10" step="0.01" value="1" required></label><label>Annual volatility<input name="vol" type="number" min="0.01" max="3" step="0.01" value="0.2" required></label><label>Binary win probability<input name="probability" type="number" min="0" max="1" step="0.01" value="0.55" required></label><label>Net binary payoff odds<input name="odds" type="number" min="0.1" max="10" step="0.1" value="1" required></label></div><button class="secondary">Calculate</button></form><pre id="risk-output" aria-live="polite"></pre><p class="hint">Black–Scholes: European, no dividends, constant volatility and 3% rate. Kelly: capped quarter-Kelly for a fixed-payoff binary bet, not an equity allocation.</p></section></div><section class="plot iv-lab"><h3>Implied volatility from an option premium</h3><p>European Black–Scholes inversion; no dividends. Risk-neutral pricing inputs stay separate from historical forecast probabilities.</p><form id="iv-form"><div class="input-grid"><label>Spot<input name="spot" type="number" min="0.01" value="100" step="0.01" required></label><label>Strike<input name="strike" type="number" min="0.01" value="100" step="0.01" required></label><label>Maturity · years<input name="years" type="number" min="0.001" max="10" value="1" step="0.001" required></label><label>Annual continuously compounded rate<input name="rate" type="number" min="-1" max="1" value="0.03" step="0.01" required></label><label>Observed premium · same units as spot<input name="premium" type="number" min="0" value="9.4134" step="0.0001" required></label><label>Option type<select name="type"><option value="call">Call</option><option value="put">Put</option></select></label></div><button class="secondary">Solve implied volatility</button></form><pre id="iv-output" aria-live="polite"></pre></section></section><section id="distributions" class="view" hidden><h2>Explore a different scenario.</h2><p class="scenario-note">User-specified scenarios, separate from the forecast workbench. No parameters are fitted to uploaded prices. These are not option-implied or calibrated market probabilities.</p><div class="scenario-layout"><form id="jump-form"><h3>Annual parameters</h3><label>Expected simple-return drift<input name="mu" type="number" min="-1" max="1" step="0.01" value="0.06" required></label><label>Diffusion volatility<input name="sigma" type="number" min="0.01" max="2" step="0.01" value="0.2" required></label><label>Expected jumps per year<input name="intensity" type="number" min="0" max="50" step="0.5" value="2" required></label><label>Mean log jump size<input name="jumpMean" type="number" min="-1" max="1" step="0.01" value="-0.08" required></label><label>Log jump standard deviation<input name="jumpStd" type="number" min="0" max="1" step="0.01" value="0.1" required></label><label>Horizon · observations<input name="horizon" type="number" min="1" max="252" step="1" value="21" required></label><label>Downside log-return threshold<input name="threshold" type="number" min="-2" max="2" step="0.01" value="-0.02" required></label><button class="primary">Update scenario</button><p class="hint">252 equal-length observations per year assumed. All return parameters are decimals. Jump compensation preserves the chosen expected simple-return drift.</p></form><div><div id="jump-status" role="status" aria-live="polite"></div><div class="stats" id="jump-stats"></div><div class="charts"><section class="plot"><h3>Probability density · PDF</h3><p>Density can exceed one; area gives probability.</p><div id="jump-pdf" class="chart"></div></section><section class="plot"><h3>Cumulative probability · CDF</h3><p>Blue: jump mixture. Gray: moment-matched normal.</p><div id="jump-cdf" class="chart"></div></section></div><details><summary>Scenario assumptions & numerical mass audit</summary><pre id="jump-audit"></pre></details></div></div></section><section id="methods" class="view prose" hidden><h2>Understand your results.</h2><p>This is a free Static Hugging Face Space. Browser models fit locally in a web worker. CSV contents are read by your browser; they are not uploaded to a modeling server. No API key, external data feed or paid compute is required.</p><h3>Validation contract</h3><p>At close t, returns, momentum, realized volatility and drawdown use only observations through t. Models fit on earlier rows, then calibrate and select on a later block. A one-row embargo separates each boundary. Initial training uses 500 rows, calibration 150 and outer test blocks 200. Never tune using the outer test charts.</p><p>The target is the next observed close’s log return. Downside is below −0.02 log return, approximately −1.98% simple return; the middle event includes both boundaries, and the final event is a positive return. Probabilities sum to one.</p><h3>EWMA challenger</h3><p>The ridge mean stays frozen within each fold. Residual variance updates online with a fixed 20-observation half-life, using only outcomes already known before each forecast. Its own target never updates its own variance. The audit records volatility and timing; annualization assumes 252 equal-length observations and is only illustrative for gapped CSVs.</p><h3>Two distinct execution modes</h3><p><b>Browser experiment:</b> empirical frequencies, ridge with Gaussian residual probabilities, EWMA residual-volatility probabilities, and multinomial logistic regression are fitted to the selected data. Synthetic JavaScript draws differ from Python even with the same seed.</p><p><b>Precomputed Python benchmark:</b> a saved 900-observation synthetic run actually fitted scikit-learn, XGBoost and LightGBM, completed three training-only Optuna trials, computed SHAP and recorded MLflow metrics. Loading it does not execute those libraries. Download the full Python/Gradio project to run them locally.</p><h3>Implementation limits</h3><p>Calibration reuses data for temperatures and model choice. Financial tails and nonstationarity can invalidate normal residual assumptions. Tiny test samples and sparse reliability bins are especially unreliable. SHAP explains uncalibrated raw class margins, not causal effects. Close-based information does not imply executable same-close fills. No costs, live trading or economic backtest is included.</p><p>TFT, DeepSurv, PPO, calibrated rough-volatility models, SPDE solvers and quantum algorithms remain unimplemented. Qiskit has no defined task here; TensorFlow would duplicate the optional PyTorch backend. The downloadable project records all requested books and access limits; full books were not read.</p><p>The implied-volatility solver and jump-mixture PDF/CDF explorer are independently implemented standard methods inspired by <a href="https://github.com/quantmind/quantflow">Quantflow</a>. No upstream source is copied and the Python package is not installed in this static host.</p><p><a href="METHODS.md">Detailed method & provenance notes</a> · <a href="python-project.zip" download>Full Python source and tests</a></p></section></main><footer><span>QuantLab · research estimates, explicit assumptions.</span><span>Browser-local modeling / no paid compute</span></footer></body></html>
123:root{font-family:Arial,Helvetica,sans-serif;color:#141414;background:#f2f4f7;font-size:14px;line-height:1.5;color-scheme:light}*{box-sizing:border-box}body{margin:0;padding:24px 32px}header{display:flex;align-items:center;justify-content:space-between;gap:24px;max-width:1400px;margin:auto}h1{font-size:25px;letter-spacing:-.7px;font-weight:600;margin:0}h1 span{font-weight:400;color:#505864}header p{margin:6px 0 0;color:#505864}a{color:#174f9d;text-underline-offset:3px}.source-link{white-space:nowrap;font-size:13px}nav{display:flex;gap:24px;border-bottom:1px solid #d6dce4;margin:24px auto;max-width:1400px}button,input,select{font:inherit}button{cursor:pointer;touch-action:manipulation}button:disabled{opacity:.55;cursor:progress}.tab{border:0;background:none;padding:10px 0;color:#505864;border-bottom:2px solid transparent;white-space:nowrap}.tab.active{border-color:#141414;color:#141414}.primary,.secondary{min-height:44px;padding:9px 16px;border-radius:5px;border:1px solid #c3cad5;background:white;color:#141414}.primary{background:#141414;color:white;border-color:#141414;width:100%}.primary:hover{background:#333}.secondary:hover{background:#e8ecf1}:focus-visible{outline:3px solid #1d5fbf;outline-offset:3px}main{max-width:1400px;margin:auto}#workbench{display:grid;grid-template-columns:265px minmax(0,1fr);gap:28px}aside{min-width:0}h2{font-size:16px;font-weight:600;margin:0 0 6px}h3{font-size:14px;font-weight:600;margin:20px 0 6px}p{margin:8px 0 16px}.small,.hint{color:#505864;font-size:13px}.hint{font-size:12px;margin:7px 0 14px}form label{display:block;margin:14px 0 6px}input,select{display:block;width:100%;background:white;color:#141414;border:1px solid #c3cad5;border-radius:4px;min-height:40px;padding:8px;font-size:16px}input[type=file]{font-size:12px;max-width:100%}input[type=file]::file-selector-button{border:0;padding:5px;margin-right:5px;background:#e8ecf1;cursor:pointer}.model-list{margin:22px 0;padding:15px 0;border-top:1px solid #d6dce4}.model-list h3{margin:0}.model-list p{line-height:1.8;margin:8px 0}.benchmark-control{margin-top:26px;padding-top:20px;border-top:1px solid #d6dce4}.benchmark-control button{width:100%}#results{min-width:0;outline-offset:8px}#status{font-size:13px;color:#444c58;min-height:45px;padding:0 0 8px}#status.error{color:#a82222}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin:12px 0 26px}.stats span{font-size:12px;display:block;color:#505864;margin-bottom:5px}.stats strong{font-size:29px;font-weight:500;font-variant-numeric:tabular-nums}.charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.plot{background:#fff;padding:18px 18px 10px;min-width:0;border-radius:5px}.plot h2{font-size:15px}.plot>p{font-size:12px;color:#505864;margin:0 0 8px}.chart{height:220px;width:100%}.chart svg{width:100%;height:100%;overflow:visible}.chart text{font-family:Arial,sans-serif;font-size:11px;fill:#505864}.chart line.grid{stroke:#e7ebf0;stroke-width:1}.chart path,.chart line{vector-effect:non-scaling-stroke}.scores{margin-top:26px}.scores p{margin-top:0}.table-scroll{overflow:auto;background:white;border-radius:5px}table{border-collapse:collapse;width:100%;font-size:13px;white-space:nowrap;font-variant-numeric:tabular-nums}th,td{text-align:right;padding:12px;border-bottom:1px solid #edf0f4}th:first-child,td:first-child{text-align:left}th{font-weight:500;color:#505864}.audit-grid{display:grid;gap:10px;margin:20px 0}details{background:#fff;border-radius:5px;padding:12px 16px}summary{cursor:pointer;min-height:24px}pre{font-size:12px;line-height:1.6;max-height:360px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;margin:12px 0}.lab-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:24px}.input-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}.prose{max-width:800px}.prose h3{margin-top:28px}.prose p{line-height:1.8}footer{max-width:1400px;margin:36px auto 0;padding-top:18px;border-top:1px solid #d6dce4;font-size:12px;color:#505864;display:flex;justify-content:space-between;gap:16px}.skip{position:absolute;left:16px;top:-100px;background:white;padding:12px;z-index:10}.skip:focus{top:5px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}[hidden]{display:none!important}@media(max-width:960px){body{padding:20px}#workbench{grid-template-columns:230px minmax(0,1fr);gap:20px}.charts{grid-template-columns:1fr}.stats{grid-template-columns:1fr 1fr}.source-link{max-width:150px;white-space:normal;text-align:right}}@media(max-width:640px){body{padding:18px 16px}header{display:block}h1{font-size:22px}h1 span{display:block;font-size:18px;letter-spacing:-.3px;margin-top:3px}header p{font-size:13px}.source-link{display:inline-block;max-width:none;margin-top:12px;text-align:left}nav{gap:20px;overflow:auto;margin:18px 0}#workbench{display:flex;flex-direction:column}aside{display:grid;grid-template-columns:1fr;gap:12px}.model-list{margin:15px 0}.benchmark-control{margin-top:12px;padding-top:16px}#results{margin-top:14px}.stats{gap:16px}.stats strong{font-size:27px}.charts,.lab-grid{grid-template-columns:1fr}.plot{padding:16px 12px}.chart{height:210px}.input-grid{gap:0 12px}footer{display:block}footer span{display:block;margin:6px 0}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}.scenario-layout{display:grid;grid-template-columns:265px minmax(0,1fr);gap:28px;margin-top:24px}.scenario-layout form{min-width:0}.scenario-layout .stats{grid-template-columns:repeat(3,minmax(0,1fr))}.scenario-layout details{margin-top:18px}.scenario-layout .plot h3,.iv-lab h3{margin-top:0}.iv-lab{margin-top:24px;max-width:850px;padding:24px}.iv-lab>p{font-size:14px}.scenario-note{max-width:850px}.lab-error{color:#a82222}.input-grid select{width:100%}@media(max-width:800px){.scenario-layout{grid-template-columns:1fr}.scenario-layout .stats{grid-template-columns:1fr 1fr}}1:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#1d1d1f;background:#f5f5f7;font-synthesis:none;font-size:15px;line-height:1.5;--blue:#0066cc;--secondary:#626268;--line:#dedee3}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,select,summary{-webkit-tap-highlight-color:transparent}button,summary{cursor:pointer}a{color:var(--blue);text-underline-offset:4px}a:hover{text-decoration:underline}::selection{background:#cde5ff;color:#1d1d1f}:focus-visible{outline:3px solid #0071e3;outline-offset:4px}header{max-width:1440px;margin:auto;padding:48px 48px 32px;display:flex;align-items:flex-start;justify-content:space-between;gap:24px}h1{font-size:24px;line-height:1.1;letter-spacing:-.035em;margin:0;font-weight:650}h1 span{display:block;font-size:40px;line-height:1.15;letter-spacing:-.035em;margin-top:14px}header p{color:var(--secondary);margin:16px 0 0;max-width:65ch;font-size:17px}.source-link{font-size:13px;white-space:nowrap;margin-top:5px;text-decoration:none}nav{display:flex;gap:4px;padding:5px;background:#e8e8ed;border-radius:12px;width:max-content;max-width:calc(100% - 48px);margin:0 auto 36px}.tab{border:0;background:transparent;color:#515158;padding:10px 28px;border-radius:8px;font-size:14px;font-weight:550;min-height:42px}.tab.active{background:#fff;color:#1d1d1f;box-shadow:0 2px 5px #0000000d}.tab:hover:not(.active){background:#ddddE3}main{max-width:1440px;margin:auto;padding:0 48px 60px}.view[hidden],[hidden]{display:none!important}#workbench{display:grid;grid-template-columns:260px minmax(0,1fr);gap:36px;align-items:start}aside{background:#fff;border-radius:16px;padding:24px;position:sticky;top:24px}h2,h3,p{margin-top:0}h2{font-size:22px;letter-spacing:-.025em;line-height:1.2;font-weight:650;margin-bottom:10px}h3{font-size:17px;line-height:1.3;margin-bottom:12px;font-weight:600}p{margin-bottom:16px}label{display:block;font-size:13px;font-weight:550;margin:20px 0 7px}input,select{width:100%;min-height:44px;border:1px solid #b8b8bf;border-radius:9px;background:#fff;color:#1d1d1f;padding:10px 12px;caret-color:var(--blue)}input[type=file]{font-size:12px;padding:9px;overflow:hidden}input::file-selector-button{border:0;background:#eeeef2;border-radius:5px;padding:5px;color:#1d1d1f;margin-right:5px}.small,.hint,.plot>p,.scenario-note{color:var(--secondary);font-size:13px;line-height:1.55}.hint{font-size:12px;margin-top:10px}.primary,.secondary{min-height:44px;border:0;border-radius:10px;padding:11px 16px;font-weight:550;font-size:14px}.primary{background:#0071e3;color:white;width:100%;margin-top:24px}.primary:hover{background:#0066cc}.secondary{background:#e8e8ed;color:#1d1d1f}.secondary:hover{background:#dddde3}button:disabled{opacity:.5;cursor:wait}.benchmark-control{margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}details{border-top:1px solid var(--line);padding:17px 0}summary{font-weight:550;font-size:14px;line-height:1.5}details[open]>summary{margin-bottom:16px}#demo-settings{margin-top:24px}.model-list{margin-top:0}.model-list p{font-size:13px}.benchmark-control .secondary{width:100%}.results-heading{margin:5px 0 20px}.results-heading h2{font-size:30px;margin-bottom:5px}.results-heading p{color:var(--secondary);margin-bottom:0}#status,#jump-status{font-size:13px;line-height:1.6;color:#53535a;background:#ececf1;border-radius:10px;padding:13px 16px;margin-bottom:24px}.error,.lab-error{color:#a11b1b!important;background:#fff0f0!important}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:24px 0 8px}.stats>div{padding:0 16px;border-right:1px solid var(--line)}.stats>div:first-child{padding-left:0}.stats>div:last-child{border:0}.stats span{font-size:12px;color:var(--secondary);display:block}.stats strong{display:block;font-size:30px;font-weight:600;letter-spacing:-.035em;line-height:1.6;font-variant-numeric:tabular-nums}#volatility-note{margin:16px 0 28px}.charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.plot{background:#fff;border-radius:16px;padding:24px;min-width:0}.plot h2{font-size:18px;margin-bottom:6px}.plot p{margin-bottom:12px}.chart{width:100%;min-height:160px}.chart svg{width:100%;display:block;overflow:visible}.chart text{font-family:inherit;font-size:11px;fill:#626268;font-variant-numeric:tabular-nums}.chart .grid{stroke:#e9e9ed;stroke-width:1}.chart rect{rx:3}.scores{margin-top:28px}.table-scroll{overflow-x:auto}table{width:100%;border-collapse:collapse;text-align:right;font-size:13px;font-variant-numeric:tabular-nums}th,td{padding:13px 10px;border-bottom:1px solid var(--line);white-space:nowrap}th{font-weight:550;color:var(--secondary)}th:first-child,td:first-child{text-align:left}.audit-grid{margin-bottom:20px}pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.7;background:#eaeaf0;border-radius:10px;padding:20px;max-height:400px;overflow:auto;tab-size:2}.lab-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:32px}.input-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px}.input-grid label{margin-top:12px}.input-grid input,.input-grid select{margin-top:7px}.input-grid+button{margin-top:22px}.iv-lab{margin-top:24px}.scenario-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:32px;margin-top:28px}.scenario-layout>form{background:#fff;border-radius:16px;padding:24px}.scenario-layout .stats{grid-template-columns:repeat(3,minmax(0,1fr))}.scenario-layout .stats strong{font-size:26px}.scenario-layout .charts{margin:24px 0}.prose{max-width:760px;margin:auto}.prose h3{margin-top:32px}.prose p{line-height:1.8;color:#515158}.view>h2{font-size:32px;letter-spacing:-.035em}.view>p{max-width:75ch;color:var(--secondary)}footer{max-width:1440px;margin:auto;padding:24px 48px;display:flex;justify-content:space-between;gap:20px;font-size:12px;color:var(--secondary);border-top:1px solid var(--line)}.sr-only,.skip:not(:focus){position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.skip:focus{display:block;padding:16px}*{scrollbar-color:#b8b8c0 #f5f5f7;scrollbar-width:thin}@media(min-width:1100px){#probability-chart{min-height:200px}}@media(max-width:1000px){header,main{padding-left:28px;padding-right:28px}#workbench{grid-template-columns:230px minmax(0,1fr);gap:24px}.charts{grid-template-columns:1fr}.stats{grid-template-columns:1fr 1fr;row-gap:16px}.stats>div:nth-child(3){padding-left:0}.stats>div:nth-child(2){border:0}.scenario-layout{grid-template-columns:230px minmax(0,1fr)}.scenario-layout .stats{grid-template-columns:1fr}.scenario-layout .stats>div{padding:0;border:0}}@media(max-width:700px){header{padding:28px 20px 24px;display:block}h1{font-size:21px}h1 span{font-size:32px}header p{font-size:15px}.source-link{display:inline-block;margin-top:18px}nav{margin-bottom:24px;max-width:calc(100% - 40px);width:calc(100% - 40px);gap:2px}.tab{padding:9px 6px;font-size:12px;flex:1}main{padding:0 20px 36px}#workbench,.scenario-layout,.lab-grid{grid-template-columns:1fr;gap:24px}aside{position:static;padding:24px}aside h2{font-size:22px}.primary{margin-top:20px}.results-heading h2{font-size:28px}.stats strong{font-size:30px}.plot{padding:20px}.input-grid{gap:0 12px}input,select{font-size:16px}.view>h2{font-size:28px}.scenario-layout .stats{grid-template-columns:1fr 1fr;gap:16px}.scenario-layout .stats>div:last-child{grid-column:1/-1}.scenario-layout .stats strong{font-size:25px}footer{padding:24px 20px;display:block}footer span{display:block;margin-bottom:6px}}@media(prefers-reduced-motion:no-preference){.tab{transition:background .18s ease-out,box-shadow .18s ease-out}button{transition:background .18s ease-out}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
DESIGN.mdAdded+7
app.js+10-8
index.html+17-17
style.css+1-3