A research tool for series → parameters → parameter-vs-parameter analysis
A paramaterial dataset is a collection of (x, y) series, one per entity, each carrying a bag of metadata. The entity can be a tensile specimen, an equity ticker, a weather station, or a lithium-ion cell; the series can be a stress–strain curve, a price history, a temperature record, or a discharge-capacity trace. The workflow is always the same three moves: plot the series, reduce each series to a handful of scalar parameters using a domain analyzer, then produce a parameter-vs-parameter scatter (or parameter-vs-metadata scatter) across the population so that cross-sectional structure becomes visible.
Where the abstraction came from
The tool started life as a Python library for extracting mechanical properties from uniaxial tensile tests: one stress–strain curve per specimen, analyzers for Young's modulus, 0.2 % proof stress, UTS, Ramberg–Osgood exponents and Zener–Hollomon parameters, and a final scatter of yield stress against temperature across a 154-specimen, 9-lot, 20–300 °C matrix. Nothing in that pipeline is specifically about metal. A materials engineer's specimen → test → parameter → scatter is structurally the same pattern a quant, a climatologist, or a battery scientist reaches for when they ask "does this per-entity scalar depend on that per-entity metadatum?". That is the single sentence that justifies the generalisation, and the finance and climate presets are there to stress-test it.
The shipped case studies
The app ships with three preset datasets, each demonstrating the same pipeline on a different domain. The canonical plot in each case is the scatter a domain expert would actually produce — the materials version is reproduced below as a reference for what the tool's final artefact looks like.

