pub struct RationalCubic;Expand description
Rational function, cubic over cubic, with the denominator constant pinned at 1.
y = (a0 + a1·x + a2·x² + a3·x³) / (1 + b1·x + b2·x² + b3·x³)Parameters (in order): [a0, a1, a2, a3, b1, b2, b3]
One kernel covers three NIST StRD datasets because a lower-order rational is this form with the unused coefficients held at zero:
- Hahn1 and Thurber are cubic/cubic and use all seven.
- Kirby2 is quadratic/quadratic: fix
a3 = 0andb3 = 0and the remaining five map straight onto NIST’s b1..b5.
The denominator constant is pinned at 1 rather than fitted because NIST writes
these models that way. Fitting it too would make numerator and denominator
jointly scalable — (kN)/(kD) is the same curve — and hand the solver an exact
rank deficiency.
Domain guard: D must be non-zero. A rational’s denominator can cross zero
mid-search even when the certified parameters keep it clear of the data, so
D = 0 returns f64::NAN and the solver backs off rather than emitting an
infinity that would poison the residual vector.
Analytic Jacobian (let N and D be numerator and denominator):
- ∂y/∂a_k = x^k / D for k = 0,1,2,3
- ∂y/∂b_k = −N · x^k / D² for k = 1,2,3
Trait Implementations§
Source§impl Model for RationalCubic
impl Model for RationalCubic
Source§fn jacobian_into(&self, x: &[f64], p: &[f64], out: &mut [f64])
fn jacobian_into(&self, x: &[f64], p: &[f64], out: &mut [f64])
Source§fn jacobian(&self, x: &[f64], p: &[f64]) -> Vec<f64>
fn jacobian(&self, x: &[f64], p: &[f64]) -> Vec<f64>
param_names(). Read moreSource§fn eval_slice_into(&self, xs: &[f64], params: &[f64], out: &mut [f64])
fn eval_slice_into(&self, xs: &[f64], params: &[f64], out: &mut [f64])
out[i] = eval([xs[i]], params). Read more