Enum FitError
#[non_exhaustive]pub enum FitError {
Underdetermined {
bonds: usize,
parameters: usize,
},
NoConvergence {
residual: f64,
iterations: usize,
},
Singular,
Curve(CurveError),
Yield(YieldSolveError),
Invalid {
at: NaiveDate,
basis: usize,
},
}Expand description
Why a fit produced no curve.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Underdetermined
Fewer bonds than parameters: the problem is underdetermined and a fit would be arbitrary rather than smooth.
NoConvergence
The solve did not converge.
Fields
Singular
No damping made the normal equations invertible.
Curve(CurveError)
A curve query failed during the fit.
Yield(YieldSolveError)
A bond’s own street yield could not be taken, so its weight or its misfit could not be computed.
Invalid
The fitted curve’s discount factors are not positive and decreasing across the horizon.
Only the exponential-splines form can produce this: the other two are positive decreasing by construction. The date is where the curve first misbehaves, which is what a caller needs to judge the remedy.
Implementations§
§impl FitError
impl FitError
pub fn is_unconverged(&self) -> bool
pub fn is_unconverged(&self) -> bool
Whether the fit ran out of iterations, as
CalibrationError::is_unconverged
asks of a ladder. Exhaustive.
Trait Implementations§
§impl Error for FitError
impl Error for FitError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()