pandas for TypeScript
tsb is a ground-up TypeScript implementation of the pandas data
manipulation library, with full API parity, strict types, and an interactive
playground for every feature.
๐ Real-World Examples
๐ End-to-end pandas-style scenarios
Sixteen complete, real-world workflows running interactively in the browser โ sales dashboards, stock returns, A/B tests, web analytics, revenue waterfalls, SLA control towers, and more.
Feature Roadmap
๐ Project Foundation
Bun, TypeScript (strict), Biome linting, CI, Pages deployment, type system.
๐ merge
SQL-style DataFrame joins. inner/left/right/outer, on/left_on/right_on, suffixes.
๐ก str accessor
Vectorised string operations. lower/upper/strip/pad/contains/replace/split/extract & predicates.
๐ dt accessor
Vectorised datetime operations. Calendar components, boolean boundaries, strftime, floor/ceil/round.
๐ describe
Summary statistics. count/mean/std/min/percentiles/max for numeric; count/unique/top/freq for categorical. Series.quantile().
๐ฅ I/O
CSV I/O. readCsv / toCsv with dtype inference, NA handling, quoted fields, custom separators.
๐ฅ JSON I/O
JSON I/O. readJson / toJson with five orient formats: records, split, index, columns, values.
๐ corr & cov
Pearson correlation & covariance. Series.corr(), DataFrame.corr(), DataFrame.cov(), dataFrameCorr(), dataFrameCov() with index alignment, null handling, and configurable ddof/minPeriods.
๐ช rolling
Sliding-window aggregations. Series.rolling() and DataFrame.rolling() with mean, sum, std, var, min, max, count, median, apply. Supports minPeriods and centered windows.
๐ expanding
Growing-window aggregations. Series.expanding() and DataFrame.expanding() with mean, sum, std, var, min, max, count, median, apply. Window grows from start to current position.
๐ท๏ธ cat accessor
Categorical operations. Series.cat with categories, codes, ordered, addCategories, removeCategories, renameCategories, setCategories, reorderCategories, valueCounts.
๐ ewm
Exponentially Weighted Moving aggregations. Series.ewm() and DataFrame.ewm() with mean, std, var, cov, corr, apply. Decay via span, com, halflife, or alpha. Supports adjust and ignoreNa.
๐ melt
Wide-to-long reshape. Unpivot columns into variable/value pairs with id_vars, value_vars, var_name, value_name.
โ lreshape
Wide-to-long reshape with named column groups. Stack multiple wide columns into long columns with explicit grouping, dropna support.
๐ pivot & pivotTable
Reshape with aggregation. pivot() for unique reshaping; pivotTable() for aggregation (mean/sum/count/min/max/first/last) with fill_value and dropna support.
๐ stack & unstack
Pivot column labels to/from row index. stack() rotates columns into a compound-index Series; unstack() recovers the DataFrame. Custom sep, dropna, and fill_value support.
๐ rank
Assign numerical ranks to values. rankSeries() and rankDataFrame() with tie methods (average/min/max/first/dense), NaN handling (keep/top/bottom), percentage ranks, and axis support.
๐ nlargest / nsmallest
Return the n largest or smallest values. nlargestSeries(), nsmallestSeries(), nlargestDataFrame(), nsmallestDataFrame() with keep='first'/'last'/'all' tie-handling, NaN exclusion, and multi-column DataFrame sorting.
๐ cumulative operations
Compute running totals, products, maxima, and minima. cumsum(), cumprod(), cummax(), cummin() for Series and DataFrame with skipna support and axis=0/1.
โ๏ธ element-wise ops
Element-wise transformations. clip(), seriesAbs(), seriesRound() for Series and DataFrame with min/max bounds, decimal precision, and axis support.
๐ข value_counts
Count unique values. valueCounts() for Series and dataFrameValueCounts() for DataFrame with normalize, sort, ascending, and dropna options.
๐๏ธ MultiIndex
Hierarchical indexing. MultiIndex for multi-level row and column labels with fromArrays, fromTuples, fromProduct, level access, and swapLevels.
๐ฅ insertColumn / popColumn
Insert and remove DataFrame columns at precise positions. insertColumn(df, loc, col, values) inserts at integer position, popColumn(df, col) returns { series, df }. Also includes reorderColumns and moveColumn. Mirrors pandas.DataFrame.insert() and .pop().
โ๏ธ cut / qcut
Bin continuous numeric data into discrete intervals. cut() uses fixed-width or explicit bin edges; qcut() uses quantile-based bins of equal population. Both return codes, labels, and bin edges. Mirrors pandas.cut and pandas.qcut.
๐ Rolling Extended Stats
Higher-order rolling window statistics: rollingSem (standard error of mean), rollingSkew (Fisher-Pearson skewness), rollingKurt (excess kurtosis), and rollingQuantile (arbitrary percentile with 5 interpolation methods). Mirrors pandas.Series.rolling().sem/skew/kurt/quantile().
๐ง Rolling Apply & Multi-Agg
Standalone custom rolling-window functions: rollingApply (custom fn per window), rollingAgg (multiple named aggregations โ DataFrame), dataFrameRollingApply, dataFrameRollingAgg. Supports minPeriods, center, and raw mode. Mirrors pandas.Rolling.apply() and Rolling.agg().
๐ช Window Indexers
Custom window indexers for rolling computations: BaseIndexer (abstract base), FixedForwardWindowIndexer (forward-looking N-row window), VariableOffsetWindowIndexer (per-row variable depth), and applyIndexer() helper. Mirrors pandas.api.indexers.
๐บ๏ธ Series.map()
Map Series values using a function, Record/dict, another Series (index-label lookup), or ES6 Map. Missing keys produce null. Optional naAction: "ignore" passes NA values through unchanged. Mirrors pandas.Series.map().
โ๏ธ pd.options system
getOption ยท setOption ยท resetOption ยท describeOption ยท optionContext ยท options proxy. Full validator support and 20+ built-in options across display.*, mode.*, compute.* namespaces. Mirrors pandas.get_option / pandas.set_option.
๐ญ where / mask
Element-wise conditional selection: seriesWhere / seriesMask and dataFrameWhere / dataFrameMask. Accepts boolean arrays, label-aligned boolean Series/DataFrame, or callables. Mirrors pandas.Series.where, pandas.DataFrame.where, and their .mask() inverses.
๐ query / eval
Filter rows or evaluate expressions using a pandas-style expression string. queryDataFrame(df, "col > 5 and label in ['a', 'b']") and evalDataFrame(df, "price * qty"). Supports arithmetic, comparisons, logical operators, membership tests, backtick-quoted column names, and built-in functions (abs, round, isnull, lower, โฆ). Mirrors pandas.DataFrame.query and pandas.DataFrame.eval.
๐ isna / notna
Module-level missing-value detection: isna, notna, isnull, notnull work on scalars, arrays, Series, and DataFrames. Plus standalone fillna, dropna, countna, and countValid. Mirrors pandas.isna, pandas.notna, pandas.isnull, pandas.notnull.
๐ท๏ธ attrs โ User Metadata
Attach arbitrary keyโvalue metadata to any Series or DataFrame via a WeakMap registry. Provides getAttrs, setAttrs, updateAttrs, copyAttrs, withAttrs, mergeAttrs, clearAttrs, getAttr, setAttr, deleteAttr, attrsCount, attrsKeys. Mirrors pandas.DataFrame.attrs / pandas.Series.attrs.
๐ฉ flags โ Metadata Flags
Metadata flags for DataFrame and Series. The flags getter returns a Flags object with allowsDuplicateLabels property. Setting allowsDuplicateLabels = false on an object with duplicate index labels raises DuplicateLabelError. Mirrors pandas.DataFrame.flags / pandas.core.flags.Flags.
๐ค string_ops โ Standalone String Ops
Module-level string utilities: strNormalize (Unicode NFC/NFD/NFKC/NFKD), strGetDummies (one-hot DataFrame), strExtractAll (all regex matches), strRemovePrefix, strRemoveSuffix, strTranslate (char-level substitution), strCharWidth (CJK-aware display width), strByteLength. Works on Series, arrays, or scalars.
๐ค string_ops_extended โ Extended String Ops
Advanced string utilities: strSplitExpand (split โ DataFrame columns), strExtractGroups (regex capture groups โ DataFrame), strPartition / strRPartition (split into before/sep/after), strMultiReplace (batch replacements), strIndent / strDedent (line-level indentation). Works on Series, arrays, or scalars.
๐ pipe_apply โ Pipeline & Apply Utilities
Standalone equivalents of pandas' pipe() / apply() / applymap(): pipe (variadic type-safe pipeline), seriesApply (element-wise with label/pos context), seriesTransform, dataFrameApply (axis 0/1), dataFrameApplyMap (cell-wise), dataFrameTransform (column-wise), dataFrameTransformRows (row-wise).
๐ข numeric_extended โ Numeric Utilities
numpy/scipy-style numeric utilities: digitize (bin values), histogram (frequency counts with density option), linspace / arange (number sequences), percentileOfScore (percentile rank of a score), zscore (z-score standardisation), minMaxNormalize (scale to [0,1] or custom range), coefficientOfVariation (std/mean). Series-aware variants included.
๐ท๏ธ categorical_ops โ Categorical Utilities
Standalone categorical helpers: catFromCodes (from integer codes), set operations (catUnionCategories, catIntersectCategories, catDiffCategories, catEqualCategories), catSortByFreq, catToOrdinal, catFreqTable, catCrossTab, catRecode.
๐ข format_ops โ Number Formatting
Number-formatting helpers for Series and DataFrame. Scalar formatters: formatFloat, formatPercent, formatScientific, formatEngineering, formatThousands, formatCurrency, formatCompact. Formatter factories: makeFloatFormatter, makePercentFormatter, makeCurrencyFormatter. Apply to collections: applySeriesFormatter, applyDataFrameFormatter. Render to string: seriesToString, dataFrameToString.
๐ Excel I/O
XLSX file reading. readExcel() parses Excel files from a Uint8Array/ArrayBuffer โ ZIP+XML parsing from scratch, shared strings, number/string/boolean cells, sheet selection, header, indexCol, skipRows, nrows.
๐ missing-value ops
Detect and fill missing values. isna(), notna(), isnull(), notnull() for scalars/Series/DataFrame. ffillSeries(), bfillSeries(), dataFrameFfill(), dataFrameBfill() with optional limit and axis support.
๐ diff / shift
Discrete difference and value shifting for Series and DataFrame. diff computes element-wise differences; shift lags or leads values by a number of periods. Essential for time-series analysis.
๐ข NaN-Ignoring Aggregates
Top-level nan-ignoring aggregate functions: nansum, nanmean, nanmedian, nanstd, nanvar, nanmin, nanmax, nanprod, nancount. Mirrors numpy.nan* functions. Works on arrays and Series.
โฑ๏ธ toTimedelta
Convert scalars, arrays, or Series to Timedelta objects. Accepts pandas-style strings, ISO 8601, human-readable, and numeric values. Timedelta class with arithmetic: add/subtract/scale/abs/lt/gt/eq.
โณ timedelta_range
Generate fixed-frequency TimedeltaIndex sequences. Supports start/end/periods/freq combinations, multiplier prefixes (e.g. "2H", "30min"), linear spacing, and closed endpoint control.
๐ strFindall & toJsonDenormalize
strFindall/strFindallCount/strFindFirst/strFindallExpand โ regex match extraction per element (mirrors pandas str.findall). toJsonDenormalize/toJsonRecords/toJsonSplit/toJsonIndex โ serialize DataFrames to nested or flat JSON.
๐ cutBinsToFrame
Convert cut/qcut BinResult into a tidy summary DataFrame. cutBinsToFrame returns bin labels, edges, counts, and frequencies. cutBinCounts returns a labelโcount dict. binEdges returns an edges-only DataFrame.
โ๏ธ xs โ Cross-Section
xsDataFrame / xsSeries โ select rows or columns by label (mirrors pandas .xs()). Supports flat and MultiIndex, axis selection, level targeting, and dropLevel control.
โ๏ธ between โ Range Check
seriesBetween โ element-wise range check returning a boolean Series. Mirrors pandas Series.between(). Supports inclusive="both"|"left"|"right"|"neither".
๐ update โ In-place Update
seriesUpdate / dataFrameUpdate โ update values from another object using label alignment. Non-NA values in other overwrite self. Mirrors pandas DataFrame.update().
๐ฝ filter โ Filter Labels
filterDataFrame / filterSeries โ filter rows or columns by label using items list, substring (like), or regex pattern. Mirrors pandas DataFrame.filter().
๐ combine โ Element-wise Combination
combineSeries / combineDataFrame โ combine two objects element-wise with a caller-supplied binary function. Result index is the union of both indices. Mirrors pandas Series.combine() / DataFrame.combine().
โ keepTrue / keepFalse / filterBy โ Boolean Indexing
keepTrue / keepFalse / filterBy โ boolean-mask selection helpers for Series and DataFrames. Mirrors pandas boolean indexing (series[mask], df[mask]).
๐ข scalar_extract โ squeeze / item / bool / first_valid_index
squeezeSeries / squeezeDataFrame / itemSeries / boolSeries / boolDataFrame / firstValidIndex / lastValidIndex โ scalar-extraction helpers for Series and DataFrames. Mirrors pandas Series.squeeze(), item(), bool(), first_valid_index(), last_valid_index().
๐ corrWith / autoCorr โ Pairwise Correlation & Autocorrelation
corrWith / autoCorr โ compute pairwise Pearson correlations between a DataFrame and a Series or DataFrame, and compute lag-N autocorrelation for a Series. Mirrors pandas DataFrame.corrwith() and Series.autocorr().
๐ join / joinAll / crossJoin โ Label-Based Joins
join / joinAll / crossJoin โ join DataFrames by index labels or a key column. join() defaults to left-join-on-index, joinAll() chains multiple joins, crossJoin() produces the Cartesian product. Mirrors pandas DataFrame.join().
โฑ๏ธ merge_asof โ Ordered Nearest-Key Join
mergeAsof โ ordered left-join on the nearest key (backward/forward/nearest). Ideal for time-series: match trades to most recent quotes. Supports by-group matching, tolerance, allow_exact_matches, and custom suffixes. Mirrors pandas.merge_asof().
๐ merge_ordered โ Ordered Fill Merge
mergeOrdered โ ordered outer/inner/left/right merge sorted by key column(s). Supports fill_method: "ffill" to forward-fill null gaps, left_by/right_by for group-wise ordered merging, left_on/right_on for different key names, and suffix handling. Mirrors pandas.merge_ordered().
๐ resample โ Time-Based Resampling
resampleSeries / resampleDataFrame โ time-based groupby aggregation. Supports S/T/H/D/W/MS/ME/QS/QE/YS/YE frequencies, aggregations (sum, mean, min, max, count, first, last, std, var, size, ohlc), per-column agg specs, and automatic empty-bin filling. Mirrors pandas.DataFrame.resample().
๐ infer_objects / convert_dtypes โ Dtype Inference
inferObjectsSeries / inferObjectsDataFrame / convertDtypesSeries / convertDtypesDataFrame โ promote object-typed Series to better dtypes and parse string columns as numbers. Mirrors pandas infer_objects() and convert_dtypes().
๐งช testing โ Assertion Utilities
assertSeriesEqual / assertFrameEqual / assertIndexEqual โ rich assertion helpers for use in test suites. Numeric tolerance, checkLike column-order mode, dtype checks, AssertionError with detailed diff messages. Mirrors pandas.testing.
๐จ Styler โ DataFrame Style API
dataFrameStyle(df) ยท highlightMax / highlightMin / highlightNull / highlightBetween ยท backgroundGradient / textGradient ยท barChart ยท format / formatIndex ยท apply / applymap / map ยท setCaption / setTableStyles / hide ยท toHtml / toLatex. Mirrors pandas.DataFrame.style (Styler).
๐ hashPandasObject โ FNV-1a Hashing
hashPandasObject(s) ยท hashPandasObject(df) ยท index option. Mirrors pandas.util.hash_pandas_object. FNV-1a 64-bit per element or row.
๐๏ธ pdArray โ pd.array() Factory
pdArray(data, dtype?) โ create typed arrays from any iterable. Dtype inference for int64/float64/bool/string/datetime. Mirrors pandas.array().
๐ Table Formatters โ to_markdown / to_latex
toMarkdown() and toLaTeX() โ render DataFrames and Series as Markdown tables or LaTeX tabular environments. Mirrors pandas.DataFrame.to_markdown() and to_latex().
๐ readHtml โ pd.read_html()
readHtml(html, opts?) โ parse HTML tables into DataFrames. Header detection, NA handling, numeric coercion, thousands/decimal separators, indexCol, match filter. Mirrors pandas.read_html().
๐ readXml / toXml โ pd.read_xml() / DataFrame.to_xml()
readXml(text, opts?) / toXml(df, opts?) โ parse XML into DataFrames and serialize back. rowTag auto-detection, attributes, CDATA, entities, namespaces, usecols, nrows, indexCol. Mirrors pandas.read_xml() / DataFrame.to_xml().
๐ readTable โ pd.read_table()
readTable(text, opts?) โ parse delimiter-separated text into a DataFrame. Defaults to tab separator; all ReadCsvOptions forwarded. Mirrors pandas.read_table().
๐๏ธ SQL I/O โ pd.read_sql() / DataFrame.to_sql()
readSql / readSqlQuery / readSqlTable / toSql โ adapter-based SQL I/O. Bring your own DB driver; zero runtime dependencies. Mirrors pandas.read_sql(), read_sql_query(), read_sql_table(), DataFrame.to_sql().
๐ readStata & toStata โ pd.read_stata() / DataFrame.to_stata()
readStata / toStata โ Stata DTA binary file I/O. Supports reading v114/115 (old binary) and v117/118/119 (new XML-tagged) formats; writes v118. Missing values, string columns, value labels (convertCategoricals). Mirrors pandas.read_stata(), DataFrame.to_stata().
๐ฆ readParquet & toParquet โ pd.read_parquet() / DataFrame.to_parquet()
readParquet / toParquet โ Apache Parquet binary file I/O. Pure-TypeScript Thrift compact protocol, PLAIN encoding, INT32/INT64/DOUBLE/BOOLEAN/BYTE_ARRAY types, optional columns, usecols/nRows/indexCol/writeIndex. Mirrors pandas.read_parquet(), DataFrame.to_parquet().
๐ readFwf โ pd.read_fwf()
readFwf(text, opts?) โ read fixed-width formatted text into a DataFrame. Auto-infers column boundaries from whitespace patterns; supports explicit colspecs / widths, header, names, indexCol, NA handling, dtype forcing, skipRows, nRows. Mirrors pandas.read_fwf().
๐ case_when โ pd.Series.case_when()
caseWhen(series, caselist) โ conditional value selection using ordered CASE WHEN semantics. Mirrors pandas.Series.case_when() (pandas 2.2+).
๐๏ธ readHdf & toHdf โ pd.read_hdf() / DataFrame.to_hdf()
readHdf / toHdf โ HDF5 v0 Superblock binary file I/O. Pure-TypeScript, no native deps. Float64/32, Int/UInt 8โ64, Bool, fixed-length UTF-8 strings. usecols, indexCol, writeIndex, custom key. Mirrors pandas.read_hdf(), DataFrame.to_hdf().
๐ข pd.arrays โ Nullable Typed Extension Arrays
Nullable typed arrays: IntegerArray, FloatingArray, BooleanArray, StringArray, DatetimeArray, TimedeltaArray. Three-valued logic, NA masking, element-wise arithmetic, string ops. Mirrors pandas.arrays.
๐๏ธ Holiday Calendars โ pd.tseries.holiday
Holiday calendar system: Holiday rules (fixed & floating), AbstractHolidayCalendar, USFederalHolidayCalendar (11 US federal holidays), observance helpers (nearestWorkday, sundayToMonday, โฆ), and weekday offsets (MO, TH, โฆ). Mirrors pandas.tseries.holiday.
๐ณ๏ธ SparseArray & SparseDtype โ pd.arrays.SparseArray
Memory-efficient sparse storage for arrays with many repeated (fill) values. SparseArray stores only non-fill values and their positions. Properties: sp_values, sp_index, density, npoints. Aggregations: sum, mean, max, min, std. Mirrors pandas.arrays.SparseArray and pandas.SparseDtype.
๐ฌ Hypothesis Tests โ scipy.stats t-tests, chiยฒ, ANOVA, KS
scipy-style statistical hypothesis tests implemented from scratch: ttest1samp, ttestInd (Welch's), ttestRel (paired), chi2Contingency, fOneway (ANOVA), jarqueBera (normality), pearsonr, spearmanr, mannWhitneyU, kstest. Returns { statistic, pvalue }.
๐ Regression โ linregress, polyfit, OLS
Linear and polynomial regression from scratch: linregress (simple OLS with slope, r, p, stderr), polyfit / polyval (polynomial least squares), and OLS class (multiple regression with Rยฒ, F-test, AIC, BIC, predict(), summary()). Mirrors scipy.stats.linregress, numpy.polyfit, and statsmodels.OLS.
๐ Contingency Tables โ expectedFreq, relativeRisk, oddsRatio, association
Association and effect-size measures for contingency tables: expectedFreq (expected cell counts under independence), relativeRisk (risk ratio with log-normal CI), oddsRatio (Woolf CI), and association (Cramรฉr's V, phi, Pearson's C, Tschuprow's T). Mirrors scipy.stats.contingency.
๐ญ Multivariate Analysis โ mahalanobis, PCA
Multivariate statistical analysis: mahalanobis distance (ฮฃโปยน-weighted Euclidean, mirrors scipy.spatial.distance.mahalanobis), PCA class (eigendecomposition of the covariance matrix, mirrors sklearn.decomposition.PCA), plus covMatrix and invertMatrix helpers.
๐ฒ Bootstrap โ non-parametric confidence intervals
Non-parametric bootstrap confidence intervals for any statistic: bootstrap (one or two samples, mirrors scipy.stats.bootstrap), bootstrap1 (single-sample convenience). Methods: percentile, basic (pivoting), and BCa (bias-corrected accelerated, default). Seeded RNG for reproducibility.
๐ Kernel Density Estimation (KDE)
Non-parametric density estimation using Gaussian kernels: gaussianKDE (mirrors scipy.stats.gaussian_kde). Bandwidth methods: Silverman (default), Scott, or custom factor. API: pdf, evaluate, logPdf, integrate, cdf, resample, integrateGaussian, weighted KDE.
โน๏ธ Information Theory
Shannon entropy, KL divergence, Jensen-Shannon divergence/distance, cross-entropy, mutual information, conditional entropy, normalised MI, variation of information, joint entropy, Rรฉnyi entropy, and Tsallis entropy. Mirrors scipy.stats.entropy and related utilities.
๐ก Signal Processing โ FFT, STFT, Welch PSD
FFT/IFFT/RFFT (Cooley-Tukey radix-2), fftFreq, fftshift/ifftshift, 8 window functions (getWindow), Short-Time Fourier Transform (stft/istft with overlap-add), Welch power spectral density, and periodogram. Mirrors numpy.fft and scipy.signal.
๐๏ธ Digital Filters โ FIR, Butterworth IIR
FIR filter design via windowed-sinc (firwin), Butterworth IIR (butter), frequency response (freqz, sosfreqz), and filter application: lfilter (causal), filtfilt (zero-phase), sosfilt, sosfiltfilt. Mirrors scipy.signal.
๐๏ธ ORC Format I/O โ readOrc / toOrc
Apache ORC (Optimized Row Columnar) file format reader and writer. Supports BOOLEAN, INT/LONG, FLOAT/DOUBLE, STRING columns with NONE compression and RLE v1 / direct encoding. Mirrors pandas.read_orc() and DataFrame.to_orc().
๐ ACF / PACF & Portmanteau Tests
autocorr, acf (Bartlett CI), pacf (Levinson-Durbin), ccf, durbinWatson, Ljung-Box and Box-Pierce portmanteau tests. Mirrors statsmodels.tsa.stattools and pd.Series.autocorr.
๐ ARIMA(p,d,q) Time-Series Models
ARIMAModel and fitArima โ Hannan-Rissanen two-step estimation, multi-step forecasting, prediction intervals, AIC/BIC. Mirrors statsmodels.tsa.arima.model.ARIMA.
๐ญ Kalman Filter & RTS Smoother
KalmanFilter โ linear Gaussian state-space models with forward Kalman filter and backward RTS smoother. Factory helpers localLevel, localLinearTrend. Missing observations handled transparently.
๐ฆ Apache Avro OCF I/O โ readAvro / toAvro
readAvro and toAvro โ Apache Avro Object Container File reader and writer. Supports all Avro primitives, arrays, maps, unions, and records. Zigzag varint encoding. Mirrors pandas.read_avro().
๐ Exponential Smoothing โ ETS / Holt-Winters
SimpleExpSmoothing, Holt, and ExponentialSmoothing โ SES, Holt linear trend, and full Holt-Winters with additive/multiplicative seasonal components. Nelder-Mead parameter optimisation, AIC/BIC/AICc, prediction intervals. Mirrors statsmodels.tsa.holtwinters.ExponentialSmoothing.
๐ฒ Dynamic Linear Model (DLM)
DLM โ West & Harrison state-space framework. Local-level, local-linear-trend, polynomial trend, Fourier seasonal components, free combination via combineDLMs. Kalman filter, RTS smoother, h-step forecasting, MLE fitting, discount-factor model. Mirrors the R dlm package.
๐ฎ Hidden Markov Model (HMM)
GaussianHMM, MultinomialHMM โ Baum-Welch EM parameter estimation, Viterbi decoding, forward-backward log-space algorithm. Regime detection, sequence labeling. Mirrors hmmlearn.
โก Benchmarks
Side-by-side performance comparison of tsb (TypeScript/Bun) vs pandas (Python). Timing metrics for each function.