Forecasting a Running Battery Cell: A Straight Line, a Power Law and the Proven Life
A forecast of each cell that is still running when a test stops can improve the rated life, but only if it beats the rating at the stop. This post compares a straight line, a power law and a Weibull model on 13 cells and tests them on 128 cells of another design.
Series: Bayesian Modelling for Industrial Applications, Part 4, second post. The first post of Part 4 showed that a test stopped early leaves running cells whose life exceeds the stop, so that a rating at the stop never exceeds their real life, and that dropping them or counting the stop as a failure biases the quote. This post asks whether a forecast of each running cell can do better, and how a reader can tell before relying on one.
A forecast of a running cell can use the lives alone, as the Weibull model of the first post does, or the measurements of capacity that the test has recorded. The 13 cells of the CALCE laboratory of Part 3 are used to compare three forecasts at five stops: a straight line through the recent loss of capacity, a hierarchical power law fitted to every measurement,1 and the Weibull model. The line beats the others and the rating at the stop from 600 cycles, and that is the result that a reader would act on. The last check tests it on 128 cells of another design, where the line does worse than a rating at the stop at every stage of the test. A forecast that wins on one set of cells has not yet won anywhere else, and the procedure at the end asks a reader to test it on earlier cells of their own design.
Show the setup of the notebook
from importlib.metadata import versionimport osfrom pathlib import Pathimport tempfileimport warningswarnings.filterwarnings("ignore")os.environ.setdefault("OMP_NUM_THREADS", "2")import numpy as npimport pandas as pdfrom bayes import baseline, degradation, eol_study, stopping, survivalfrom bayes.data import calce, seversonfrom bayes.plot import eol, hierarchyfrom bayes.plot.inline import showfrom bayes.plot.theme import BLUE, INK, SLATEFAST = os.environ.get("HIER_FAST") =="1"# a smoke test with a few draws, to check that the notebook runsCACHE = Path("cache-eol-fast"if FAST else"cache-eol")CACHE.mkdir(exist_ok=True)FEATURES = ["charge_current_auc", "charge_current_mean", "discharge_voltage_auc", "discharge_voltage_crest"]STOPS = (500, 600, 700, 800, 900) # cycles at which the test stopsCONFIG = {"draws": 40if FAST else500, "tune": 40if FAST else1500, "chains": 2if FAST else4, "target_accept": 0.99}METHODS = {"Line": BLUE, "Path": INK, "Weibull": SLATE, "Proven": SLATE}SEVERSON = Path(os.environ.get("SEVERSON_DIR", "../data/severson")) # the reduced per-cycle table of the Severson cellsSHARES = (0.0, 0.1, 0.2, 0.33, 0.5, 0.67, 0.8, 0.9) # shares of the cells that have failed at which a test is stoppedEXAMPLE = ("b3c7", (858, 1200, 1500)) # a slow cell of the third batch and the stops at which its line is drawnLINETYPES = {"Line": "solid", "Path": "dashed", "Weibull": "longdash", "Proven": "dotted"}print("pymc", version("pymc"), "| fast mode:", FAST)
Show the loading of the data
features = Path(tempfile.gettempdir()) /"calce-battery-features.parquet"full = calce.load(features, FEATURES, every=1) # every cycle, for the first crossing of each cell and for the linesample = calce.load(features, FEATURES, every=8) # every eighth cycle, for the path model, as in Part 3table = survival.end_of_life(full)CHEMISTRIES =list(dict.fromkeys(table["CellType"]))COLOURS = hierarchy.palette(CHEMISTRIES)print(table[["cell", "CellType", "first", "last", "eol"]].to_string(index=False))for stop in STOPS: records = survival.truncate(table, stop)print(f"stop {stop}: {int(records['event'].sum())} crossings seen, {int((~records['event']).sum())} cells running")
A rated life is the number of cycles that a manufacturer promises. When a cycle promised beyond the real life costs nine times as much as a cycle held back, the best rating is the 10% quantile of the predicted life, the B10 life, and the loss of a rating for an observed life is the pinball loss at ,2
which is 0.1 for each cycle held back and 0.9 for each cycle promised too many. A cell that is running at the stop is known to last longer than the stop, so a rating at the stop never exceeds its real life and costs only with no model at all. This proven life is the reference that every forecast has to beat, and the skill of a forecast is the share of the proven-life loss that it removes, . A skill of zero adds nothing that the test had not shown, and a negative skill is worse than rating at the stop.
Straight Line and Power Law
The Weibull model of the first post offers a running cell nothing beyond its chemistry and the fact that it is still in service. Two methods use the measurements of capacity that the test has recorded. The curve of Part 3 cannot be extended to a crossing, because its mean levels off at a constant unless a diagnostic, measured in the same cycle as the capacity, keeps it falling, and the diagnostics of a future cycle are not known. Both methods here use a function of the cycle alone.
The first is a straight line fitted to the loss of capacity, 100 minus the state of health, over the last 100 cycles before the stop and extended to the loss of 20 points that defines the end of life. Its interval comes from the uncertainty of the fitted line, widened for the correlation of successive residuals: with a lag-one correlation , the residuals carry the information of independent ones. The second is a hierarchical power law fitted to every measurement,3
where is the loss after 500 cycles and is the shape of the decline: linear at 1, decelerating below it and accelerating above it. It reaches the end-of-life loss of 20 points at , so that every posterior draw of a cell gives a crossing cycle in closed form. The parameters of a cell are drawn around the mean of its chemistry, and the noise of the measurement is normal. Two choices of this model were found by failure. A reference of 1,000 cycles, outside the early data, made the level and the shape trade off, and one fit took 29 minutes with 15 divergent transitions. A common parent of the two chemistries gave 49 divergent transitions, because two groups cannot inform a spread, and a prior for each chemistry removed them. Figure 1 shows the fitted paths for a test that stops at 600 cycles.
Figure 1: Fitted loss paths of each chemistry for a test that stops at 600 cycles. Hollow points are the measurements seen, grey points those not seen, dashed lines the paths beyond the stop and diamonds the observed end of life.
Of the nine cells that are running at 600 cycles, none has a fitted shape above 0.99. The shapes lie between 0.57 and 0.99, so the fitted paths decelerate or are linear, and the dashed continuation of every running cell reaches 20 points after the cycle at which the cell really crossed. The cause is visible in the slope. At 600 cycles the fitted path of a running cell falls by 1.0 to 2.1 points per 100 cycles, while the measured loss of its last 100 cycles fell by 2.2 to 3.9, so that the fitted slope is between 44% and 69% of the measured one. A concave power law fitted to a decline that is flat at first and steeper later underestimates the present slope, and every crossing that it predicts is late. Figure 2 asks whether the decline also changes after the stop. It draws the slope of the loss in the 100 cycles before the real end of life against its slope in the 100 cycles before the stop, and a cell above the diagonal declined faster at the end than at the stop.
Show the code of the figure
for stop in (500, 600): show(lambda stop=stop: eol.knee(slopes[stop], table, COLOURS))
(a) Stop at 500 cycles
(b) Stop at 600 cycles
Figure 2: Slope of the loss before the end of life against its slope before the stop, for the cells running at stops of 500 and 600 cycles. A point above the dotted diagonal declined faster at the end.
At 500 cycles ten of the 13 running cells decline faster before their end of life than at the stop, and the median slope rises from 2.1 to 3.9 points per 100 cycles. The decline is still speeding up, so any extrapolation of the slope at the stop is late, which the bias of the line, 313 cycles too long on average at that stop, confirms. At 600 cycles the decline has steadied. Four of the nine cells lie above the diagonal, the two CS2 cells clearly, and the median slope falls from 3.6 to 2.4 points per 100 cycles as the cells approach 80%. The line, which assumes that the recent slope continues, is therefore nearly unbiased at 600 cycles, with a mean error of cycles, and its remaining error comes from cells that slow down. The shape of the decline changes with the age of the cell, so a method has to be judged at the stop at which it will be used.
Prediction of Running Cells
All three methods predict the end of life of the cells that are still running at the stop, conditioned on the cell being in service then. For the Weibull model of the first post that is a draw from the conditional distribution given a life above the stop. For the line and the path it is the crossing of each draw, with the draws at or below the stop dropped, since the cell is known to have survived it. Each prediction is scored by the error of its median, by whether its central 90% interval holds the observed life, and by the pinball loss of the 10% quantile as the rated life. Figure 3 shows the intervals for the nine cells that are running at 600 cycles.
Show the code of the figure
for method in ("Weibull", "Line", "Path"): show(lambda method=method: eol.intervals(scores[(scores["stop"] ==600) & (scores["method"] == method)], 600, COLOURS, width=330))
(a) Weibull model
(b) Straight line
(c) Power-law path
Figure 3: Median and 90% interval predicted for each of the nine cells running at 600 cycles by the three methods. A diamond is the observed end of life, and an interval that runs past 2,000 cycles is cut there.
The Weibull intervals carry no information about the cell and are almost the same for every cell of a chemistry: they are wide and cover 7 of the 9 observed lives. The line intervals follow the cells, with medians near the diamonds, but they hold fewer of the lives than 90% of the cells, as the next section counts. The path intervals are narrow and lie to the right of the observed life, so they hold it for one cell only, CX2_16, whose interval is wide because its life is the longest. The power law is the model that is sure of the wrong answer.
Accuracy at Every Stop
Figure 4 follows the methods over the five stops, with the error of the median, the coverage of the intervals and the skill of the rated life against the proven life.
Show the code of the figure
models = {k: v for k, v in METHODS.items() if k !="Proven"}lines = {k: v for k, v in LINETYPES.items() if k !="Proven"}show(lambda: eol.accuracy(summary[summary["method"] !="Proven"], "median_error", "Median absolute error (cycles)", models, None, lines))show(lambda: eol.accuracy(summary[summary["method"] !="Proven"], "coverage", "Share of intervals that hold the end of life", models, 0.9, lines, reference_label="Intended 90%"))show(lambda: eol.accuracy(skill, "skill", "Share of the proven-life loss removed", models, 0.0, lines, reference_label="Rating at the stop"))
(a) Median absolute error (cycles)
(b) Coverage of the 90% interval
(c) Skill against the proven life
Figure 4: Median absolute error, coverage of the 90% intervals and skill of the rated life against the proven life, for the three methods against the cycle at which the test stops. The dotted lines are the intended coverage and zero skill.
The straight line has the smaller median error from 600 cycles: 40 cycles against 176 for the path and 360 for the Weibull model at 600, and 29 against 37 and 80 at 800. At 700 cycles the three are close, 66, 77 and 63 cycles, on four cells. The path is biased late at every early stop, with all 26 of its predictions at 500, 600 and 700 cycles above the observed life, and its intervals hold the life for 8% to 25% of the cells. The coverage of the line is 38% at 500 cycles and between 50% and 70% at the next stops, below the 90% intended even with the correction for correlated residuals, because a line through a curve is wrong in a way that its own residuals do not show. The Weibull intervals cover 62%, 78% and 50%, closer to the level at the first two stops because the model does not claim to know the cell; at the stops with four cells or fewer a single cell moves a coverage by 25 points. None of the three reaches the nominal coverage, and a quote that relies on an interval of one of them should be widened.
The skill separates the methods by what they save a manufacturer. At 500 cycles every method is worse than the proven life, with a skill of for the line and for the path, because a model that rates above the stop pays nine for every cycle that it promises too many, and at this stop the cells have not yet shown how they fail. At 600 cycles the line has a skill of 0.08, the Weibull model of and the path of . At 700 cycles the line removes 38% of the proven-life loss, and at 800 cycles 74%, the path 65%, the Weibull model nothing. From 700 cycles the Weibull model rates a running cell within about 20 cycles of the stop, because its 10% quantile given survival lies just above it, so it has the skill of the proven life and adds no more. On the 13 CALCE cells the line is the first forecast that earns its place, from 600 cycles. Whether it does so on other cells is tested next.
Test on Another Design
A forecast chosen on 13 cells of one laboratory has to be tested on cells that it was not chosen from. The data of Severson and colleagues are 124 lithium iron phosphate cells of one design, cycled at 30 °C under 72 fast-charging policies, with lives from about 150 to 2,300 cycles and the end of life at 80% of the nominal capacity of 1.1 Ah.4 The cells come in three batches, and the public files of the batches, 140 cells in all, are reduced to the discharge capacity of every cycle by bayes.data.severson. A cell is used when its record shows the cycle at which its capacity fell to 80% of the nominal one, either by running past it or by ending one cycle before it. That keeps 128 cells, 36, 48 and 44 in the three batches, with a mean life of 772 cycles and a standard deviation of 323. It drops 12: five whose records end between 0.97 and 1.04 Ah, five that end between 0.91 and 0.97 Ah, and two that had not failed after more than 2,100 cycles. The text of the paper does not list the cells that it left out of its 124, and the processing notebooks of its authors remove none, so its selection is not reproduced here.
The lives of the three batches differ by a factor of ten, so a stop is set by the share of the cells that have failed and not by a cycle: a stop at one third is the cycle of the failure that makes a third of the batch. At each stop the line and the proven life are scored on the cells that are still running, and the losses are pooled before the ratio is taken. Batches of 13 cells are also drawn at random from each physical batch, 300 in all, which shows what a test of the size of the CALCE test would have found. Figure 5 draws the skill of the line against the proven life at every share failed, and the line of one cell at three stops.
Figure 5: Skill of the line against the proven life by share of cells failed, for the Severson cells, random batches of 13 of them and the CALCE cells (left), and the lines of cell b3c7 at three stops (right).
On the Severson cells the line is worse than a rating at the stop at every share of failures. Its pooled skill is when a third of the cells have failed, at one half and at nine tenths, and in the 300 random batches of 13 cells the skill is negative in every batch up to 80% failed and positive in 8% of the batches at 90%. For a single running cell the line has the smaller loss in 2% of the cases at one third failed and in 18% at nine tenths, and its median lies above the observed life in at least 98% of the cases at every share. The CALCE cells behave differently at the same shares. The line is worse than the proven life while fewer than a third of the cells have failed, with a skill of , and at 0, 10% and 20%, and better from a third on, with 0.52, 0.63 and 0.84 at a third, a half and 80%. The CALCE cells are the exception, and a rule drawn from them would have lost in 300 batches out of 300 on cells of another design.
The reason is the shape of the decline, which the second panel shows for one cell. Cell b3c7 has lost 5.0 points when a third of its batch has failed, at 858 cycles, and its loss grows by 0.4 points per 100 cycles, so a line puts its end of life at 4,621 cycles. Its decline then accelerates, the slope reaches 1.5 points per 100 cycles at 1,500 cycles, and the cell fails at 1,836. A line is late at every stop until the knee has begun, which for this cell is at about four fifths of its life. The CALCE cells declined at a more nearly steady rate once 600 cycles were reached, and the cells of the other design lose little and then fall quickly, so the same extrapolation is accurate for one and misleading for the other. A reader cannot know which kind they have without testing, and a rating at the stop is the only rule that held for both.
Limits of the Study
The CALCE data are 13 cells of two chemistries from one laboratory, and the stops from 700 cycles rest on four, three and one running cells, so differences between the methods at those stops are observations and not estimates. The advantage of the line from 600 cycles comes from nine cells at that stop and does not carry to the Severson cells, and the slopes that explain the late path are those of 13 and of nine cells. The intervals of the line are too narrow, and the correction for correlated residuals does not remove the curvature of the loss. The test on the Severson cells uses one design from one laboratory and 128 of the 140 cells of its public files, chosen by the rule of this post and not by the paper, and it compares only the line and the proven life: no Weibull or path model was fitted to those cells.
Summary of Findings
A rating at the stop needs no model and beat every forecast at 500 cycles, when no cell has failed and the forecasts cost about four to five times as much. On the 13 CALCE cells a straight line through the last 100 cycles is the best single-cell forecast from 600 cycles, removing 38% of the proven-life loss at 700 cycles and 74% at 800. The power law is late at every early stop because a concave curve fitted to a decline that is flat at first and steeper later underestimates the present slope, and from 700 cycles the Weibull model rates a running cell at about the stop. None of the three intervals reaches the nominal coverage.
On the 128 Severson cells the line is worse than the rating at the stop at every share of failures, with a pooled skill of at one third failed, because those cells lose little and then fall quickly. In 300 random batches of 13 cells it never beat the rating at the stop up to 80% failed, so the CALCE result is a property of those cells and not of the method.
The procedure that follows can be run on any test that stops early. First, rate at the stop, which held on both sets of cells. Second, test a forecast of a running cell on earlier cells of the same design, with the stops set by the share failed and the loss of the 10% quantile as the score, as the last section does. Third, use the forecast only at the stops where it beats the rating at the stop on those cells, and widen its interval.
Reproducible Results
The notebook is in the bayesian-modelling repository and runs from the first cell to the last in the uv environment of the repository, with PyMC 6.4, ArviZ 1.3 and lets-plot 4.11, and downloads the feature file when it first runs. The models, the references, the study of the stops and the figures are functions of the bayes package, which has unit tests, and the cells of the notebook only call them. The 10 fits, a Weibull and a path model at each of five stops, are stored in cache-eol/ and take about five minutes on a laptop at a target acceptance rate of 0.99, with no divergent transition and an R-hat of at most 1.011, and the test on the Severson cells takes about a minute more. That test reads a table that a reader builds from the three public batch files of https://data.matr.io with bayes.data.severson.reduce_batch, saved as severson.parquet in the folder named by the environment variable SEVERSON_DIR; the files carry the terms of that page and are not part of the repository. Setting the environment variable HIER_FAST=1 runs the whole notebook with a few draws.
Show the numbers quoted in the text
print("path shape b at 600:", eol_study.path_fit(sample, 600, CACHE, CONFIG).posterior["b_cell"].mean(("chain", "draw")).to_series().round(2).to_dict())print(summary.round(2).to_string(index=False))print(skill[["stop", "method", "skill"]].round(2).to_string(index=False))print(dropped.groupby(["method", "stop"])["dropped"].max().round(3).to_string())print("path too long at 500, 600, 700:", int((scores[(scores["method"] =="Path") & (scores["stop"] <=700)]["error"] >0).sum()), "of", int(((scores["method"] =="Path") & (scores["stop"] <=700)).sum()))for stop, ratios in slopes.items():print("slope ratio at", stop, ratios.round(3).to_string(index=False), "median ratio", round(float(ratios["ratio"].median()), 2))print("slope at the stop below the slope before the end of life, stop", stop, ":", int((ratios["late"] > ratios["early"]).sum()), "of", len(ratios), "| median early", round(float(ratios["early"].median()) *100, 2), "late", round(float(ratios["late"].median()) *100, 2), "points per 100 cycles")path = eol_study.path_fit(sample, 600, CACHE, CONFIG)fitted = degradation.fitted_slope(path, 600)measured = slopes[600].set_index("cell")["early"] *100print("fitted slope at 600 / measured:", {c: (round(float(fitted[c]), 2), round(float(measured[c]), 2), round(float(fitted[c] / measured[c]), 2)) for c in measured.index})print("severson cells kept by batch:", sev_table.groupby("CellType").size().to_dict(), "| excluded:", sev_excluded)print("severson lives: mean", round(float(sev_table["eol"].mean())), "sd", round(float(sev_table["eol"].std())), "min", int(sev_table["eol"].min()), "max", int(sev_table["eol"].max()))print("pooled skill by share failed:", pooled.round(2).to_string(index=False))print("random batches of 13:", bands.round(2).to_string(index=False))print("single cells:", cases.round(2).to_string(index=False))print("CALCE, same shares:", laboratory.round(2).to_string(index=False))print("example", EXAMPLE[0], "life", example_life, example_lines.round(3).to_string(index=False))
References
[1] C. J. Lu and W. Q. Meeker, “Using degradation measures to estimate a time-to-failure distribution,” Technometrics, vol. 35, no. 2, pp. 161-174, 1993.↩︎
[2] T. Gneiting, “Quantiles as optimal point forecasts,” Int. J. Forecast., vol. 27, no. 2, pp. 197-207, 2011.↩︎
[3] N. Z. Gebraeel, M. A. Lawley, R. Li, and J. K. Ryan, “Residual-life distributions from component degradation signals: A Bayesian approach,” IIE Trans., vol. 37, no. 6, pp. 543-557, 2005.↩︎
[4] K. A. Severson et al., “Data-driven prediction of battery cycle life before capacity degradation,” Nat. Energy, vol. 4, pp. 383-391, 2019. The data are at https://data.matr.io.↩︎
Citation
BibTeX citation:
@online{faustine2026,
author = {Faustine, Anthony},
title = {Forecasting a {Running} {Battery} {Cell:} {A} {Straight}
{Line,} a {Power} {Law} and the {Proven} {Life}},
date = {2026-11-30},
url = {https://sambaiga.github.io/pages/blog/posts/2026/11/2026-11-30-forecasting-running-cells.html},
langid = {en}
}