pub struct JackknifeResampling {
pub scheme_name: String,
pub description: String,
}Expand description
Leave-one-out resampling for bias and variance estimation.
Fields§
§scheme_name: StringUnique name identifying a resampling scheme.
description: StringFree-text description.
Implementations§
Source§impl JackknifeResampling
impl JackknifeResampling
Sourcepub fn estimate(
&self,
data: &[f64],
stat: impl Fn(&[f64]) -> f64,
) -> Result<JackknifeEstimate>
pub fn estimate( &self, data: &[f64], stat: impl Fn(&[f64]) -> f64, ) -> Result<JackknifeEstimate>
Computes the jackknife bias and standard error of stat over data.
Convenience wrapper that lets the JackknifeResampling scheme
drive the numerics directly; it delegates to jackknife_statistic and
shares its contract exactly.
§Arguments
data— the observed sample; must contain at least two values.stat— the statistic to jackknife, mapping a sample view to a scalar.
§Returns
A JackknifeEstimate with the full-sample estimate, bias,
standard error, and per-subsample replicates.
§Errors
Returns Error::InsufficientData when data has fewer than two
elements.
§Examples
use stats_claw::resampling::JackknifeResampling;
let scheme = JackknifeResampling::default();
let data = [1.0, 2.0, 3.0, 4.0];
let est = scheme.estimate(&data, |s| s.iter().copied().fold(f64::MIN, f64::max))?;
assert!((est.estimate() - 4.0).abs() < 1e-12, "max was {}", est.estimate());Trait Implementations§
Source§impl Clone for JackknifeResampling
impl Clone for JackknifeResampling
Source§fn clone(&self) -> JackknifeResampling
fn clone(&self) -> JackknifeResampling
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JackknifeResampling
impl Debug for JackknifeResampling
Source§impl Default for JackknifeResampling
impl Default for JackknifeResampling
Source§fn default() -> JackknifeResampling
fn default() -> JackknifeResampling
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for JackknifeResampling
impl RefUnwindSafe for JackknifeResampling
impl Send for JackknifeResampling
impl Sync for JackknifeResampling
impl Unpin for JackknifeResampling
impl UnsafeUnpin for JackknifeResampling
impl UnwindSafe for JackknifeResampling
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more