Parameter estimation#
Parameter estimation for symbolic models.
linear_scaling()– the closed-form intercept and slope of Keijzer (2003), which make the search insensitive to the scale and offset of the target;lstsq()– (ridge-)regularized linear least squares for linear-in-parameters models;fit_parameters()– nonlinear least squares (Levenberg–Marquardt or trust-region reflective) with the exact forward-mode Jacobian of the expression;jacobian_rank()andredundant_parameters()– numerical rank of the Jacobian, which reveals over-parameterized expressions (Kronberger and de França, 2025).
Examples#
>>> import numpy as np
>>> from eqdisco.expr import Expression
>>> from eqdisco.optimize import fit_parameters
>>> rng = np.random.default_rng(0)
>>> X = rng.uniform(0, 2, size=(50, 1))
>>> y = 3.0 * np.exp(-0.7 * X[:, 0])
>>> e = Expression.from_string("1.0*exp(-1.0*x0)")
>>> res = fit_parameters(e, X, y)
>>> np.round(res.theta, 3)
array([ 3. , -0.7])
Linear scaling, least squares and Levenberg–Marquardt fitting with analytic Jacobians.
Classes#
|
Result of |
Functions#
|
Optimal intercept \(a\) and slope \(b\) of \(a + b f\) in least squares. |
|
Least-squares weights of a linear-in-parameters model. |
|
Nonlinear least-squares estimate of the parameters \(\boldsymbol\theta\). |
|
Numerical rank of the Jacobian \(\partial f/\partial\boldsymbol\theta\) on |
|
Indices of parameters that can be removed without reducing the Jacobian rank. |