ArrayDataFit runs the same fit independently at each value of an
independent variable, and returns the fitted parameter as a 2xN
array — one row holding the independent-variable values and the other
holding the corresponding fitted values.
This is the right tool when the parameter you are fitting is expected to
depend on a state variable, and you want a sampled function rather
than a single scalar. Common examples:
- Diffusivity vs. stoichiometry from a GITT or pulse experiment — one fit per pulse, keyed by the midpoint stoichiometry of that pulse.
- Exchange-current density or diffusivity vs. temperature — one fit per chamber temperature.
- OCP-derived parameters vs. SOC — one fit per SOC setpoint.
How it differs from a regular DataFit
A regular DataFit runs one optimization against all of its objectives
together, producing a single best-fit value per parameter. An
ArrayDataFit runs one optimization per key of objectives,
producing a fitted value per key. The keys themselves are the
independent-variable values.
DataFit | ArrayDataFit | |
|---|---|---|
| Number of optimizations | One | One per objectives key |
| Result shape per parameter | Scalar | 2xN array ([independent_var_values, fitted_values]) |
| Use when | Parameter is a single number | Parameter is a sampled function of an independent variable |
Python usage
API usage
The pipeline API accepts anarray_data_fit element with the same
top-level fields as data_fit. The keys of objectives are the
independent-variable values:
DataFit (cost, optimizer,
multistarts, priors, etc.).
Related
Introduction to Data Fitting
Background on objectives, parameters, and optimizers
Objective Functions
Choose the right objective for your data