- Materials. 154 real tensile tests across 9 lots, 20–300 °C, from
dan-slater/paramaterial-examples. The canonical plot is 0.2 % proof stress vs temperature; the softening trend is the thing you want to see. A few specimens sit at or near zero in the figure: those are tests where the automatic elastic-window fit behind the proof stress fails, not real values, and they are the reason the materials case studies screen curves before extracting properties. - Finance. 40 real US large-cap tickers across 8 sectors over 504 trading days (2024-04-17 → 2026-04-21), shipped as a Yahoo Finance snapshot. The canonical plot is max drawdown vs annualized volatility (r = +0.79): higher-volatility names draw down harder. β is not a metadata field (it is a derived quantity against a market factor); the chapter's generalisation section proposes the schema extension that would make β a first-class analyzer.
- Climate. 30 real NOAA GHCN-Daily stations, three years (2022-08-22 → 2025-08-20) of daily mean temperature. The canonical plot is annual mean vs latitude;
corr(annual_mean, |lat|) = −0.86. Seasonal amplitude correlates only loosely with |lat| (+0.51), and no warming trend is recoverable from a three-year record; the chapter shows why. - Battery (experimental). 124 LFP/graphite cells from the Severson et al. 2019 Nature Energy release. The public early-life window (cycles 2–100) is too short for most fade parameters, so this preset is left off the picker and its chapter is held back until the full-life rebuild (v0.4 in
ROADMAP.md). It is still reachable at/lab/battery, behind a banner.
Every number in these paragraphs and in the domain chapters is computed by node scripts/chapter-numbers.mjs from the shipped JSON. Each preset also has a shareable URL that opens it with its report template: /lab/materials, /lab/finance, /lab/climate. You can also import your own CSV from the dataset picker; it is parsed in the browser into the same shape.
Quick-start — six clicks to the full pipeline
If you do nothing else on first use, do this. It exercises every core concept.
- Load preset → open
/lab/materials, or pick Materials — Uniaxial Tension in the dataset picker. A 154-specimen materials dataset loads into memory. (The route also adds this walk-through's blocks for you; the steps below build them by hand.) - Add a Stress–strain block → the raw curves render, one per specimen. Pick
lotin the block's Color by menu to colour-code by lot. - Add a Parameters block → it computes every registered materials parameter, one row per specimen: Young's modulus (key
E), 0.2% proof stress (keyProofStress) and Ultimate tensile strength (keyUTS). (see methodology §2 for formulas) - Add a Parameter scatter block → Y = 0.2% proof stress (MPa), X = temperature (from metadata).
- Swap axes → flip X and Y, or change Y to Young's modulus. Nothing re-computes; the scatter just re-binds. (The scatter plots numeric axes only and has no colour key yet, so lot-to-lot offsets are read from the Stress–strain block and the Parameters table.)
- Done. You have just run the same pipeline that structures every other preset — open
/lab/financeto see it again with drawdown against volatility.
Design rationale
The tool's core unit is a Svelte-hosted report composed of blocks because a report is what a working scientist actually writes: a sequence of plots and tables interleaved with commentary, each element bound to a small piece of configuration. Plots are colocated with their configuration — axis choices, colour keys, selected analyzers — so that the thing you see and the thing you would re-run are never separated; there is no hidden plot.py to chase. The chat pane exists because most of the day-to-day friction is not in the click path but in the "what analyzer should I use here" question, and keeping a domain-aware assistant in the same surface as the blocks means you can answer it without leaving the report.
Scope and non-goals
This is a research and teaching tool. It is not a replacement for domain-specific analysis libraries (scipy, statsmodels, pybamm, xarray); it is not a backtester and cannot model transaction costs, slippage, or realistic factor structure; it is not a climate reanalysis product and does not ingest ERA5 or CMIP; it is not a battery validation platform and does not model EIS, DVA, or coupled electro-thermal behaviour. Three small real datasets do not make a production tool. The generalisation claim is that the workflow abstraction holds; the per-domain analyzers shipped here are demonstrations, not reference implementations.
Where to go next
- Methodology reference. Analyzer-by-analyzer formulas, numerical notes, and edge cases, grouped by domain.
- Materials — stress–strain case studies. The original use case, including Ramberg–Osgood fitting, UT vs PST, and Zener–Hollomon regression on hot compression data.
- Finance — daily equity returns. Dataset provenance, stylised facts, recoverable relationships, and the one-to-one mapping back to the materials workflow.
- Climate — daily temperature records. 30 GHCN-Daily stations, the harmonic fit, and which of three textbook relationships a three-year record can and cannot recover.
- Reproducibility. Data sources, caches, overrides and how to recompute every number.
- Glossary. Every technical term used in the other chapters, one short entry each.
References
- Ramberg, W. and Osgood, W. R. (1943). Description of stress–strain curves by three parameters. NACA Technical Note 902.
- Zener, C. and Hollomon, J. H. (1944). Effect of strain rate upon plastic flow of steel. Journal of Applied Physics, 15(1), 22–32.
- Sharpe, W. F. (1966). Mutual fund performance. Journal of Business, 39(1), 119–138.
- Severson, K. A. et al. (2019). Data-driven prediction of battery cycle life before capacity degradation. Nature Energy, 4(5), 383–391.
Methodology reference
This chapter is the technical reference for every analyzer function shipped in the web app. Other chapters link into it for formulas, implementation choices, and failure modes. Precision is preferred over pedagogy — the reader is expected to consult the source.
1. Shared conventions
Note on math rendering. Formulas in this chapter are rendered as Unicode text inside indented code fences because the docs loader does not currently ship a KaTeX plugin. The content is written in a LaTeX-adjacent style so a future student can swap each block to
$…$/$$…$$once KaTeX is wired up.
The Dataset schema
Every domain loads into a single in-memory Dataset type declared in src/lib/datasets.ts:
export interface Test {
test_id: string;
meta: Record<string, string | number | boolean | null>;
strain: number[];
stress: number[];
}
export interface Dataset {
id: string;
name: string;
description: string;
info_columns: string[];
tests: Test[];
domain?: 'materials' | 'finance' | 'climate' | 'battery' | 'generic';
x_label?: string;
y_label?: string;
}
Legacy field names strain and stress
The field names strain and stress are historical. Paramaterial grew out of a materials-testing pipeline, so every Series still carries a strain: number[] and a stress: number[] whatever the x- and y-axes actually mean:
| Domain | strain |
stress |
|---|---|---|
| materials | ε (strain, dimensionless) | σ (stress, MPa) |
| finance | trading-day index | adjusted close price |
| climate | day-of-record index | daily mean temperature (°C) |
| battery | cycle index (0…98 window) | discharge capacity (Ah) |
Display labels come from Dataset.x_label / Dataset.y_label; analyzer code simply operates on series.strain (x) and series.stress (y).
Imported CSVs
A visitor's CSV becomes a Dataset of exactly this shape, in the browser, via src/lib/csvImport.ts (parseCsv → guessMapping / guessDomain → buildDataset). The mapped x column becomes strain, the y column stress; an optional id column splits a long-format file into one Test per id, otherwise each file is one Test. Columns constant within a series become meta, and the chosen domain picks the analyzer set. Date-valued x columns become days since the first date. Nothing is sent to a server.
Series, analyzer, tool
- A series is an array of (x, y) pairs with metadata — a single
Test. - An analyzer is a pure function
series → scalar(or small record). Deterministic, side-effect-free, tolerant of noisy input. - A tool composes analyzers with a scatter to make parameter-vs-parameter plots. The
ParameterDef[]registry (section 6) is how tools discover analyzers.
Units and numerical conventions
Units live in ParameterDef.unit strings only; analyzers operate on whatever numbers the builder script produced. Materials: MPa and dimensionless strain. Finance: raw adjusted closes with a hard-coded 252-trading-day year. Climate: °C on a 365-day year (leap days ignored). Battery: Ah with integer cycle indices (the shipped Severson window is index 0…98 = cycles 2–100).
There is no sparse handling — every series is a dense array. Missing samples are NaN and are silently skipped inside each analyzer (finance is stricter and assumes no gaps). NaN/Inf propagate unless explicitly filtered with Number.isFinite. Out-of-range interpolation returns NaN rather than clamping. The registry wraps every extractor in safe(...) which converts exceptions and non-finite outputs to null.
2. Materials analyzers
All live in src/lib/processing.ts. They operate on a Curve = { strain: number[]; stress: number[] }.
findUTS
export function findUTS(c: Curve): { UTS: number; idx: number; strainAtUTS: number }
Ultimate tensile strength is the largest σ in the record:
UTS = max_i σ_i, idx = argmax_i σ_i
Single linear scan, first-occurrence on ties. No smoothing: a noise spike beats a smoother plateau. Returns -Infinity if empty. Used as parameter UTS in the scatter tool and by fitRambergOsgood as the plastic-window upper bound.
findUplLpl
export function findUplLpl(
c: Curve,
opts?: { windowFraction?: number; toleranceMPa?: number }
): FootCorrection
Locates the upper/lower proportional limits by sliding-window OLS. For each window of width w = max(5, floor(windowFraction · N)), linfit returns slope, intercept, R². Of the windows clearing the R² threshold the one with maximum slope wins — the steepest well-fitting segment is the genuine elastic line; shallower high-R² segments are post-yield tangents. If none clear the threshold, the highest-R² window is used.
Defaults: windowFraction = 0.1 and toleranceMPa = 0.995 (the name is misleading — the threshold is a dimensionless R², not an MPa tolerance). Both are tuneable; the 10 % window in particular trades statistical stability for resolution.
Returns { uplIdx, lplIdx, E, intercept, strainShift } where strainShift = −intercept / E zeroes a curve with a toe. With fewer than w samples best remains null and the non-null assertion throws. Used by the E/ProofStress extractors and by fitRambergOsgood.
findE
export function findE(c: Curve, upl: number, lpl: number): { E: number; intercept: number }
Plain OLS slope through [min(upl, lpl), max(upl, lpl) + 1). Useful when the caller wants to override the findUplLpl window. No R² is returned — call linfit directly if you need it. Silently returns slope = 0 if N·Σx² − (Σx)² is zero.
findProofStress
export function findProofStress(
c: Curve, E: number, offset: number = 0.002
): { proofStress: number; idx: number; strainAtPS: number }
The 0.2 %-offset proof stress: intersection of the curve with the elastic line shifted by offset, i.e.
σ_ps such that σ(ε) = E · (ε − offset)
Sign-change test on diff_i = σ_i − E·(ε_i − offset). Every zero crossing updates lastCross, so the last crossing wins — matters for non-monotonic curves where the elastic line re-enters the data after yielding. A linear intersection between samples [cut, cut+1] and the elastic line gives exact (ε*, σ*). Returns NaN if no crossing exists or the segment slope equals E. Used via the ProofStress registry entry and by fitRambergOsgood.
computeRepresentative
export function computeRepresentative(
tests: Array<{ meta: Record<string, unknown>; strain: number[]; stress: number[] }>,
groupBy: string[],
nPoints: number = 200
): RepresentativeCurve[]
Groups tests by the |-joined concatenation of groupBy metadata fields. For each group: (1) take the intersection of per-test strain ranges as [lo, hi] (lo = max of mins, hi = min of maxes) — guarantees every member has data across the grid, discarding the tails of longer tests; (2) linearly space nPoints samples (default 200, tuneable) from lo to hi; (3) resample each member via interpOntoGrid (which sorts by x and returns NaN out of range); (4) at each grid point compute mean, std (population-style, E[X²] − E[X]² clamped at zero), min, max across members, skipping non-finite values.
Groups with empty intersection (hi ≤ lo) emit empty arrays with n = members.length. Output is sorted numerically when all keys parse as numbers, otherwise lexicographically. Used by the representative-curve block and the CS1/CS2 studies.
fitRambergOsgood
export function fitRambergOsgood(c: Curve, proofStrain: number = 0.002): RambergOsgoodFit
Power-law fit σ = C · ε^n across the plastic region (Ramberg–Osgood, NACA TN 902, 1943). Lower bound is the proof strain from findProofStress (with findUplLpl supplying E); upper bound is the UTS index from findUTS. If either helper throws, the lower bound falls back to proofStrain. OLS runs on (ln ε, ln σ) for samples with ε > 0 and σ > 0. The slope is n, exp(intercept) is C, R² comes directly from linfit. Fewer than three valid points returns NaNs. Used by the CS1 tool to plot n-vs-temperature and C-vs-temperature.
computeZH
export function computeZH(
tests: ...,
opts: { Q_kJmol?: number; flowStrain?: number }
): ZhRegression | null
Zener–Hollomon regression (Zener & Hollomon, J. Appl. Phys. 15, 1944). For each test with both a strain rate ε̇ and a temperature T the code forms
Z = ε̇ · exp(Q / (R · T_K)), T_K = T_°C + 273.15
with Q in J/mol (opts.Q_kJmol, default 155 kJ/mol — typical for hot aluminium, tuneable per material), R = 8.314 J/mol·K. Flow stress is the linearly interpolated σ at opts.flowStrain (default 0.3) via flowStressAt. OLS on ln σ = a · ln Z + b gives a = 1/n_ZH in the usual formulation. Tests missing rate, temperature, or a reachable flowStrain are dropped; fewer than two survivors returns null. Used by CS3 / CS4.
flowStressAt
export function flowStressAt(c: Curve, targetStrain: number): number | null
Linear interpolation of σ at a given ε. Sorts by strain first to tolerate non-monotonic input (e.g. unloading segments). Returns null outside [min ε, max ε] or for fewer than two samples. No extrapolation. Called from computeZH and the flow-stress tools.
3. Finance analyzers
All in src/lib/analyzers/finance.ts. The convention is series.stress = price, series.strain = trading-day index. The constant TRADING_DAYS = 252 is hard-coded and used for every annualisation.
logReturns
export function logReturns(series: Series): number[]
Daily log returns r_t = ln(p_t / p_{t-1}), returned as a length-(N−1) array. No gap handling — missing days would produce spurious jumps — so the builder script must drop non-trading days. Used internally by volatility, skewness, kurtosis.
annualizedReturn
export function annualizedReturn(series: Series): number
Compound annual growth rate:
CAGR = exp(ln(p_{N-1} / p_0) / years) − 1, years = (N − 1) / 252
Returns 0 for series of length < 2. Uses total log return over the window (equivalent to mean(log_returns) · 252 up to a geometric/arithmetic discrepancy). Registered as AnnReturn.
annualizedVolatility
export function annualizedVolatility(series: Series): number
Sample-std of daily log returns scaled by √252:
σ_ann = std(r) · √252
Uses the sample estimator (divisor N − 1). Registered as AnnVol.
sharpeRatio
export function sharpeRatio(series: Series, riskFreeRate = 0.04): number
Annualised Sharpe ratio (Sharpe 1966 / 1994):
S = (r_ann − r_f) / σ_ann
Default riskFreeRate = 0.04 (a tuneable parameter; nominal USD rate for the synthetic dataset's era). Returns 0 if volatility is zero. Registered as Sharpe.
maxDrawdown
export function maxDrawdown(series: Series): { drawdown: number; peakIdx: number; troughIdx: number }
Single forward pass tracking the running peak and the maximum peak-to-trough fractional drop:
DD_i = (peak_i − p_i) / peak_i, MDD = max_i DD_i
Returns the indices of the running peak and the trough at which MDD was attained. Edge cases: empty input yields p[0] = undefined and NaN arithmetic — callers are expected to guard. Registered as MaxDD.
skewness
export function skewness(series: Series): number
Sample skewness of daily log returns using the bias-corrected G1 estimator (Joanes & Gill 1998):
G1 = n / ((n−1)(n−2)) · Σ ((r_i − μ) / σ)^3
Returns 0 for n < 3 or zero σ. Registered as Skew.
kurtosis
export function kurtosis(series: Series): number
Sample excess kurtosis, also Joanes–Gill / SAS G2:
G2 = [n(n+1) / ((n−1)(n−2)(n−3))] · Σ ((r_i − μ) / σ)^4 − 3(n−1)² / ((n−2)(n−3))
Returns 0 for n < 4. Note the registry label is ExKurt; this is already the excess (subtract-3) form, not raw kurtosis.
rollingVolatility
export function rollingVolatility(series: Series, window: number = 21): number[]
Per-day annualised volatility over a centred window of window log returns (default 21, about one trading month): for return index t the window is [t − ⌊w/2⌋, t + w − 1 − ⌊w/2⌋], clipped to the record, so it shrinks at both ends rather than padding. Each value is the unbiased sample standard deviation (n − 1) of the returns in the window, times √252:
σ̂_roll(t) = √252 · √( Σ_{i∈W(t)} (r_i − r̄_W)² / (|W(t)| − 1) )
Returns an array of length n − 1 (one per return). Windows with fewer than two returns give 0. A path function, not a scalar: it has no registry row, so it is reachable from code but not from the Parameters block.
ewmaVolatility
export function ewmaVolatility(series: Series, lambda: number = 0.94): number[]
RiskMetrics exponentially weighted volatility:
σ̂²(t) = λ · σ̂²(t−1) + (1 − λ) · r_t², σ̂²(0) = r_0², σ̂_ann(t) = √252 · σ̂(t)
Zero-mean convention (squared returns, not squared deviations), seeded on the first squared return. λ is clamped to [0, 0.999999]; 0.94 is the RiskMetrics (1996) daily default. Element 0 is NaN. EWMA is the GARCH(1,1) special case ω = 0, α = 1 − λ, β = λ. Like rollingVolatility it returns one value per return and has no registry row.
volClusteringIndex
export function volClusteringIndex(series: Series): number
Pearson correlation between |r_t| and |r_{t−1}| over the log returns, clamped to [−1, 1]; 0 for n < 3 or zero variance. Independent returns score about 0; Cont (2001) lists positive autocorrelation of absolute returns as a stylised fact of real markets, typically +0.1 to +0.3 for single equities at lag 1. Registered as VolCluster.
4. Climate analyzers
All in src/lib/analyzers/climate.ts. Convention: strain is day-of-record index, stress is daily mean temperature in °C. DAYS_PER_YEAR = 365 — leap days ignored, a deliberate simplification that biases sub-day effects but is fine at the annual aggregation level.
annualMean
Arithmetic mean of all daily temperatures. Returns NaN on empty input.
annualRange
Slice the record into consecutive 365-day years (trailing partial year discarded), compute each year's mean, return max − min. Requires ≥ 1 complete year; returns 0 otherwise.
seasonalAmplitude
For each complete 365-day year of the record (counted from its first day, not from 1 January), split into 12 pseudo-months of floor(m · 365/12) boundaries, take monthly means, and record (max − min) / 2. Return the mean amplitude across years. The pseudo-month boundaries are tuneable — a calendar-accurate alternative would replace them with actual month-length lookups, but the current approximation gives month lengths of 30 or 31 days and matches the analysis resolution.
trendPerYear
OLS slope of (day-index, temperature), multiplied by 365 to convert °C/day to °C/year. Uses the covariance/variance closed form rather than linfit from processing.ts — identical mathematically, duplicated here to keep domains decoupled. Returns 0 if the denominator is zero (constant x) or n < 2. Biased by the seasonal cycle: a sinusoid over whole years is not orthogonal to a line unless its phase is right, so the slope absorbs part of the cycle. On the shipped climate preset the median is +0.84 °C/yr and it tracks seasonal amplitude at r = +0.76. Prefer harmonicTrendPerYear.
summerAnomaly
export function summerAnomaly(series: ClimateSeries, hemisphere: 'N' | 'S'): number
Mean temperature across the three summer pseudo-months minus the overall annual mean. Summer is pseudo-months 5–7 for the N hemisphere and 11, 0, 1 for the S hemisphere, using the same scheme as seasonalAmplitude. The bins count from the first day of the record, not 1 January, so they line up with Jun–Aug / Dec–Feb only when the record starts on 1 January (the shipped climate window starts on 22 August). Registered with hemisphere pulled from test metadata (meta.hemisphere), defaulting to 'N' if the key is missing.
extremeHotDays / extremeColdDays
export function extremeHotDays(series: ClimateSeries, threshold: number): number
export function extremeColdDays(series: ClimateSeries, threshold: number): number
Straight counts of days with T > threshold (hot) or T < threshold (cold). Registered with thresholds 30 °C and 0 °C respectively — the two classical public-health and agronomy cut-offs. Thresholds are tuneable by changing the registry entry.
fitHarmonicTrend
export function fitHarmonicTrend(series: ClimateSeries): HarmonicFit
// HarmonicFit = { a, b, c, d, amplitude, phase, peakDay, rSquared }
Ordinary least squares fit of a level, a linear trend and one annual harmonic:
T(t) = a + b·t + c·cos(ωt) + d·sin(ωt), ω = 2π/365, t = day index
The 4×4 normal equations XᵀX β = Xᵀy on the columns [1, t, cos ωt, sin ωt] are accumulated in one pass and solved by Gauss–Jordan elimination with partial pivoting; if any pivot falls below 10⁻¹² the function returns an all-zero fit. Derived outputs:
amplitude = √(c² + d²) phase = atan2(d, c)
peakDay = (phase / ω) mod 365 (on the record's own day index, not calendar day-of-year)
R² = 1 − RSS / Σ(yᵢ − ȳ)²
Returns the zero fit for n < 4. Fitting the cycle jointly with the trend is what stops the seasonal signal leaking into b; one harmonic cannot represent a skewed annual cycle, so some leakage remains (on the shipped preset harmonicTrendPerYear still correlates with amplitude at r = +0.42).
harmonicAmplitude
fitHarmonicTrend(series).amplitude, in °C. Registered as HarmAmp. Agrees with the binned seasonalAmplitude to r = +0.996 on the shipped preset, but uses every day instead of 12 bin means.
harmonicTrendPerYear
fitHarmonicTrend(series).b · 365, in °C/yr. Registered as HarmTrend. The preferred trend estimator; on three years of data it is still dominated by weather noise at any single station.
5. Battery analyzers
All in src/lib/analyzers/battery.ts. Convention: strain is the cycle index, stress is discharge capacity (Ah). The helper isNum gates every read so NaN/Inf/non-number entries are skipped rather than propagated.
initialCapacity
Mean of the first up-to-three finite capacities in the record. Averaging reduces noise from conditioning cycles; the hard-coded 3 is a tuneable parameter.
currentCapacity
Most recent finite capacity (reverse linear scan until a numeric entry is found). Returns 0 if every entry is non-finite.
fadePerCycle
fade = (C_first − C_last) / (cycle_last − cycle_first)
Returns 0 if only one finite sample exists or if the x-range is zero. Positive for normal (fading) batteries, negative if capacity has net increased. Registered in Ah/cycle.
cyclesTo80Pct
First cycle index whose finite capacity drops below 0.8 · C_0, where C_0 comes from initialCapacity. Returns null if no sample satisfies the condition or C_0 = 0. Registered as Cyc80.
kneeCycle
Piecewise-linear change-point detector for accelerated-fade onset. Filters to finite samples, requires ≥ 20. Searches breakpoints k ∈ [minSeg, n − minSeg) with minSeg = max(5, floor(0.1·n)); each candidate is scored by the summed SSE of OLS fits on [0, k) and [k, n). Stride is max(1, floor(n/100)) — about 100 candidates regardless of record length. The 10 % minimum segment, the ~1 % stride, and the knee-sharpness factor (below) are all tuneable.
Acceptance: both segment slopes must be negative and |s₂| ≥ 2|s₁|; otherwise returns null.
retentionAt
export function retentionAt(series: Series, cycle: number): number
Nearest-neighbour lookup: find the finite sample with x_i closest to the target cycle, return y_i / C_0. Does not interpolate — for retention curves this matters less than it does for flow stress, but if cycles are sparse it can introduce 1–2 % error. Registered with cycle = 500 as Ret500. Returns 0 if C_0 = 0 or no finite sample exists, and NaN (shown as "—") if cycle lies past the last sample: it never extrapolates. On the shipped 99-cycle Severson window Ret500 is therefore blank for every cell.
fitStretchedExp
export function fitStretchedExp(series: Series): StretchedExpFit
// StretchedExpFit = { C0, k, alpha, rSquared }
Fits the stretched-exponential fade model
C(n) = C₀ · exp(−k · n^α)
with C₀ fixed to initialCapacity and nudged up by 0.05 % so that C(n) < C₀ holds for every kept point. Taking logs twice linearises it:
ln(ln(C₀ / C(n))) = ln k + α · ln n
and α, ln k come from a single closed-form OLS on (ln n, ln ln(C₀/C(n))). There is no iterative refinement (no Levenberg–Marquardt, no Gauss–Newton step). Domain: points with n < 1 or C(n) ≥ C₀ are dropped because the transform is undefined there. Fails (NaN coefficients, rSquared = 0) with fewer than 5 finite points, fewer than 3 usable log-log points, or k ≤ 0. R² is computed on the original capacity residuals, not the log-log ones.
Limits: the double log amplifies noise when C(n) is close to C₀, so early-life records with little fade give unstable α. On the shipped 99-cycle Severson window the fit succeeds on 113 of 124 cells with median R² 0.11 (55 below zero), and α ranges from −0.30 to 5.5. Treat it as meaningful only on full-life data.
fadeExponent
fitStretchedExp(series).alpha, dimensionless. Registered as FadeExp. α < 1 is sub-linear (decelerating) fade in n^α, α > 1 accelerating.
fadeRateConstant
fitStretchedExp(series).k, in units of cycle^(−α). Registered as FadeK. Because its units depend on α, compare k only between cells with similar α.
6. Analyzer registry
src/lib/analyzers/registry.ts exposes a ParameterDef type and one ParameterDef[] per domain, plus a dispatcher getParameterDefs(domain):
export interface ParameterDef {
key: string;
label: string;
unit?: string;
extract: (s: Series, meta?: Record<string, unknown>) => number | null;
}
Each entry wraps its analyzer call in safe(...), which coerces thrown exceptions and non-finite results to null so the UI can render them as "—" without special casing. The meta second argument is how per-test parameters (like hemisphere) reach analyzers that need them; most entries ignore it.
To surface a new analyzer, append a ParameterDef to the appropriate array. To surface a new domain, add an array and a case in getParameterDefs. The scatter-plot tool consumes getParameterDefs(dataset.domain) directly — no per-component plumbing is needed.
7. How to add a new domain
Builder script. Emit a JSON file at
static/data/<id>.jsonconforming toDataset(section 1). EachTestneedstest_id,meta,strain,stress;info_columnslists whichmetakeys the UI should show. Include thedomaindiscriminator.Analyzers. Implement domain-specific analyzers in
src/lib/analyzers/<domain>.ts. Keep them pure, tolerate NaNs, return scalars or small records, and prefer sample (unbiased) estimators. Duplicate small helpers likemeanrather than cross-importing from other domains — this keeps the files independent and easy to delete.Registry. In
src/lib/analyzers/registry.ts, import your module, build aParameterDef[]array, and extend theswitchingetParameterDefs. Pick stablekeystrings (they end up in URLs and CSV exports) and includeunitwhere applicable.Preset. Add a
DatasetInfoentry toPRESET_DATASETSinsrc/lib/datasets.tswith the newid, adomain, and a short description. The dataset picker will pick it up automatically.Chapter numbers. Add the new domain to
scripts/chapter-numbers.mjsso every number the chapter prints is computed from the shipped JSON, and rerun it after every data rebuild.
The scatter tool and plotting components are domain-agnostic — they react to Dataset.domain and the registry output. Bespoke case-study blocks (as materials has for CS1–CS4) go in src/lib/blocks/.
References
- Ramberg, W. & Osgood, W. R. (1943). Description of stress-strain curves by three parameters. NACA Technical Note 902.
- Zener, C. & Hollomon, J. H. (1944). Effect of strain rate upon plastic flow of steel. Journal of Applied Physics 15, 22–32.
- Sharpe, W. F. (1966). Mutual fund performance. Journal of Business 39(1), 119–138.
- Joanes, D. N. & Gill, C. A. (1998). Comparing measures of sample skewness and kurtosis. Journal of the Royal Statistical Society: Series D 47(1), 183–189.
- Severson, K. A., Attia, P. M., Jin, N., Perkins, N., Jiang, B., Yang, Z., Chen, M. H., Aykol, M., Herring, P. K., Fraggedakis, D., Bazant, M. Z., Harris, S. J., Chueh, W. C. & Braatz, R. D. (2019). Data-driven prediction of battery cycle life before capacity degradation. Nature Energy 4, 383–391.
- Menne, M. J., Durre, I., Vose, R. S., Gleason, B. E. & Houston, T. G. (2012). An overview of the Global Historical Climatology Network-Daily database. Journal of Atmospheric and Oceanic Technology 29, 897–910.
Materials — stress–strain case studies
Tensile and compression stress–strain curves are the canonical instance of the paramaterial abstraction. Each test is a 1-D series (σ vs ε) plus a bag of metadata (temperature, strain rate, lot, geometry), and the questions are always the same: what single numbers summarise each curve, how do those vary with the metadata, and does a constitutive model reproduce what we see? This is the shape of problem paramaterial was built for — a DataSet of DataItems, a sequence of per-item or per-group operations, and a final scatter of extracted parameter against condition.
Background — a century of constitutive modelling
The numbers that paramaterial extracts in this chapter are not arbitrary. They are the parameters of constitutive laws that have been refined, compared, and critiqued across a century of mechanical-metallurgy literature. This section sets out the provenance of each model used downstream so that the extracted scalars can be interpreted against their intended domain of applicability.
Cold plastic flow. The oldest of the three power-law hardening forms is
due to Ludwik (1909), who proposed σ = σ_y + K·εⁿ to describe the
work-hardening of annealed metals past yield. The first term pins the yield
stress; the second captures the post-yield strengthening. Hollomon (1945),
working on steel, observed that for many engineering alloys the yield term
can be absorbed into the power-law prefactor without loss of fit quality,
yielding the simpler σ = K·εⁿ used throughout CS1 and in the web tool's
fitRambergOsgood routine. Swift (1952) in turn showed that materials with a
diffuse elastic–plastic transition are better described by a shifted form
σ = K·(ε₀ + ε)ⁿ, where ε₀ absorbs pre-yield elastic curvature and residual
strain. All three laws remain in routine use in sheet-metal forming and
structural analysis; the choice among them is a modelling decision, not a
physical one (Hertzberg 2012; Dieter 1986).
Hot working. Above roughly 0.4 T_m the hardening picture is complicated
by dynamic recovery and recrystallisation, and flow stress depends strongly
on strain rate as well as temperature. Zener and Hollomon (1944) proposed the
temperature-compensated strain rate Z = ε̇·exp(Q/RT) to collapse this
two-variable dependence onto a single axis, with Q an apparent activation
energy for deformation. Sellars and Tegart (1972) refined the approach for
hot compression of aluminium and steel, showing that a sinh flow-law
σ = (1/α)·sinh⁻¹[(Z/A)^(1/n)] fits a wider stress range than the simple
power law Z ∝ σⁿ. The log-linear ln σ ∝ ln Z fit used in CS3 and CS4 is the
power-law asymptote and is the form implemented in paramaterial's current
apply_ZH_regression. Modern textbook treatments (Dieter 1986 ch. 15;
Hertzberg 2012 ch. 5) situate both approaches in a common framework.
Testing standards. The tensile-test geometry and procedures assumed by the Basic Usage and CS1 datasets follow ASTM E8/E8M-21, which prescribes gauge-length-to-diameter ratio, crosshead rate, and elastic-modulus determination for uniaxial tests on metallic materials. Deviations — plane strain in CS2, plane-strain compression in CS4 — are noted per case study.
The chapter applies these models to the five case-study datasets to extract cohort-level scalar parameters and their variation with lot, temperature, test type, and strain rate.
The five case studies below are adapted from the companion notebooks in
dan-slater/paramaterial-examples. They share a workflow: (1) prepare —
load raw CSVs, reconcile headers, attach metadata from filename or spreadsheet;
(2) visualise — build an experimental matrix of specimen counts, colour
curves by temperature or lot; (3) process per curve — trim, find UTS and
fracture, detect upper/lower proportional limits (UPL/LPL), fit E, foot-correct,
compute proof or flow stress; (4) screen — emit a PDF with fitted-tangent
markers, re-ingest an annotated copy with rejection flags; (5) aggregate —
interpolate onto a common strain grid, compute mean ± std representative
curves per group, fit a model; (6) compare — scatter the extracted
parameter against temperature, strain rate, or specimen type. Tensile data is
a clean instance because per-curve operations are nearly purely local (foot
correction only uses elastic-region points) and group aggregation only needs
the strain key to align. The five studies differ in what varies on the
x-axis of the final scatter: lot, test-type, rate.
Basic Usage — 154 tensile tests across 9 lots, 20–300 °C
Provenance
154 tests from dan_msc_basic_usage_0.1.0, delivered as
info/01 prepared info.xlsx plus one CSV per specimen with columns Strain,
Stress_MPa. Nine lots (A–I), six nominal temperatures (20, 100, 150, 200,
250, 300 °C), two test types — uniaxial tension (T) and plane-strain
tension (P). All tests at 8.66 × 10⁻⁴ /s. The alloy is AA6061-T651. Source:
Aakash, Connors & Shields (2019), published on Mendeley Data
(doi:10.17632/rd6jm9tyb6.2).
The research question
The introductory walkthrough. It exists to demonstrate every paramaterial
primitive end-to-end on a corpus large enough to exercise screening and
aggregation machinery but small enough to inspect every intermediate. The
scientific question is pedagogical: do the tool's extracted E, 0.2 % proof
stress, and UTS agree with a hand-curated reference (aakash results.xlsx)?
Processing workflow
pam.DataSet(info_path, data_dir)loads info and CSVs keyed bytest_id;pam.check_formattingverifies headers and absence of duplicates.ds.sort_by(['temperature', 'lot'])andds.subset({'test_type': ['T']})narrow to uniaxial tension.pam.experimental_matrixheatmaps specimen counts vs (lot, temperature) to expose under-sampled cells.pam.find_UTSandpam.find_fracture_pointwriteUTS_0/1,FP_0/1.- Trim to
Strain < 0.01for foot correction.pam.find_upl_and_lpl(preload=36)thenpam.correct_footshift each curve to the origin and recordE. pam.make_screening_pdfemits one subplot per test; the user annotates it andpam.read_screening_pdfre-ingestsreject/comment. Eight tests are flagged (IDs 107, 112, 115, 121 at 200 °C; 137, 146, 152, 153 at 300 °C).pam.find_proof_stress(proof_strain=0.002, E_key='E')setsPS_0.002_0/1.pam.make_representative_datagroups by['temperature', 'test_type'], interpolates, and records mean ± std curves plus aggregated scalars.- A
ModelSetfits Ramberg–Osgood (H,n) with bounds (0, 1000) and (0.01, 0.8) to each representative curve.
Key results
Six representative rows (one per temperature):
| T (°C) | E (MPa) | 0.2 % PS (MPa) | UTS (MPa) | FP ε |
|---|---|---|---|---|
| 20 | 59,628 | 258.9 | 288.0 | 0.1079 |
| 100 | 59,198 | 244.5 | 261.1 | 0.1471 |
| 150 | 49,614 | 228.8 | 234.2 | 0.1787 |
| 200 | 49,614 | ~194 | 194.8 | 0.1530 |
| 250 | 40,590 | 141 | 141.9 | 0.1233 |
| 300 | 45,466 | ~83 | 84.3 | 0.1691 |
UTS decays roughly linearly from 288 MPa at 20 °C to 84 MPa at 300 °C, a 71 % reduction. 0.2 % proof stress tracks UTS closely — narrow UPL-to-UTS plateau, consistent with n ≈ 0.1–0.14 (see CS1). The Aakash reference table reports the same trends with typical σ deviations of 10–18 MPa, within one std of the paramaterial means. The only large discrepancy is reference E at 200 °C (5.2 GPa) vs paramaterial's 49.6 GPa — almost certainly a reference-file typo.
Ramberg–Osgood returns K = 217, 196, 177, 137, 97, 67 MPa for 20–300 °C
(notebook variable H in v0.1.0) with n = 0.137, 0.117, 0.102, 0.130, 0.102,
0.144 and fit error 5.8–19.4 MPa.
Limitations
The info table does not record specimen geometry or alloy chemistry, so we
cannot convert to true stress beyond necking or attribute lot variation to
microstructure. FP_0 includes the post-UTS machine compliance tail, so
cross-lab comparison of fracture strain is unreliable. The 0.2 % proof search
assumes a clean elastic modulus; at 200 °C two lots with outlier moduli
inflate the std band.
Reproducing in the web tool

Preset: basic-usage
Blocks:
Dataset picker (basic-usage)
→ Stress–strain (color by temperature)
→ Foot correction (preload = 36 MPa)
→ Properties table (UTS, 0.2 % PS, E)
→ Representative curves (group by temperature)
→ Parameter scatter (Y = 0.2% proof stress, X = temperature)
CS1 — Ramberg–Osgood model fitting
Provenance
76 uniaxial tests from dan_msc_cs1_0.1.0, a subset of the basic-usage corpus
restricted to lots A–E (PST and lots F–I dropped). Filenames encode test type,
temperature, lot, replicate, and three trailing IDs, e.g. T_020_A_1_001_022_ 03.csv. All tests at 8.66 × 10⁻⁴ /s, A_0 = 40.32 mm, h_0 = 3.175 mm. Same
six-point temperature grid as basic-usage. Source: Aakash, Connors & Shields
(2019), the same dataset as basic-usage.
The research question
Does Ramberg–Osgood (σ = E·ε for ε ≤ σ_y/E, σ = K·ε^n beyond) reproduce the curves across five lots and six temperatures, and do (K, n) vary systematically with temperature? This is the template for fitting a constitutive model and pushing the parameter-vs-temperature comparison.
Processing workflow
- Rebuild info from filenames (
filename.split('_')[:4]) for reproducibility without a pre-curated spreadsheet. Drop PST and lots F–I; renameT → UT. pam.copy_data_and_rename_by_test_idrenames CSVs intotest_ID_###.- Convert strain to percent.
find_uts_and_failureapply function writesUTS_0/1,FP_0. - Trim to
Strain < 1%.pam.find_upl_and_lpl(preload=36)thenpam.correct_foot. - Screening PDF round-trip; five tests flagged (IDs 002, 015, 018 at 200 °C; 041, 049 at 300 °C) and removed.
pam.find_proof_stress(proof_strain=0.2)— 0.2 (percent) here vs 0.002 (fractional) in basic-usage, matching the strain-in-percent convention.make_representative_datagrouped both by['lot', 'temperature', 'test_type'](per-lot) and by['temperature', 'test_type'](lot-pooled).- Ramberg–Osgood
ModelSetfit with bounds (0, 1000) on K and (0.01, 0.8) on n,scipy_func='minimize',sample_size=40to avoid over-weighting the dense post-yield tail.
Key results
Per-temperature pooled fit (6 repres curves, 76 tests, lots A–E):
| T (°C) | K (MPa) | n | fit error (MPa) |
|---|---|---|---|
| 20 | 106.7 | 0.0894 | 22.6 |
| 100 | 64.9 | 0.0829 | 9.3 |
| 150 | 73.9 | 0.0949 | 30.2 |
| 200 | 19.6 | 0.1171 | 4.5 |
| 250 | 81.2 | 0.0869 | 27.6 |
| 300 | 86.6 | 0.1025 | 4.8 |
K is noisy at the single-temperature level — the pooled fits do not trace a monotonic K(T) curve, and the 200 °C K = 19.6 MPa is an outlier tied to the three 200 °C tests flagged in foot-correction screening. Re-running the fit per (temperature, lot) gives more stable K values (notebook figs 5.2, 5.4), so the pooled residual is dominated by lot variation, not random noise. n lies in the band 0.04–0.14 across all (temperature, lot) pairs, consistent with a lightly work-hardening aluminium alloy.
Limitations
Ramberg–Osgood has no temperature term; any apparent (K, n) temperature trend
is descriptive only. The fit uses E and UPL_1 as fixed variables, so a
biased foot correction propagates into biased (K, n). sample_size=40
downsamples the dense near-yield region where curvature is largest; an
unweighted log-space OLS (as in the web tool's fitRambergOsgood) gives
different residuals. Five rejected tests and dropped lots F–I thin the 200
and 300 °C aggregates.
Reproducing in the web tool
Preset: cs1
Blocks:
Dataset picker (cs1)
→ Stress–strain (color by lot, subplot by temperature)
→ Foot correction (preload = 36 MPa)
→ Ramberg–Osgood (per test, proofStrain = 0.002)
→ Parameter scatter (Y = K, X = temperature, color by lot)
→ Parameter scatter (Y = n, X = temperature)
CS2 — Uniaxial vs plane-strain tension
Provenance
74 tests from dan_msc_cs2_0.1.0, restricted to lots F–I and both test types
(UT and PST). Same rate (8.66 × 10⁻⁴ /s). Temperatures span 20, 150, 200,
250, 300 °C — 100 °C is silently dropped (notebook comment #??).
Geometry is asymmetric: A_0 = 40.32 mm for UT, 20.16 mm for PST, thickness
3.175 mm. Source: Aakash, Connors & Shields (2019), the same dataset as
basic-usage.
The research question
How does a constraint change (plane-strain vs uniaxial) shift extracted yield, UTS, and Ramberg–Osgood strength with temperature? The canonical two-population comparison: identical pipeline on two test-type subsets, overlaid on a parameter-vs-temperature axis.
Processing workflow
- Rebuild info from filenames, subset to lots F–I, split
T → UT,P → PST. pam.experimental_matrixemitted once per test type side-by-side: UT has ~4 specimens per (lot, temp) cell, PST up to 12.make_strain_percent,find_uts,find_fractureapply functions.- Trim to
Strain < 3% (PST reaches higher strains than CS1 UT). find_upl_and_lpl(preload=36)+correct_foot. The notebook does not re-derive the preload threshold for PST specimens.make_representative_datagrouped by['lot', 'temperature', 'test_type', 'rate']and by['temperature', 'test_type'].- Ramberg–Osgood with bounds (0, 1000) on K and (0.1, 0.8) on n — n-floor raised from CS1 to suppress unphysical exponents on PST's shorter elastic region.
make_representative_infopools across lots for the final test-type × temperature table (figs 5.8–5.9).
Key results
Units note. The CS2 notebook rescales strain into percent (
Strain *= 100) before fitting the elastic slope, so the rawEcolumn in the info table is in MPa-per-percent-strain — numerically one-tenth of GPa. The notebook'sdata['E'] = data['E'] / 10step in fig 5.8 converts those raw values to physical GPa; the factor of 10 is the correct conversion, not a bug (strain is rescaled by ×100, so the numerical E in the raw table is 1/100 of E in MPa and hence 1/10 of E in GPa). The table below quotes both the raw notebook number (left) and the physical SI value (right, GPa) so the reader is not left to reconstruct units from prose.
Representative elastic modulus and proportional-limit stress by (temperature, test type), pooled across lots F–I:
| T (°C) | UT E_raw (MPa/%) | UT E (GPa) | PST E_raw (MPa/%) | PST E (GPa) | UT σ_UPL (MPa) | PST σ_UPL (MPa) |
|---|---|---|---|---|---|---|
| 20 | 588.9 | 58.9 | 543.2 | 54.3 | 169.5 | 194.1 |
| 150 | 477.2 | 47.7 | 394.1 | 39.4 | 163.3 | 186.9 |
| 200 | 396.4 | 39.6 | 396.3 | 39.6 | 157.1 | 185.3 |
| 250 | 417.2 | 41.7 | 367.4 | 36.7 | 84.5 | 93.3 |
| 300 | 302.6 | 30.3 | 247.6 | 24.8 | 68.5 | 68.8 |
UT moduli at 20–300 °C (58.9 → 30.3 GPa) agree with the basic-usage corpus
at the same temperatures (~59.6 GPa at 20 °C, 45.5 GPa at 300 °C) within
one pooled standard deviation — confirming the ×100 / ÷10 chain is
internally consistent. PST modulus sits 5–18 % below UT modulus across
temperatures; the notebook attributes the gap to the shorter elastic region
available for the linear fit on the 20.16 mm PST gauge vs 40.32 mm for UT.
The σ_UPL and σ_UTS trends are the comparison this case study exists to make: PST σ_UTS exceeds UT σ_UTS at every temperature, consistent with Levy–Mises plane-strain elevation of 2/√3 ≈ 1.155 — but the notebook does not quote a specific ratio and per-temperature std bars overlap the effect at the hotter temperatures.
Limitations
100 °C is silently dropped. PST uses the same 36 MPa preload as UT despite a
half-length gauge; find_upl_and_lpl thresholds on stress, so this is
defensible, but a geometry-specific cutoff would be cleaner. Ramberg–Osgood
has no plane-strain correction — comparing fitted K between UT and PST
without an explicit 2/√3 factor double-counts the constraint effect.
Reproducing in the web tool
Preset: cs2
Blocks:
Dataset picker (cs2)
→ Stress–strain (subplot by test_type, color by temperature)
→ Foot correction (preload = 36 MPa)
→ Representative curves (group by temperature + test_type)
→ Parameter scatter (Y = UTS, X = temperature, color by test_type)
→ Ramberg–Osgood (per test)
→ Parameter scatter (Y = K, X = temperature, color by test_type)
CS3 — Hot uniaxial compression, Zener–Hollomon regression
Provenance
70 hot uniaxial compression (UC) tests from dan_msc_cs3_0.1.0, run on the
Gleeble 3800 thermomechanical simulator at the Centre for Materials Engineering
(CME), University of Cape Town. The alloy is AA3104 in three states: as-cast
(AC), and homogenised at 560 °C (H560) and 580 °C (H580), at six temperatures (300, 330, 360, 400, 450,
500 °C) and two rates (1 and 10 /s). Cylindrical specimens, L_0 = 15 mm,
D_0 = 10 mm. Data files are 12-column (time, force, jaw, thermocouple TC1,
σ, ε, plus machine diagnostics). Source: Shanle Baron (2018), a Hulamin
progress report from UCT; test IDs baron_test_### refer to that report.
The research question
Can a single activation-energy law — the Zener–Hollomon parameter Z = ε̇·exp(Q/RT) — regressed against flow stress at ε = 0.3, collapse all materials and rates onto one master curve? And if not, do residuals cluster by material or by rate, revealing which variable is under-modelled?
Processing workflow
check_column_headersandcheck_for_duplicate_fileson the raw directory; 12 data columns per test. Load into DataSet, sort by temperature.experimental_matrixemitted once per material (3 side-by-side heatmaps).- Trim: drop machine-diagnostic columns, filter rows with Δt < 0.02 s (removes dwell segments), cut at max force (removes unloading tail).
pam.calculate_strain_rate(time_key='Time(sec)')writesStrain_Rateas a numerical derivative; measured rate ≈ nominal.pam.find_flow_stress_values(flow_strain=0.3)reads σ, actual T (from TC1 thermocouple, a few °C offset from nominal), actual ε̇ at the target.make_representative_datagrouped by['temperature', 'material', 'rate']across the 6 × 3 × 2 = 36 cells.Q_activation = 155000J/mol (assumed constant), `flow_temp(K) = flow_TC1- 273.15
, thenpam.calculate_ZH_parameter` writes Z per test.
- 273.15
pam.apply_ZH_regressionfits ln σ = a·lnZ + b withgroup_by='material'and separatelygroup_by='rate'to see which grouping is tighter.pam.make_quality_matrixscores each (temperature, rate) cell by deviation from the ZH line (red = 80 %, green = 100 %).
Key results
The ZH master-curve plot (fig 5.13) overlays all 36 cells of the (material, temperature, rate) grid on the ln σ–lnZ plane. Per-material regression gives three lines; per-rate gives two. The notebook does not print numerical slopes, but the conformance matrix (vmin=80, vmax=100) shows per-material regression yielding tighter clusters than per-rate. The case study's reading: 155 kJ/mol is reasonably material-independent within this alloy family, and rate is the stronger discriminant; pooling AC + H560 + H580 under a single Q is defensible to ~10 % residual.
Flow stress at ε = 0.3 declines with temperature at both rates. From fig 5.11,
the 1 /s curve spans a ~4× ratio between 300 and 500 °C; the 10 /s curve sits
above 1 /s at every temperature by ~1.4–1.7× (consistent with strain-rate
sensitivity m ≈ 0.1–0.15). Per-cell numbers are written to s1_table.tex
and s10_table.tex.
Limitations
Q is fixed at 155 kJ/mol. If true Q varies between AC / H560 / H580, the lnZ axis is miscalibrated per group and the per-material conformance improvement is partly an artefact of group-specific intercepts absorbing the Q error. Two rates means m is a two-point log slope, sensitive to rate-measurement accuracy. ε = 0.3 is near steady-state at ≥400 °C but still in the hardening region at 300 °C — the target is not uniformly "steady state".
Reproducing in the web tool
Preset: cs3
Blocks:
Dataset picker (cs3)
→ Stress–strain (subplot by rate, color by temperature)
→ Representative curves (group by material + rate + temperature)
→ Zener–Hollomon (Q = 155000 J/mol, flow strain = 0.3)
→ Parameter scatter (Y = flow_stress, X = temperature, color by rate)
→ Parameter scatter (Y = lnZ, X = ln(flow_stress), color by material)
CS4 — Plane-strain compression at high strain rates
Provenance
40 plane-strain compression (PSC) tests from dan_msc_cs4_0.1.0, run on the
same Gleeble 3800 at CME as CS3. Single material TB (AA3104 transfer bar) at three
temperatures (300, 350, 400 °C) and three rates (10, 30, 100 /s) — an order
of magnitude faster than CS3. Two specimen sizes: PSC (smaller) and
PSC* (larger, b_0 = 60 mm, L_0 = 10 mm, h_0 = 60 mm, w = 12.5 mm).
Friction/geometry corrections Ascale = Bscale = 0.866 recorded in the info
table. Source: Hyde (2015), an MSc thesis at UCT, which also defines the two
specimen geometries.
The research question
PSC is a constrained test: nominally plane-strain but perturbed by friction and specimen-size effects. Does the ZH master curve still collapse the data when the grouping variable is specimen size rather than material? And are the two specimen classes statistically distinguishable after the friction correction?
Processing workflow
check_column_headerswithexception_headersto tolerate missing TC4 / stroke / wedge columns (hardware variation between runs). Load, sort by['test type', 'temperature'].- Experimental matrix per test type (PSC vs PSC*), each a 3 × 3 heatmap.
- Trim: drop machine-diagnostic columns (conditional), filter Δt < 0.02 s,
cut at
Strain < 1.2. pam.calculate_strain_rate, thenfind_flow_stress_values(flow_strain= (0.8, 0.9))— a range rather than a point, so σ is averaged over the 0.8–0.9 strain window near steady state. Rate and TC1 are averaged similarly.make_representative_datagrouped by['temperature', 'test type', 'rate'].- Same ZH machinery as CS3: Q = 155 kJ/mol,
flow_temp(K) = TC1 + 273.15, thenapply_ZH_regressiongrouped alternately bytest typeand byrate. - Per-rate tables
s10_table.tex,s30_table.tex,s100_table.tex.
Key results
Figure 5.16 plots flow stress vs temperature at each rate, with PSC and PSC* overlaid. Qualitatively, PSC and PSC* tracks overlap within error bars at 300 °C and diverge at 400 °C with PSC* running higher — consistent with specimen-size-dependent friction. Flow stress at (10 /s, 300 °C) is the highest point; at (100 /s, 400 °C) the lowest. The notebook does not print the numerical differences.
ZH regression grouped by test type (fig 5.17) gives two lines, one per
specimen class. Conformance matrices (vmin=85, vmax=100) put most cells in
the 90–100 % band — tighter than CS3's 80 % floor, suggesting single-material
PSC data at high rate is more internally consistent than the three-material
CS3 set.
Limitations
Single material means the ZH exercise demonstrates collapse across rate and temperature but not chemistry — it cannot confirm TB's Q is 155 kJ/mol. The friction constants (Ascale, Bscale = 0.866) are applied upstream of the paramaterial pipeline and not revisited; a sensitivity on these would shift absolute flow stress by a few percent. The 0.8–0.9 strain window is a design choice; a different window shifts the fitted slope and intercept.
Reproducing in the web tool
Preset: cs4
Blocks:
Dataset picker (cs4)
→ Stress–strain (subplot by rate, color by temperature)
→ Representative curves (group by test_type + rate + temperature)
→ Zener–Hollomon (Q = 155000 J/mol, flow strain window = 0.8–0.9)
→ Parameter scatter (Y = flow_stress, X = temperature, color by test_type)
→ Parameter scatter (Y = flow_stress, X = rate, color by test_type)
Cross-study synthesis
The five case studies cover a surprisingly broad slice of mechanical
testing — cold tensile behaviour across 9 lots (Basic Usage), a constitutive
fit of Ramberg–Osgood parameters against temperature (CS1), a
two-population contrast of uniaxial vs plane-strain tension (CS2), hot
uniaxial compression with a Zener–Hollomon collapse across three alloy
tempers and two rates (CS3), and high-rate plane-strain compression
contrasting two specimen sizes under the same ZH machinery (CS4). What is
common across all five is the pipeline itself: the same DataSet → apply(per-curve) → screen → make_representative_data → ModelSet.fit_to → scatter graph runs every time. The primitives (find_upl_and_lpl,
correct_foot, find_UTS, find_proof_stress, find_flow_stress_values,
calculate_ZH_parameter, apply_ZH_regression) are composed in slightly
different orders, but the representative-curve aggregation is always the
bridge between per-test scalars and group-level comparison. What varies is
the metadata axis that ends up as X on the final parameter scatter —
lot in Basic Usage and the CS1 per-lot sub-fit, test_type in CS2,
material or rate in CS3, test_type or rate in CS4. This is the
claim that justifies housing five nominally different experiments in one
chapter: they are the same analysis with different group_by_keys. The
web tool's Parameter-scatter block is the UI manifestation of that single
axis of freedom.
Limitations
Four chapter-level caveats carry across the case studies:
- Incomplete provenance. None of the five datasets cite an originating paper. Alloy identity, specimen geometry (where it is not encoded in filenames), thermocouple calibration, and friction-correction sources are taken from notebook comments or inferred from filenames. Cross-lab reproduction of absolute stress values is therefore not defensible.
- CS2 units discipline. The CS2 notebook preserves strain in percent,
producing an
Ecolumn in MPa-per-percent. The convention is internally consistent but a known stumbling block for first-time readers; see the boxed note in the CS2 Key Results section. - Fracture-strain compliance.
FP_0in Basic Usage and CS1 includes the post-UTS machine-compliance tail, so the fracture-strain values in those tables are not comparable across labs or test rigs. - Preload threshold. The whole pipeline depends on
pam.find_upl_and_lpl(preload=36)'s 36 MPa preload being appropriate for the alloy. For the CS2 PST specimens, the same 36 MPa threshold is used despite a halved gauge length; for a stiffer or weaker material the preload must be re-derived. This is the single assumption that propagates into every downstream property (E, σ_UPL, σ_UTS, σ_0.2, K, n).
Where paramaterial must generalise next
The v0.2 brief for the materials chapter was direct: constitutive models
should be selectable from a library, not hard-coded. The tool currently
fails that brief. Hollomon hardening is baked into fitRambergOsgood in
src/lib/processing.ts, and the Zener–Hollomon regression assumes a
single power-law form. A user who wants to screen Ludwik
(σ = σ_y + K·εⁿ) or Swift (σ = K·(ε₀ + ε)ⁿ) against the same plastic
window has to edit TypeScript. The preference cannot be expressed from the
UI, which means the "research tool" framing breaks down the moment the
research question turns to model selection itself.
The concrete extension is a ModelFitBlock: a block component whose first
control is a model-selection dropdown populated from a registry, which
fits the selected model per-test and renders a comparison table of R²,
AIC, and BIC across the models in that registry. The API is small:
export interface ConstitutiveModel {
name: string; // 'Hollomon', 'Ludwik', 'Swift'
paramNames: string[]; // ['K', 'n'] or ['sigma_y', 'K', 'n'] etc.
fit(
curve: Curve,
plasticWindow: { start: number; end: number }
): { params: number[]; rSquared: number; aic: number; bic: number };
predict(strain: number, params: number[]): number;
}
export const HARDENING_MODELS: ConstitutiveModel[] = [hollomon, ludwik, swift];
The implementation lift is medium: one block component
(ModelFitBlock.svelte, ~150 lines), one new module
(src/lib/models/hardening.ts, three model-object implementations,
~200 lines), and a comparison-table renderer (~50 lines of Svelte). No
schema change is required — the registry is pure code, and per-test fit
results attach to existing curve records. This is the single extension
that would let a materials scientist screen constitutive models in the
browser without editing source, which is the minimum bar for the
"research tool" label.
The finance chapter proposes multi-covariate regression against yield curves, the climate chapter proposes spatial indexing over station–station grids, and the battery work (held back until the v0.4 rebuild) needs time-varying metadata for cycle-by-cycle provenance. The materials proposal above is the fourth instance of the same diagnosis. The schema and UI are bound too tightly to the single-curve abstraction that was natural for tensile testing. Each domain extension loosens one axis of that binding — covariates, space, time, and here, model family — and none of them is expressible without touching source today.
References
- Ramberg, W. & Osgood, W. R. (1943). Description of stress–strain curves by three parameters. NACA Technical Note 902. National Advisory Committee for Aeronautics, Washington, D.C.
- Zener, C. & Hollomon, J. H. (1944). Effect of strain rate upon plastic flow of steel. Journal of Applied Physics 15, 22–32.
- Aakash, B., Connors, J. & Shields, M. D. (2019). Stress–strain data for
aluminum 6061-T651 from 9 lots at 6 temperatures under uniaxial and plane
strain tension. Data in Brief 25, 104085.
doi:10.1016/j.dib.2019.104085.
Data: Mendeley Data,
doi:10.17632/rd6jm9tyb6.2.
Source of basic-usage, CS1 and CS2. The Basic Usage cross-check compares
against this paper's reported properties, redistributed as
aakash results.xlsxindan-slater/paramaterial-examples. - S. G. Shanle Baron (2018). Hulamin Progress Report. Technical report, University of Cape Town. Source of the CS3 uniaxial compression data.
- Hyde, C. K. (2015). Critical analysis of simulated thermomechanical processing of aluminium can body stock. MSc thesis, University of Cape Town. hdl:11427/15749. Source of the CS4 plane-strain compression data and specimen geometries.
- Slater, D. (2023). Development of open-source software for repeatable
processing of mechanical test data. MSc thesis, University of Cape Town.
hdl:11427/39860. Companion notebooks
at
github.com/dan-slater/paramaterial-examples.
Finance — daily equity returns
Background
Given a single time series of daily closing prices, what can be said about the asset that produced it? The question is old, and every answer assigns a different role to randomness. The chapter treats a price path as data and asks which scalar summaries of that path admit a defensible cross-sectional story once they are laid alongside metadata such as sector, size, or factor exposure.
The modern statistical treatment of equity prices begins with Osborne, who argued that daily percentage changes are approximately log-normal because investors perceive proportional, not absolute, price moves [1]. Louis Bachelier had anticipated Brownian motion as a price model half a century earlier, but Osborne's log-normal reframing matched the empirical shape of daily return histograms and underwrote the geometric Brownian motion (GBM) convention that still dominates textbooks.
Mandelbrot punctured the i.i.d.-Gaussian picture almost immediately. Cotton prices, he showed, exhibit volatility clustering: large absolute returns tend to follow large absolute returns, and the marginal distribution has heavier tails than a normal [2]. A coherent statistical model took two more decades. Engle's ARCH captured clustering by letting conditional variance depend on recent squared returns [3], and Bollerslev's GARCH generalisation added a smoothed term for conditional variance itself, giving a parsimonious and empirically robust specification [4]. Black, Scholes and Merton had meanwhile turned log-normal prices into a tractable option-pricing theory that made volatility a tradable quantity [5].
Cont later consolidated the empirical regularities that any serious model must reproduce into a list of stylised facts: near-zero autocorrelation in returns, heavy-tailed return distributions, persistent autocorrelation in absolute or squared returns (clustering), a leverage effect linking negative returns to higher subsequent volatility, and so on [6]. Those seven or so facts are now the standard sanity check on any synthetic return generator.
The analyzers in this chapter address the first- and second-moment facts directly: mean return, variance, skewness, excess kurtosis, rolling volatility, and EWMA volatility. They do not yet address conditional heteroskedasticity in its GARCH form, the leverage effect, jumps, or cross-sectional factor structure. The closing section treats that last omission as the most consequential one and proposes a concrete schema extension.
Dataset provenance
v0.2 change. The finance preset is no longer synthetic. The seeded
geometric-Brownian-motion generator that produced v0.1 has been removed and
replaced with real daily adjusted-close prices from Yahoo Finance,
fetched by scripts/build-finance.mjs from the chart endpoint
(query1.finance.yahoo.com/v8/finance/chart/<TICKER>?range=3y&interval=1d).
Its adjclose series is split- and dividend-adjusted, so no further
adjustment is applied downstream. The script can also read Stooq
(https://stooq.com/q/d/l/?s=<ticker>.us&i=d) when given a STOOQ_APIKEY,
but the shipped snapshot is Yahoo's, and provenance.source in the JSON
says so.
Licence and usage. Yahoo Finance data is for personal, non-commercial use under Yahoo's terms. The dataset here is a small snapshot for method demonstration, not a redistributed commercial feed.
Ticker universe. 40 US-listed large-caps across eight sectors — Technology (7), Healthcare (6), Energy (5), Financials (5), Consumer (5), Industrials (5), Materials (4), Utilities (3). The sector buckets are deliberately aligned with the v0.1 synthetic so the chapter's sector prose still reads sensibly. This is not a balanced representation of global equities. It is a convenience sample of heavily-traded US names chosen so that a reader can recognise every ticker and reason about it informally. Non-US markets, small caps, emerging markets, and anything non-equity are all absent by construction.
Time range and alignment. The script fetches ~3 years of daily rows per
ticker, intersects the date sets, and keeps the latest 504 common
business days (≈ 2 calendar years) ending on or before FINANCE_END,
pinned to 2026-04-21 so a rebuild reproduces the shipped window. Every
retained ticker shares the same 504-day aligned index.
Adjustments. Adjusted close already folds in splits and dividends, so the series is directly comparable across pre/post-event dates without further correction. No outlier masking, winsorisation, or return clipping is applied — real tails reach the analyzers unmodified.
What changed vs v0.1. The two injected shocks that defined the
v0.1 synthetic — a market-wide dip on days 175–185 and an Energy-only
shock on days 325–335 — are gone. Any drawdowns visible in the real
series occur at whatever calendar dates the rolling 504-day window
happens to cross; they are no longer mechanical. As a direct
consequence, the +0.73 β-vs-MaxDD correlation documented in v0.1 was an
artefact of the injected market window. Recomputed on the real data, outside
the tool, it is +0.48 (see Recoverable relationships).
Numbers in this chapter. Every quantitative claim below is computed by
node scripts/chapter-numbers.mjs from the shipped static/data/finance.json,
rebuilt 2026-10-09 from Yahoo Finance (provenance in the JSON records the
source, endpoint and window). The window is 504 aligned business days,
2024-04-17 → 2026-04-21. The numbers are specific to that window; moving
FINANCE_END moves them.
First-moment analyzers
The analyzers live in src/lib/analyzers/finance.ts. Each takes a
Series = { strain: number[]; stress: number[] }; the materials field names
are reused because every dataset in the tool is treated as an (x, y)
series. For finance, strain is the day index and stress is the adjusted
close.
Log returns. logReturns(series): number[] computes
rᵢ = ln(pᵢ / pᵢ₋₁). Log returns are time-additive — the sum over a window
is the window log return.
Annualized return. annualizedReturn(series): number applies geometric
annualisation: exp(ln(p_N / p_0) / years) − 1, with
years = (N − 1) / 252.
Annualized volatility. annualizedVolatility(series): number is the
sample standard deviation of daily log returns (unbiased, n − 1 in the
denominator) scaled by √252. The √252 factor assumes independent daily
returns.
Sharpe ratio. sharpeRatio(series, riskFreeRate = 0.04): number is
(rₐ − rf) / σₐ, Sharpe's classical risk-adjusted return measure [7]. The
default short rate is a 4 % placeholder; the function returns 0 rather than
diverging when σₐ = 0.
Max drawdown. maxDrawdown(series) walks the price path tracking the
running peak and returns { drawdown, peakIdx, troughIdx } so the UI can
annotate both endpoints on the equity curve.
Skewness and excess kurtosis. skewness(series) uses the adjusted
Fisher–Pearson estimator with the n/((n−1)(n−2)) correction. kurtosis
returns excess kurtosis (so a normal scores 0). On the shipped window
every ticker is fat-tailed; see the stylised facts below.
The registry keys and UI labels are AnnReturn → Annualized return,
AnnVol → Annualized volatility, Sharpe → Sharpe ratio, MaxDD
→ Max drawdown, Skew → Return skewness, ExKurt → Excess
kurtosis.
Model fit — rolling and EWMA volatility
Summary scalars compress a whole price path to one number. A minimal step toward a model fit is to estimate a time-varying variance across the path itself. Two standard estimators do this without leaving the one-parameter regime.
The centred rolling variance is
σ̂²_rolling(t) = (1/(w−1)) · Σ_{i=t−w+1}^{t} (r_i − r̄)² (annualised × √252)
over a window of w days. It is unbiased if returns are i.i.d. within the
window, but it reacts slowly: a one-day shock only leaves the window w
days later, so σ̂ sits elevated for the full window width.
The exponentially weighted estimator of RiskMetrics [8] replaces the boxcar window with a geometric one,
σ̂²_ewma(t) = λ·σ̂²_ewma(t−1) + (1−λ)·r²_t (λ = 0.94, RiskMetrics 1996)
which is usually preferred at short horizons. Recent shocks receive higher weight, the estimator responds to regime changes within a few days rather than a full window, and the single free parameter λ subsumes window-length choice. RiskMetrics fixes λ = 0.94 for daily data as an industry default.
A GARCH(1,1) generalisation, σ²_t = ω + α·r²_{t−1} + β·σ²_{t−1}, nests EWMA as the case ω = 0, α = 1 − λ, β = λ [4], and is the natural next step once parameter estimation is available. It is not yet shipped; it is on the roadmap.
The new signatures exported from finance.ts are
export function rollingVolatility(series: Series, window: number = 21): number[];
export function ewmaVolatility(series: Series, lambda: number = 0.94): number[];
export function volClusteringIndex(series: Series): number;
rollingVolatility returns an annualised σ̂ per day over a centred window
(default 21 trading days, one calendar month). ewmaVolatility returns an
annualised EWMA σ̂ per day (NaN on day 0 since the estimator needs at least
one return). volClusteringIndex is the scalar companion documented below.
Stylised facts on the real-data preset
Cont's 2001 list [6] collects the properties real daily returns share. Three
of them can be checked inside the tool on the shipped 504-day window, and
all numbers below come from node scripts/chapter-numbers.mjs:
- Heavy tails: yes. Excess kurtosis (
ExKurt) is positive for all 40 tickers: median +5.7, range +0.8 to +27.0. A normal scores 0. - Volatility clustering: yes.
volClusteringIndex, the Pearson correlation between |r_t| and |r_{t−1}|, is positive for all 40 tickers: mean +0.125, range +0.001 to +0.285, inside the +0.1 to +0.3 band usually reported for equities. Sector means: Energy +0.18, Materials +0.15, Financials +0.14, Healthcare +0.12, Industrials +0.12, Technology +0.11, Consumer +0.10, Utilities +0.08. With three to seven tickers per sector the ordering is suggestive, not significant. - Gain/loss asymmetry: weak. Median skewness is −0.27, but the range (−3.18 to +1.85) is set by single-name event days such as earnings gaps, so the sign of one ticker's skew says little.
Absence of linear autocorrelation, the leverage effect, slow decay of autocorrelation in absolute returns and aggregational Gaussianity are not measured by any shipped analyzer. There is no volume in the dataset.
Recoverable relationships
| Relationship | Value on the preset (504-day window, 40 tickers) | Reachable in the UI? |
|---|---|---|
corr(MaxDD, AnnVol) |
+0.79 | Yes: the canonical scatter below |
corr(Sharpe, AnnVol) |
−0.07, no relationship | Yes |
Mean Sharpe by sector (best → worst) |
Financials +1.18, Utilities +0.84, Materials +0.64, Consumer +0.60, Industrials +0.56, Technology +0.43, Healthcare +0.28, Energy +0.16 | Per-ticker values in the Parameters table; means computed by the bench |
| Equal-weighted market drawdown | −17 %, peak day 210 → trough day 244 | Visible on the price overlay |
corr(β, MaxDD) |
+0.48, β = OLS slope on the equal-weighted mean log return (median β 0.99, range 0.15–2.09) | No. Computed outside the tool; needs covariates |
Higher-volatility names drew down harder: that is the +0.79, and it is the plot a reader can make in two clicks. Volatility did not buy return on this window (Sharpe vs volatility is flat at −0.07).
Every sector's mean Sharpe is positive because the window is mostly a rally, but six of the 40 tickers lost money over it (ADBE, COP, UNH, MRK, PG, UPS) and carry negative Sharpe ratios. Financials lead at +1.18; Energy trails at +0.16, its oil-driven volatility outrunning its drift.
The β number is kept as an outside check, not a tool result. It is positive because the one market-wide drawdown in the window (day 210 → 244) hit high-β names harder, but idiosyncratic volatility dilutes it, and a window without a market drawdown would weaken it further.
Reproducing in the web tool

Preset: finance (or open /lab/finance, which applies this template)
Blocks: Stress–strain (color by sector) → Parameters → Parameter scatter (Y = Max drawdown, X = Annualized volatility)
- Open
/lab/finance, or pick Finance in the dataset picker. The loader fetches/data/finance.json. - A Stress–strain block with
color by = sectoroverlays the 40 adjusted-close paths. The market-wide dip between days 210 and 244 is visible as a common sag. - A Parameters block lists one row per ticker with every registered
finance parameter:
AnnReturn,AnnVol,Sharpe,MaxDD,Skew,ExKurtandVolCluster. - A Parameter scatter with Y = Max drawdown, X = Annualized volatility shows the +0.79 relationship.
- For the stylised facts, set Y = Excess kurtosis or Vol clustering: every point sits above zero.
- β is not reachable from the UI; see the next section.
The dataset is a dated snapshot, not a seeded generator. Rebuilding it with
node scripts/build-finance.mjs fetches a newer window and every number
here will move; rerun node scripts/chapter-numbers.mjs afterwards and
update this chapter from its output.
Limitations
- One snapshot window. 504 business days, 2024-04-17 → 2026-04-21, one market regime. Every number in this chapter is specific to that window; a rebuild slides it forward and the numbers move.
- Selection. 40 hand-picked, currently-listed US large caps. There is no survivorship correction and nothing outside US equities.
- No covariates. β, residual volatility and factor loadings need a market series shared across tickers, which the schema cannot carry yet (next section). The β number above is computed outside the tool.
- No colour or categorical axis on the scatter. Sector comparisons are read from the Parameters table, not plotted.
- Path functions have no registry row.
rollingVolatilityandewmaVolatilityreturn one value per day; the Parameters block only shows scalars, so they are reachable from code, not from the UI. - √252 annualisation assumes independent returns. The positive
volClusteringIndexon every ticker says they are not quite; annualised volatility is a convention here, not a model. - EWMA is not a full conditional-variance model. It has no leverage term, no volatility-of-volatility, no regime-switching, and no jump component. It is a one-parameter smoother of squared returns. GARCH(1,1) and its asymmetric extensions (EGARCH, GJR-GARCH) would be required to probe any of those effects.
Where paramaterial must generalise next
Finance is intrinsically multi-series. A meaningful risk decomposition
cannot be performed on one ticker in isolation; it needs the market
portfolio as a covariate. The capital asset pricing model asks for β
against a market index. The Fama–French three-factor model asks for
loadings on market, size, and value returns [9]. The five-factor model
adds profitability and investment. None of this can be computed from a
lone (strain, stress) pair.
The Dataset schema currently carries one (strain, stress) curve per
Test — that is, one per ticker — and has no mechanism for a common
covariate series shared across tests. The concrete extension is a new
optional field
Dataset.covariates: Record<string, number[]>
holding day-indexed aligned series, for example a market factor and a
size factor sampled at the same grid as each ticker's strain. A new
analyzer type, CovariateParameterDef, would expose
extract(series: Series, covariates: Record<string, number[]>): number
so that analyzers such as betaVsMarket, residualVolatility, and
factorLoading(factor) can be expressed cleanly. Three new analyzers
cover the baseline: beta against a nominated factor, residual volatility
after the factor regression, and the factor's loading magnitude.
The lift is medium: one schema field, one new ParameterDef variant
with an extract signature, a loader change for presets that ship
covariates, and two or three analyzers. It is the single extension that
would lift paramaterial from per-ticker summary statistics into
cross-sectional factor analysis — the form in which modern empirical
finance is actually practised.
References
[1] M. F. M. Osborne, "Brownian motion in the stock market," Operations Research, vol. 7, no. 2, pp. 145–173, 1959. doi:10.1287/opre.7.2.145.
[2] B. Mandelbrot, "The variation of certain speculative prices," Journal of Business, vol. 36, no. 4, pp. 394–419, 1963. doi:10.1086/294632.
[3] R. F. Engle, "Autoregressive conditional heteroscedasticity with estimates of the variance of United Kingdom inflation," Econometrica, vol. 50, no. 4, pp. 987–1007, 1982. doi:10.2307/1912773.
[4] T. Bollerslev, "Generalized autoregressive conditional heteroskedasticity," Journal of Econometrics, vol. 31, no. 3, pp. 307–327, 1986. doi:10.1016/0304-4076(86)90063-1.
[5] R. C. Merton, "Theory of rational option pricing," Bell Journal of Economics and Management Science, vol. 4, no. 1, pp. 141–183, 1973. doi:10.2307/3003143.
[6] R. Cont, "Empirical properties of asset returns: stylized facts and statistical issues," Quantitative Finance, vol. 1, no. 2, pp. 223–236, 2001. doi:10.1080/713665670.
[7] W. F. Sharpe, "Mutual fund performance," Journal of Business, vol. 39, no. 1, pp. 119–138, 1966. doi:10.1086/294846.
[8] J.P. Morgan/Reuters, RiskMetrics — Technical Document, 4th ed. New York: J.P. Morgan, 1996. Available: https://www.msci.com/documents/10199/5915b101-4206-4ba0-aee2-3449d5c7e95a.
[9] E. F. Fama and K. R. French, "Common risk factors in the returns on stocks and bonds," Journal of Financial Economics, vol. 33, no. 1, pp. 3–56, 1993. doi:10.1016/0304-405X(93)90023-5.
[10] D. N. Joanes and C. A. Gill, "Comparing measures of sample skewness and kurtosis," Journal of the Royal Statistical Society: Series D (The Statistician), vol. 47, no. 1, pp. 183–189, 1998. doi:10.1111/1467-9884.00122.
Climate — daily temperature records
From specimens to stations
The materials workflow that motivates paramaterial has three moves: load a series, reduce each series to a few parameters, then scatter the parameters against each other or against a test condition. A specimen produces a stress–strain curve; that curve collapses to a yield stress; yield stresses from many specimens scatter against temperature and reveal a softening law. The same three moves work on climate data if we agree on the analogy. A station plays the role of a specimen. A multi-year temperature record plays the role of a stress–strain curve. An annual mean plays the role of yield stress. And latitude — the station's global coordinate — plays the role of the environmental condition used as the x-axis.
The research question this chapter answers is one that every introductory climate textbook answers qualitatively: how much of the variation in a station's climate character is explained by its latitude? With the paramaterial tool, the question becomes quantitative with a single dataset and three blocks. We load three years of real daily temperature from 30 weather stations, reduce each record to interpretable parameters (annual mean, seasonal amplitude, trend), and scatter those parameters against station geography. The latitudinal temperature gradient comes out cleanly. The amplification of seasonality away from the equator comes out only partly, because real coastlines get in the way. Poleward amplification of warming does not come out at all on a three-year record, and the chapter shows why.
Dataset provenance
The dataset distributed with the tool is real observational data, not synthetic. The v0.1 release shipped a seeded pseudo-random generator in scripts/build-climate.mjs; that file has been replaced by a fetcher that downloads per-station CSV archives from NOAA's Global Historical Climatology Network — Daily (GHCN-Daily) and assembles a three-year window of daily mean temperature into the same Dataset schema the tool's other presets use.
The canonical reference for GHCN-Daily is Menne, M. J., Durre, I., Vose, R. S., Gleason, B. E., & Houston, T. G. (2012). An overview of the Global Historical Climatology Network-Daily database. Journal of Atmospheric and Oceanic Technology 29(7), 897–910. DOI: 10.1175/JTECH-D-11-00103.1. GHCN-Daily is the station-level archive that underpins most reanalysis products and the majority of observational-temperature papers; using it here means the climate preset is on the same empirical footing as the literature the student will read next. The archive is US federal data and is distributed in the public domain with no licence restriction, which is why the build script can fetch individual stations anonymously from https://www.ncei.noaa.gov/pub/data/ghcn/daily/by_station/<STATION>.csv.gz.
The preset contains 30 stations, retained out of 41 hand-picked GHCN-Daily IDs. The other 11 fell below the 95 % coverage floor in the window, and the JSON lists each one under provenance.dropped_stations: Montréal, Stockholm, Paris, Moscow, Manaus, Rio de Janeiro, Nairobi, Cairo, two Jakarta IDs, and Brasília. Six of the 30 retained stations are in the Southern Hemisphere, and 19 countries are represented. Latitudes run from Amundsen–Scott at −90° to Reykjavík at +64.1°. Coarsely, the set covers polar (Amundsen–Scott, Yakutsk), continental (Minneapolis, Anchorage, Helsinki, Beijing), temperate maritime (London Heathrow, Lerwick, Vancouver, San Francisco, Reykjavík), arid and semi-arid subtropical (Phoenix, Madrid, New Delhi), and tropical (Singapore, Chennai, Guangzhou) stations. Each station is indexed on the same 1 095-day axis (strain = 0…1094), and the window's calendar bounds (2022-08-22 → 2025-08-20) are stored in provenance.window in the JSON.
The element used is TAVG, GHCN's daily mean temperature, reported in tenths of °C, divided by ten and rounded to 0.1 °C on output. Missing days are linearly interpolated across gaps of ≤7 days; stations with <95 % coverage post-interpolation are dropped. QC caveat: TAVG is not always a directly-measured 24-hour average, and some stations do not report it at all. The build script falls back to (TMAX + TMIN)/2 on days when TAVG is absent but TMAX and TMIN are both present, and records the per-station fraction as meta.tavg_derived_pct. On this build, eight stations are 100 % derived (the seven US stations and Berlin–Tempelhof); the rest are at or near 0 %. The two definitions agree to within a few tenths of a degree on monthly and annual means, but (TMAX+TMIN)/2 has slightly higher day-to-day variance and a small positive bias under strong diurnal asymmetry (e.g., clear desert nights). This affects the noise in trends and extreme-day counts, not annual means or seasonal amplitudes at the aggregate level.
Metadata note. GHCN's station index has no elevation for Amundsen–Scott (it writes the −999.9 "unknown" sentinel). The builder fills that gap from the station record, 2 835 m, so altitude_m is real for all 30 stations. NOAA has also renamed the Canadian IDs (CA00… → CAN0…); Vancouver is now read from CAN01108395, whose record differs slightly from the old ID's.
All numbers in this chapter are computed by node scripts/chapter-numbers.mjs from the shipped static/data/climate.json. Correlations against |latitude| are computed there, because the UI has no |latitude| field (see Limitations).
The analyzers
All analyzers live in src/lib/analyzers/climate.ts and operate on a ClimateSeries with strain (day index 0…N−1) and stress (°C).
annualMean(series) returns the arithmetic mean of stress over the whole record, (1/N)·Σ yᵢ. Units °C. This is the simplest possible climatology.
annualRange(series) computes per-calendar-year means ȳ_k and returns max_k ȳ_k − min_k ȳ_k. Returns 0 if fewer than one full year is present. It captures year-to-year drift — for a record with a linear trend of β °C/yr, annualRange is approximately β·(Y−1) on Y years, since each year's mean increments by β.
seasonalAmplitude(series) splits each 365-day year of the record into 12 approximately equal "months" (using floor(m·365/12) boundaries), takes the month-means, computes (max − min)/2, and averages these half-ranges over whole years. Units °C. The bins are counted from the first day of the record, not from 1 January, so they are pseudo-months; the half-range is unaffected. On this preset it runs from 1.3 °C (Singapore) to 29.3 °C (Yakutsk).
trendPerYear(series) fits an ordinary least-squares line to (dayIndex, temp), then multiplies the per-day slope by 365 to report °C/yr:
slope_day = Σ(xᵢ − x̄)(yᵢ − ȳ) / Σ(xᵢ − x̄)²
trend = slope_day · 365
This estimator is contaminated by the seasonal cycle. A sinusoid over a whole number of years is not orthogonal to a straight line unless its phase happens to be right, and the window here starts in late August. On the shipped data the plain OLS trend has a median of +0.84 °C/yr and a maximum of +4.5 °C/yr (Yakutsk, the station with the largest seasonal swing), and it correlates with harmonic amplitude at r = +0.76. Those are not warming rates; they are the seasonal cycle leaking into the slope. Use harmonicTrendPerYear instead.
summerAnomaly(series, hemisphere) computes the mean over summer pseudo-months minus the annual mean. Summer is bins [5, 6, 7] for N and [11, 0, 1] for S, using the same bin convention as seasonalAmplitude. Units °C. Because the bins start from the first day of the record (late August here), these bins are not calendar June–August; treat the value as indicative until the bins are aligned to calendar months.
extremeHotDays(series, threshold) and extremeColdDays(series, threshold) simply count days above or below a °C threshold (the registry uses 30 °C and 0 °C). Because day-to-day variability differs between maritime and continental stations, two stations with the same annual mean can produce very different extreme-day counts.
Model fit — harmonic trend
fitHarmonicTrend(series) fits the four-term model
T(t) = a + b·t + c·cos(ωt) + d·sin(ωt), ω = 2π / 365, t = day index
by ordinary least squares: it builds the 4×4 normal equations on the columns [1, t, cos ωt, sin ωt] and solves them by Gauss–Jordan elimination with partial pivoting (returning a zero fit if any pivot falls below 10⁻¹²). It returns the coefficients, the seasonal amplitude √(c² + d²), the phase atan2(d, c), the peak day (phase / ω wrapped into [0, 365)), and R². Two scalars are registered:
harmonicAmplitude(HarmAmp, °C) — the fitted√(c² + d²). It agrees closely with the binnedseasonalAmplitude(r = +0.996 across the 30 stations; median 7.5 °C against 7.9 °C), but it uses every day rather than 12 bin means.harmonicTrendPerYear(HarmTrend, °C/yr) —b · 365. Because the seasonal cycle is fitted jointly, the slope no longer absorbs it: the median drops from +0.84 °C/yr (plain OLS) to +0.17 °C/yr, and the range narrows to −0.57 … +1.08 °C/yr.
The fit explains a median 74 % of daily variance (R² 0.32 at the most weather-dominated station, 0.94 at the most seasonal). Its limits: a single annual harmonic cannot represent a skewed cycle (a short sharp winter, a long flat summer), so some seasonal shape still leaks into b; and three years is far too short for b to be a climate trend at any one station.
Recoverable relationships
Correlations across the 30 stations (Pearson r):
| Relationship | r | Reading |
|---|---|---|
annualMean vs |latitude| |
−0.86 | The latitudinal gradient. Survives real data essentially intact. |
seasonalAmplitude vs |latitude| |
+0.51 | Real, but loose: continentality matters as much as latitude. |
harmonicAmplitude vs |latitude| |
+0.47 | Same story with the fitted amplitude. |
trendPerYear vs |latitude| |
+0.18 | Not interpretable; the OLS trend is mostly seasonal leakage. |
harmonicTrendPerYear vs |latitude| |
+0.60 | Looks like poleward amplification; it is not evidence of it (below). |
corr(annual_mean, |lat|) = −0.86. Colder toward the poles, warmer near the equator. Chennai is the warmest station and Amundsen–Scott the coldest. The residuals from a straight-line fit show why the correlation is not −1. Amundsen–Scott, on the polar plateau at about 2.8 km, sits 29 °C below the line and pulls it down at high |lat|. Singapore sits 13 °C below because the real gradient is flat across the tropics, not linear. Mexico City (2 303 m) sits 9 °C below on altitude alone. On the other side, maritime high-latitude stations warmed by the ocean sit 6–8 °C above the line (Lerwick, Reykjavík, Oslo, Helsinki, London), as does arid Phoenix.
corr(seasonal_amplitude, |lat|) = +0.51. On the synthetic v0.1 preset this was +0.96, because amplitude was a hard-coded function of |lat|. On real data maritime stations at high latitude (Reykjavík, Lerwick, Vancouver, London) have modest seasonal swings, while continental stations at similar latitude (Yakutsk, Minneapolis) swing by tens of degrees. Amplitude loads on continentality at least as much as on |lat|, so the scatter is a fan, not a line.
corr(harmonicTrendPerYear, |lat|) = +0.60. It is tempting to read this as polar amplification. Don't. Three years of daily data cannot pin a per-station trend of order 0.1 °C/yr against weather noise of several degrees, and the harmonic trend still correlates with harmonic amplitude at r = +0.42. Large-amplitude stations are also high-latitude stations, so residual seasonal shape that one harmonic cannot absorb shows up as an apparent latitude signal. The honest conclusion is that neither trend estimator recovers a warming signal on this window; recovering one needs a record of a decade or more.
Reproducing in the web tool

In the live app, open /lab/climate (which applies this template) or pick the Climate preset:
Preset: climate
Blocks:
1. Stress–strain (color by: hemisphere)
2. Parameters (all climate parameters, one row per station)
3. Parameter scatter (Y = Annual mean, X = latitude)
The raw-temperature block overlays 30 curves spanning 1 095 days. Three full seasonal oscillations are visible on the high-latitude curves, in antiphase between the two hemispheres; the equatorial curves (Singapore, Chennai) are nearly flat noisy bands. No anomalies are planted in this data; any spike you see is weather.
The scatter plots annual mean against signed latitude. The result is an inverted V: warmest near the equator, colder toward both poles, with Amundsen–Scott alone at −90° anchoring the southern arm. The −0.86 against |latitude| is not a one-click plot, because the UI has no |latitude| field; scripts/chapter-numbers.mjs computes it. Swap Y to Seasonal amplitude or Harmonic amplitude to see the fan described above, or to Harmonic trend per year to see the spread that the +0.60 summarises.
Limitations and extensions
The dataset is real, small and short. Specific limitations:
- Short record. Three years cannot separate a 0.1 °C/yr trend from weather noise at any single station, whichever estimator is used.
- Small, hand-picked station set. 30 stations, 6 in the Southern Hemisphere, most at airports. Urban heat islands and instrument changes are not corrected.
- Mixed definitions of daily mean. Eight stations are entirely
(TMAX+TMIN)/2, the rest mostlyTAVG; see the QC caveat above. - Temperature only. No precipitation, humidity or wind, so Köppen-style classification cannot be recovered from the record. There is no
climate_zonefield; the zones named above are this chapter's informal grouping. - No |latitude| field. The scatter can only use metadata the JSON carries, and the JSON carries signed latitude.
- Pseudo-month bins.
seasonalAmplitudeandsummerAnomalybin from the first day of the record, not from 1 January.
Concrete extensions a student could implement:
- Extend the window.
YEARSinscripts/build-climate.mjssets the record length andCLIMATE_ENDthe end date; at 30 yearsharmonicTrendPerYearbecomes individually meaningful at most stations. - Emit an
abs_latitudemetadata field in the builder so the −0.86 becomes a one-click plot. - Fetch
PRCPalongsideTAVGand add precipitation parameters (annual total, wet-day count, dry-spell length). - Real data carries real teleconnections: compute inter-station correlation of daily anomalies (after removing the harmonic fit) and scatter it against great-circle distance.
- Add a second harmonic (
cos 2ωt,sin 2ωt) tofitHarmonicTrendand check whether the trend's correlation with amplitude drops. - Align the pseudo-month bins to calendar months using
provenance.window.start.
Mapping back to materials
The isomorphism is exact enough to be useful. A specimen is a station. A tensile test, with its thousands of sampled points, is a year of daily temperature. The parameter a materials scientist extracts from the curve — yield stress, ultimate tensile strength, work-hardening exponent — is the annual mean, the seasonal amplitude, or the trend slope. The test condition recorded in the specimen metadata (temperature, strain rate, lot) is the station's latitude, altitude, and hemisphere. And the scatter that closes the workflow — yield stress versus test temperature, revealing the softening law of an alloy — is annual mean versus latitude, revealing the latitudinal temperature gradient.
This matters because the same code path, the same three-block flow, and the same parameter-vs-condition scatter work without modification. The dataset schema is identical (strain, stress, meta); only the labels differ. If a student can read a materials softening curve, they can read the climate scatter; and the generality of the workflow is precisely what the tool is built to demonstrate.
References
- Menne, M. J., Durre, I., Vose, R. S., Gleason, B. E. & Houston, T. G. (2012). An overview of the Global Historical Climatology Network-Daily database. J Atmos Ocean Tech 29, 897–910. (GHCN-Daily, the source of this preset.)
- Screen, J. A. & Simmonds, I. (2010). The central role of diminishing sea ice in recent Arctic temperature amplification. Nature 464, 1334–1337. (Poleward amplification.)
- Hersbach, H. et al. (2020). The ERA5 global reanalysis. Quarterly Journal of the Royal Meteorological Society 146, 1999–2049. (A reanalysis product built on station archives such as GHCN-Daily.)
- Wallace, J. M. & Hobbs, P. V. (2006). Atmospheric Science: An Introductory Survey, 2nd ed. Academic Press. (Seasonal-cycle and latitudinal-gradient physics.)
Reproducibility
Documentation without a reproducibility statement is a demo, not research output. This page pins every moving part a reader needs to reproduce every number quoted in the rest of the docs.
Version pinning
- paramaterial lab — the SvelteKit app that renders these docs and the editor (
web/in theparamaterial-labrepo). This documentation tracks v0.2: three real-data presets, the harmonic and stretched-exponential fits, EWMA and rolling volatility, CSV import and the/lab/<preset>routes. - paramaterial (Python) — the original library whose workflow the web app generalises. Not required to reproduce any web-app number, but all five materials case studies in
20-materials.mdoriginate in notebooks executed against the Python library at the0.1.0tag. - paramaterial-examples —
dan-slater/paramaterial-examples, the public companion repo whose five MSc notebooks define the bar for the materials chapter. The notebook tags referenced in this documentation aredan_msc_basic_usage_0.1.0,dan_msc_cs1_0.1.0,dan_msc_cs2_0.1.0,dan_msc_cs3_0.1.0,dan_msc_cs4_0.1.0.
Build environment
| Component | Pinned version |
|---|---|
| Node.js | ≥ 20 to build and run the app; ≥ 23 for scripts/chapter-numbers.mjs and scripts/test-csv-import.mjs, which import the TypeScript analyzers directly (tested on 26.0) |
| SvelteKit | ^2.57 |
| Svelte (runes) | ^5.55 |
| adapter-node | ^5.5 |
| marked | ^18.0 |
| uPlot | ^1.6 |
| Playwright (tests) | ^1.59 |
The analyzers are plain TypeScript doing IEEE-754 double arithmetic in a fixed order, so the same JSON gives the same numbers on any platform to well beyond the two decimals quoted in prose.
Data-source pinning
The finance, climate and battery presets are real data fetched from the network, not seeded generators. A rebuild is therefore not guaranteed to reproduce the shipped JSON: sources update, windows slide, and mirrors can change. What is pinned is the source URL, the build script, and the snapshot the docs were computed from.
| Dataset | Source | Build script | Cache | Overrides | Shipped snapshot |
|---|---|---|---|---|---|
finance |
Yahoo Finance https://query1.finance.yahoo.com/v8/finance/chart/<TICKER>?range=3y&interval=1d (Stooq https://stooq.com/q/d/l/?s=<ticker>.us&i=d when STOOQ_APIKEY is set) |
scripts/build-finance.mjs |
none (refetched every run) | FINANCE_END=YYYY-MM-DD (default 2026-04-21), STOOQ_APIKEY, FINANCE_SOURCE=stooq|yahoo to force a source |
Rebuilt 2026-10-09 from Yahoo; 504 business days, 2024-04-17 → 2026-04-21 (see provenance in the JSON) |
climate |
NOAA GHCN-Daily, https://www.ncei.noaa.gov/pub/data/ghcn/daily/ghcnd-stations.txt and .../by_station/<ID>.csv.gz |
scripts/build-climate.mjs |
web/.cache/ghcn/ |
CLIMATE_END=YYYYMMDD (default 20250820); window length is YEARS in the script (3) |
Rebuilt 2026-10-09; 30 of 41 stations, 2022-08-22 → 2025-08-20 (see provenance in the JSON) |
battery |
Severson et al. 2019 via the GitHub mirror https://raw.githubusercontent.com/petermattia/revisit-severson-et-al/master/data (original: matr.io project 5c48dd2bc625d700019f3204) |
scripts/build-battery.mjs |
web/.cache/severson/ |
none | 124 cells, early-life window (cycles 2–100) |
Rebuild with:
node scripts/build-finance.mjs # network every run
node scripts/build-climate.mjs # network once, then .cache/ghcn
node scripts/build-battery.mjs # network once, then .cache/severson
node scripts/build-samples.mjs # re-cut the CSV import samples from the new JSON
node scripts/chapter-numbers.mjs # recompute every number the chapters quote
Each writes static/data/<domain>.json, which is gitignored. The cached climate and battery downloads make a second rebuild on the same machine reproduce the first byte-for-byte; finance has no cache, so its prices can shift slightly as Yahoo re-adjusts for later dividends, but its window is pinned by FINANCE_END. After any rebuild, rerun scripts/chapter-numbers.mjs and update the chapter prose from its output. No chapter number should be edited by hand.
Materials datasets
The materials presets basic-usage, cs1, cs2, cs3, and cs4 are not synthetic — they are downsampled JSON re-encodings of the full CSV+info-table datasets in dan-slater/paramaterial-examples. Regenerate them with PARAMATERIAL_EXAMPLES=<clone>/examples python3 scripts/build_data.py (Python with pandas and openpyxl; the script does not import paramaterial itself). It writes to web/static/data/ unless PARAMATERIAL_DATA_OUT says otherwise. The web app does not rebuild them automatically.
Each JSON preserves per-test strain/stress arrays (≤ 2 000 samples per test, decimated from the raw ~10⁴ samples) plus the original metadata table. The decimation preserves UTS and the elastic-fit window to within < 0.5 % but does lose fine-grained fracture-tail detail.
Reproducing a quoted figure
Every "Reproducing in the web tool" section in the domain chapters is a click-path, and each preset has a stable URL that opens it with its report template: /lab/materials, /lab/finance, /lab/climate, /lab/battery (experimental, behind a banner; and /lab/cs1 … /lab/cs4 for the thesis case studies). The app's state is serialised into localStorage under the key paramaterial:blocks:v1, so after you walk the click-path once you can copy a share link from the Export menu.
When you load a preset, the following happens:
- The dataset is fetched from
/data/<id>.jsonand held in memory. - The blocks you add read it from the
datasetStoresingleton. - Every analyzer runs client-side in TypeScript. No network calls are made after the initial dataset fetch (the optional Claude chat talks to Anthropic directly with the visitor's own key, and saved projects talk to the app's own server; neither touches the numbers).
Because all computation is client-side and scripts/chapter-numbers.mjs imports the very same analyzer files, the numbers you see in your browser are the numbers that went into the docs.
Known sources of drift
- Text rounding. Correlation numbers in the chapter prose are quoted to 2 decimals; raw
Float64values will agree to 10+ decimals with a byte-identical build. - Data rebuilds. Finance always refetches (prices re-adjust for later dividends; the window stays pinned unless
FINANCE_ENDmoves); climate changes if NOAA revises a station orCLIMATE_ENDmoves; battery changes only if the mirror does. Keep the shipped JSON (or itsgenerator_note/provenancefields) alongside any number you quote, and pin thescripts/build-*.mjscommit. - Analyzer threshold changes. The knee-detection slope ratio (
2×), the UPL/LPL fit-window fraction (0.1), and the Ramberg–Osgood proof strain (0.002) are all tuneable in the source. The methodology chapter flags every tuneable parameter; the values used to produce docs numbers are the current source defaults.
Changelog
- v0.2 (2026-10-09) — finance, climate and battery presets switched from seeded synthetic generators to real data (Yahoo Finance equities, NOAA GHCN-Daily, Severson 2019); new analyzers
rollingVolatility,ewmaVolatility,volClusteringIndex(finance),fitHarmonicTrend,harmonicAmplitude,harmonicTrendPerYear(climate),fitStretchedExp,fadeExponent,fadeRateConstant(battery), with registry rowsVolCluster,HarmAmp,HarmTrend,FadeExp,FadeK; battery units corrected to Ah;retentionAtno longer extrapolates past the record; in-browser CSV import;/lab/<preset>routes;scripts/chapter-numbers.mjsadded and every domain-chapter number recomputed from the shipped JSON (closing Tier A of the fourth AI review pass; the passes are inreviews/). - v0.1.0 (2026-04-21) — initial documentation set: overview, methodology, materials (5 case studies), finance, climate, battery, glossary, this page. Two AI-generated review passes (Claude in a supervisor persona) are kept in
reviews/.
Glossary
Cross-cutting
Series
An ordered pair of equal-length numeric arrays (x, y) representing one entity's record — a stress–strain curve, a price history, a temperature trace, a discharge-capacity trace. Every block in the tool ultimately reads series.
Test
Legacy name for a single series, inherited from the materials Python library. In the TypeScript schema the array field on a dataset is still tests; each element has a test_id, a meta object, and the (strain, stress) arrays. In prose we prefer series; in code we still use Test[]. They refer to the same thing.
Metadata
The meta record attached to each test — categorical or numeric attributes that describe the entity but are not part of its time evolution (lot, temperature, sector, latitude, chemistry). The parameter scatter block uses metadata columns for its X-axis when you do not want another analyzer-derived scalar.
Analyzer
A pure function (series) → scalar (occasionally (series) → struct) that reduces one series to one or a few numbers. Analyzers live under src/lib/analyzers/<domain>.ts and are the bridge from series to parameters.
Parameter
The scalar output of an analyzer applied to a series. The Parameters block produces a table with one row per test and one column per selected analyzer; the Parameter scatter block plots one column against another or against a metadata column.
Domain
One of materials | finance | climate | battery | generic. A dataset's domain selects the analyzer menu, axis labels, and default colour-by field.
Dataset
The in-memory object passed between blocks: { id, name, description, info_columns, tests[], domain?, x_label?, y_label? }. Loaded from /data/<id>.json by loadDataset in src/lib/datasets.ts.
test_id
The stable string identifier on each test in tests[]. Used by blocks to join parameters back to metadata rows and to label points in the Parameter scatter and Properties table blocks.
Info table
The metadata view of a dataset — one row per test, one column per info_columns entry. Rendered as the top panel of the Dataset summary block; referenced in the materials chapter when describing how lot, temperature, and rate are attached to each specimen.
Experimental matrix
The full crossing of independent variables that defines a dataset's design — for materials, lot × temperature × rate; for battery, chemistry × C-rate × temperature. Referenced in the domain chapters' Provenance sections to say "N cells across a 4 × 4 × 3 matrix" and similar.
Censored cell
A battery cell whose record ends before it reaches 80 % SoH. cyclesTo80Pct returns null for these, so they appear as missing rows in the Parameters block rather than biasing the scatter toward shorter lives. The battery preset is experimental in v0.2; see ROADMAP.md (v0.4).
Materials
UPL
Upper proportional limit. Highest stress at which the stress–strain curve is still linear within tolerance. Upper bound of the fit window for Young's modulus. Computed by findUplLpl.
LPL
Lower proportional limit. Lowest stress above which the curve has cleared the noise band around zero. Paired with UPL to define the fit window for E. Computed by findUplLpl.
Young's modulus (E)
Slope of the linear portion of the stress–strain curve between LPL and UPL. GPa units in the materials preset. Computed by findE.
Ultimate tensile strength (UTS)
Maximum engineering stress reached during the test, i.e. max(stress). Computed by findUTS.
Proof stress (0.2 % offset)
Stress at the intersection of the measured curve with a line of slope E offset by 0.2 % strain. Standard engineering proxy for yield when there is no sharp yield point. Computed by findProofStress.
Ramberg–Osgood
Two-parameter plastic-strain model, ε_p = K · (σ / σ_y)^n, fitted per specimen by fitRambergOsgood. High n means nearly-perfect plasticity.
Zener–Hollomon parameter (Z)
Z = ε̇ · exp(Q / RT), a temperature-compensated strain rate used in hot-working analysis. Computed by computeZH; drives the CS3 hot-compression case study.
Flow stress
Stress on the plastic branch of the curve at a chosen plastic strain. Reported at a fixed ε_p via flowStressAt so specimens can be compared at the same deformation state.
Specimen
A single physical sample in a materials test. One specimen → one test.
Gauge length
Straight-sided region of a specimen over which strain is measured. Not computed; a standard entry in materials metadata.
Foot correction
The operation of locating UPL / LPL, fitting Young's modulus on the linear window, and shifting each curve horizontally so that its extrapolated elastic line passes through the origin. Exposed as the Foot correction block and used before proof stress and Ramberg–Osgood fits to remove machine compliance and initial take-up.
Representative curve
A per-group mean stress-at-strain trace, with optional ±1σ band, produced by grouping specimens (for example by lot or temperature), interpolating each series onto a common strain grid, and averaging. The Representative curves block renders one per group.
Fracture point
The final (strain, stress) sample before the test ends, taken as the terminus of the curve. Not currently a first-class analyzer output but referenced in the materials chapter when distinguishing UTS-at-peak from stress-at-break.
Plane-strain tension (PST)
A tensile test type in which the specimen geometry suppresses lateral contraction, enforcing ε₂ ≈ 0 in the gauge section. Appears in CS4 alongside standard uniaxial tension (UT); the resulting curves sit above UT in stress for the same material.
Test type (UT / PST / UC / PSC)
Four deformation modes carried as a metadata column in the materials presets: uniaxial tension (UT), plane-strain tension (PST), uniaxial compression (UC), and plane-strain compression (PSC). Used as a colour-by key in Stress–strain and as a facet in Representative curves; CS3 and CS4 exercise the non-UT cases.
Finance
Log return
rᵢ = ln(pᵢ / pᵢ₋₁). Time-additive: the sum over a window is the window's log return. Computed by logReturns.
Sharpe ratio
(rₐ − rf) / σₐ, the classical risk-adjusted return. Computed by sharpeRatio with a 4 % default risk-free rate.
Beta
Sensitivity of a ticker's returns to a market factor: the OLS slope of its returns on the market's. Not in the finance preset: the dataset carries no market series, so β cannot be computed in the tool yet. The finance chapter quotes an outside-the-tool β against the equal-weighted mean return and proposes the covariate schema that would make β an analyzer.
Max drawdown
Worst peak-to-trough fractional loss over a price path. Computed by maxDrawdown, which also returns (peakIdx, troughIdx) so the UI can annotate the curve.
Volatility
Sample standard deviation of daily log returns, scaled by √252 to annualise. Computed by annualizedVolatility.
Rolling volatility
Annualised standard deviation of log returns over a moving window (default 21 trading days, centred). Computed per day by rollingVolatility; a path, not a scalar, so it has no registry row.
EWMA volatility
Exponentially weighted volatility, σ̂²(t) = λ·σ̂²(t−1) + (1 − λ)·r_t², annualised by √252. Recent returns weigh more, so it reacts to regime changes within days. Computed per day by ewmaVolatility; no registry row.
RiskMetrics λ
The EWMA decay factor. RiskMetrics (J.P. Morgan, 1996) fixed λ = 0.94 for daily data, the default in ewmaVolatility. EWMA is GARCH(1,1) with ω = 0, α = 1 − λ, β = λ.
Volatility clustering
Large moves tend to follow large moves. Measured by volClusteringIndex as the correlation between |r_t| and |r_{t−1}| (registry VolCluster); positive for all 40 tickers in the finance preset.
Risk-free rate
The baseline return subtracted from a ticker's mean return in the Sharpe ratio numerator. Fixed at 4 % per year (riskFreeRate = 0.04 in sharpeRatio), a short-dated sovereign proxy rather than a live Treasury quote.
Sector
The broad sector bucket in meta.sector (eight in the preset, e.g. Technology, Energy, Utilities). Used as a colour-by key on the price overlay.
Skewness
Third standardised moment of daily log returns, computed by skewness using the Joanes–Gill correction. Negative values indicate a heavier left tail — losses larger than mirror-image gains.
Excess kurtosis
Fourth standardised moment minus 3, computed by kurtosis. Positive values indicate heavier tails than a Gaussian; every ticker in the finance preset is positive (ExKurt).
Geometric Brownian motion (GBM)
The random-walk price model behind the v0.1 synthetic finance preset. The shipped preset is real data; GBM survives only as the reference model that real returns depart from (fat tails, clustering).
Climate
Annual mean
Mean daily temperature over the full record. Computed by annualMean; the y-axis of the canonical latitude scatter.
Seasonal amplitude
Half the peak-to-peak swing of the annual cycle. Computed two ways: seasonalAmplitude from 12 pseudo-month bin means, and harmonic amplitude from the harmonic fit. Grows with latitude and continentality.
Trend
Linear slope of temperature over the record, in °C / year. trendPerYear fits a plain line and absorbs part of the seasonal cycle; harmonicTrendPerYear fits the line jointly with the cycle and is preferred.
Harmonic fit
The model T(t) = a + b·t + c·cos(ωt) + d·sin(ωt) with ω = 2π/365, fitted by OLS in fitHarmonicTrend. Gives harmonic amplitude √(c² + d²) (registry HarmAmp), trend b·365 (HarmTrend), peak day and R².
Peak day
The day on which the fitted annual cycle peaks, (atan2(d, c)/ω) mod 365, from fitHarmonicTrend. Counted on the record's own day index (day 0 is the first day of the window), not the calendar.
Poleward amplification
The observed tendency for warming to be stronger at high latitudes. Not recoverable from the three-year climate preset: neither trend estimator separates a ~0.1 °C/yr signal from weather noise at that length.
Summer anomaly
Departure of the summer mean from the full-record mean. Summer is three pseudo-month bins fixed by hemisphere (bins 5–7 for 'N', 11, 0, 1 for 'S'); the bins count from the first day of the record, so they match calendar Jun–Aug / Dec–Feb only for records starting on 1 January. Computed by summerAnomaly(series, hemisphere), which defaults to 'N' when meta.hemisphere is missing.
Annual range
Spread of the per-year means: split the record into consecutive 365-day years, take each year's mean, return max − min. Computed by annualRange; a measure of year-to-year drift, not of the seasonal swing.
Extreme hot / cold days
Count of days above (below) a threshold, computed by extremeHotDays(series, threshold) and extremeColdDays(series, threshold). The climate preset ships HotDays30 (days > 30 °C) and ColdDays0 (days < 0 °C) as registry entries.
Continentality
How far a station is from the moderating influence of the ocean, and so how large its seasonal swing is for its latitude. Not a field in the dataset; the climate chapter uses it to explain why seasonal amplitude correlates only loosely with latitude.
Altitude
Station elevation in metres, meta.altitude_m. Lowers annual mean through the lapse rate; metadata, not an analyzer output. GHCN has no elevation for Amundsen–Scott; the builder fills in the station record, 2 835 m.
Hemisphere
The 'N' / 'S' flag on each climate station's meta, used by summerAnomaly to decide which bins count as summer. Defaults to 'N' when missing.
GHCN-Daily
NOAA's Global Historical Climatology Network — Daily, the public-domain station archive behind the climate preset.
Battery
State of health (SoH)
Current discharge capacity divided by initial discharge capacity. Cycles to 80 % SoH (cyclesTo80Pct) is the usual end-of-life definition.
C-rate
Current expressed as a multiple of nominal capacity: 1 C fully charges or empties the cell in one hour, 4 C in fifteen minutes. In the battery preset meta.nominal_c_rate_charge is the first-step charge rate of the fast-charge policy (3.6–8 C).
Charging policy
Severson's two-step fast-charge protocol string, e.g. 5.3C(54%)-4C: charge at 5.3 C to 54 % state of charge, then at 4 C, followed by a standard discharge. In meta.policy; 27 distinct policies in the preset.
Cycle life
The cycle at which a Severson cell's discharge capacity first falls below 0.88 Ah (80 % of its 1.1 Ah nominal). In meta.cycle_life (148–2 237 cycles); the y-axis of the canonical battery scatter.
Cell group (batch)
Which of Severson's three test batches a cell was cycled in (meta.cell_group). Batch shifts cycle life more than C-rate does in this dataset.
Cycle
One full charge-and-discharge pair. The battery series is indexed by cycle rather than wall-clock time; the shipped window is index 0–98, Severson cycles 2–100.
Knee (in cycling)
A sharp acceleration in capacity fade after an initially gentle decay. kneeCycle looks for one with a two-segment fit; on the shipped early-life window it flags 18 of 124 cells, which are early slope changes rather than the end-of-life knee.
Cathode chemistry
meta.cathode_chemistry. Every cell in the preset is LFP (LiFePO₄ cathode, graphite anode; A123 APR18650M1A): lower energy density than nickel-rich chemistries, very long cycle life.
Capacity fade
Loss of discharge capacity with cycle number, in Ah. Summarised per cell by fadePerCycle (Ah/cycle), cyclesTo80Pct, and the stretched exponential fit.
Stretched exponential
The fade model C(n) = C₀ · exp(−k · n^α), fitted by fitStretchedExp through the log-log linearisation ln ln(C₀/C(n)) = ln k + α ln n (closed-form OLS; needs n ≥ 1 and C(n) < C₀). Weak on early-life data where capacity barely moves.
Fade exponent α
The stretching exponent of the stretched exponential, from fadeExponent (registry FadeExp). α < 1: fade decelerates; α > 1: fade accelerates.
Rate constant k
The coefficient k of the stretched exponential, from fadeRateConstant (registry FadeK), in cycle^(−α). Because its units depend on α, compare k only between cells with similar α.
Retention
Discharge capacity at a chosen cycle, as a fraction of C₀. Computed by retentionAt(series, cycle) with nearest-neighbour lookup and no extrapolation; the registry's fixed Ret500 (retention at cycle 500) is blank on the 99-cycle preset.
— end of documentation —