Skip to main content

BootstrapConfig

Struct BootstrapConfig 

Source
pub struct BootstrapConfig {
    pub tolerance: f64,
    pub max_iter: u32,
    pub bracket: f64,
    pub iterative: bool,
    pub iter_max: u32,
    pub iter_tol: f64,
}
Expand description

Configuration for Bootstrap.

The defaults match the values documented in WORKING.md §3.10: tolerance = 1e-12, max_iter = 100, bracket = 0.5, iterative = true, iter_max = 8, iter_tol = 1e-14.

§Examples

use regit_curves::bootstrap::BootstrapConfig;

let cfg = BootstrapConfig::default();
assert!((cfg.tolerance - 1e-12).abs() < 1e-18);
assert_eq!(cfg.max_iter, 100);
assert!((cfg.bracket - 0.5).abs() < 1e-15);
assert!(cfg.iterative);
assert_eq!(cfg.iter_max, 8);
assert!((cfg.iter_tol - 1e-14).abs() < 1e-20);

Fields§

§tolerance: f64

Per-leg residual tolerance handed to Brent as ftol.

§max_iter: u32

Per-leg iteration cap handed to Brent as max_iter.

§bracket: f64

Initial half-width of the discount-factor bracket. The bracket is [D_guess * exp(-bracket), D_guess * exp(+bracket)] and is widened on failure by doubling up to five times.

§iterative: bool

Run the outer iteration for non-local interpolation methods. Has no effect for local methods (linear, log-linear, linear-in-zero, piecewise-constant forward, monotone cubic, Steffen).

§iter_max: u32

Outer-iteration cap.

§iter_tol: f64

Outer-iteration convergence tolerance on the maximum nodal change max_i |D_i^{new} - D_i^{old}|.

Trait Implementations§

Source§

impl Clone for BootstrapConfig

Source§

fn clone(&self) -> BootstrapConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for BootstrapConfig

Source§

impl Debug for BootstrapConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BootstrapConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for BootstrapConfig

Source§

fn eq(&self, other: &BootstrapConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BootstrapConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.