# Changelog

This changelog is generated automatically from [GitHub Releases](https://github.com/rich-iannone/greenwood/releases).


# v0.1.0

*2026-07-07* · [GitHub](https://github.com/rich-iannone/greenwood/releases/tag/v0.1.0)

**Initial release** : modern survival analysis for Python which is Narwhals-native, R-validated, and beautifully visualized.


### Highlights

Greenwood brings production-ready survival analysis to the Python data ecosystem. It works with whatever dataframe library you use (Pandas, Polars, PyArrow, or any [Narwhals](https://narwhals-dev.github.io/narwhals/)-compatible frame), every statistic is validated to tolerance against R's `survival` package, and interactive publication-quality plots come out of the box. From a single Kaplan-Meier curve to competing-risks regression and penalized Cox models, everything lives under a unified API.


### Core Statistical Methods

- **[Surv](reference/Surv.html#greenwood.Surv) response object** -- Represents survival data in right-, left-, and interval-censored form, counting-process form, left truncation, case weights, and multi-state endpoints, with built-in validation.
- **Kaplan-Meier estimation** ([KaplanMeier](reference/KaplanMeier.html#greenwood.KaplanMeier)) -- Survival curves with Greenwood variance, multiple confidence interval types, median/quantile survival, restricted mean survival time (RMST), and step-function predictions at arbitrary times.
- **Nelson-Aalen estimator** ([NelsonAalen](reference/NelsonAalen.html#greenwood.NelsonAalen)) -- Cumulative hazard curves with the same tidy output conventions as [KaplanMeier](reference/KaplanMeier.html#greenwood.KaplanMeier).
- **Log-rank tests** ([logrank_test()](reference/logrank_test.html#greenwood.logrank_test), [pairwise_logrank_test()](reference/pairwise_logrank_test.html#greenwood.pairwise_logrank_test)) -- Standard log-rank and the full G-rho (Fleming-Harrington) family for two or more groups, plus pairwise comparisons with p-value adjustment.
- **Cox proportional hazards** ([CoxPH](reference/CoxPH.html#greenwood.CoxPH)) -- Hazard-ratio regression with stratification, robust/sandwich variance, cluster-robust standard errors, baseline hazard prediction, and full model diagnostics (Schoenfeld residuals, proportional-hazards test via [cox_zph()](reference/CoxPH.html#greenwood.CoxPH.cox_zph), concordance index).
- **Penalized Cox regression** ([CoxNet](reference/CoxNet.html#greenwood.CoxNet)) -- Lasso, ridge, and elastic-net penalized Cox models for high-dimensional covariates.
- **Accelerated failure time models** ([AFT](reference/AFT.html#greenwood.AFT)) -- Parametric survival regression with Weibull, exponential, log-normal, and log-logistic distributions, validated against R's `survreg`.
- **Flexible parametric models** ([RoystonParmar](reference/RoystonParmar.html#greenwood.RoystonParmar)) -- Royston-Parmar spline-based survival models.
- **Competing risks** ([AalenJohansen](reference/AalenJohansen.html#greenwood.AalenJohansen), [FineGray](reference/FineGray.html#greenwood.FineGray)) -- Cumulative incidence functions via Aalen-Johansen, subdistribution hazard regression via Fine-Gray, and multi-state transition probabilities ([MultiState](reference/MultiState.html#greenwood.MultiState)).
- **Event table** ([EventTable](reference/EventTable.html#greenwood.EventTable), [event_table()](reference/event_table.html#greenwood.event_table)) -- Raw risk-set and event counts at each unique time point.


### Model Performance & Validation

- **Concordance index** -- Harrell's C-statistic for evaluating discriminative ability.
- **Brier score & integrated Brier score** -- IPCW-weighted calibration metrics at arbitrary time points.
- **Calibration** -- Graphical and numeric calibration assessment.
- **Cross-validation** ([cross_validate()](reference/cross_validate.html#greenwood.cross_validate)) -- K-fold cross-validation pipeline for any Greenwood model.
- **Power analysis** ([logrank_power()](reference/logrank_power.html#greenwood.logrank_power), [logrank_sample_size()](reference/logrank_sample_size.html#greenwood.logrank_sample_size), [logrank_n_events()](reference/logrank_n_events.html#greenwood.logrank_n_events)) -- Prospective sample size and power calculations for log-rank tests.


### Visualization

- **[plot_survival()](reference/plot_survival.html#greenwood.plot_survival)** -- Interactive survival curves with confidence bands, censoring tick marks, and optional aligned at-risk tables; choose between Altair and plotnine backends.
- **[risk_table()](reference/risk_table.html#greenwood.risk_table)** -- Standalone aligned at-risk table, composable with any plot.


### Tidy & Reproducible Output

- **Tidy summaries** (`tidy()`, `glance()`, `augment()`) -- Broom-compatible model summaries that return tidy DataFrames with consistent column names across all estimators.
- **Built-in datasets** -- `lung`, `veteran`, `ovarian`, `pbc`, `colon`, `mgus2`, and more, loadable in any supported backend via `gw.load_dataset(name, backend=...)`.
- **R-parity test harness** -- Every statistic ships with fixtures validated against R's `survival` package.


### Dataframe Compatibility

Greenwood is built on [Narwhals](https://narwhals-dev.github.io/narwhals/), so all methods accept and return Pandas DataFrames, Polars DataFrames, PyArrow Tables, or any other Narwhals-compatible frame. Use the `format=` argument on output methods to control which type of table you get back.


### Requirements

- Python \>= 3.10
- Core dependencies: `narwhals>=2.0`, `numpy>=1.24`, `scipy>=1.11`
