Skip to main content

SourceContributionV1

Struct SourceContributionV1 

Source
pub struct SourceContributionV1 {
    pub axis: InputAxis,
    pub sigma: f64,
    pub d_drop_d_x: f64,
    pub d_windage_d_x: f64,
    pub scheme: DifferenceScheme,
    pub variance_share: f64,
    pub ellipse_area_reduction_m2: f64,
    pub p_hit_gain_if_perfect: Option<f64>,
}
Expand description

One declared source’s contribution to impact variance at one range.

Constructed only for a source central_difference actually evaluated – an axis it refused is recorded in UnavailableSourceV1 instead, never here with a fabricated zero.

Fields§

§axis: InputAxis§sigma: f64

The caller-declared one-sigma uncertainty for this axis, in the axis’s own physical unit (crate::perturbation::axis_meta(axis).kind).

§d_drop_d_x: f64§d_windage_d_x: f64§scheme: DifferenceScheme

Which finite-difference scheme produced the two derivatives above. A one-sided scheme (ForwardOneSided/BackwardOneSided) has larger truncation error than Central – see this module’s “Unavailable sources” doc section and DifferenceScheme’s own doc for when the kernel falls back to one. Still air (wind.speed_mps: 0.0) is the ordinary, ROUTINE case for WindSpeed, not an exotic one – wind-call uncertainty is this report’s flagship use case, so a non-Central scheme here is expected, not a warning sign by itself.

§variance_share: f64

Fraction of total impact variance (sigma_drop_m^2 + sigma_windage_m^2) attributable to this source. Sums to 1.0 across a row’s sources whenever at least one source has a nonzero contribution.

§ellipse_area_reduction_m2: f64

Reduction in the row’s 95% ellipse area if this source alone were measured perfectly (its sigma set to zero, every other source unchanged). Always >= 0.0.

Degenerate with two or fewer sources. The remaining covariance after removing any ONE of exactly two declared sources is an outer product (rank <= 1, area exactly 0 – see Symmetric2::largest_smallest_eigenvalues’s doc for why that is normal, not a bug), so with exactly two sources BOTH report a reduction equal to the FULL ellipse area, even when one dominates the variance share overwhelmingly (e.g. a 99%/1% split). That is literally true (perfecting either one alone does leave a zero-area ellipse) but reads, next to a ranking, as a tie where none exists on variance_share. A declaration of two sources (e.g. muzzle velocity and wind call, the most likely pair this ticket sees) always has this property; prefer variance_share to distinguish sources when sources.len() <= 2. With three or more sources the reduction is generically discriminating.

§p_hit_gain_if_perfect: Option<f64>

The hit-probability gain over the row’s target if THIS source alone were measured perfectly (its sigma set to zero, every other source unchanged), i.e. p_hit(without this source) - p_hit(with every declared source). Some exactly when error_budget_with_target was given a target; None (never a fabricated 0.0) when no target was supplied, matching ErrorBudgetRowV1::p_hit.

Always >= 0.0 (see p_hit_bivariate’s doc: shrinking a target-centred impact covariance in the Loewner order cannot reduce the mass of a symmetric normal over a symmetric convex target – Anderson’s theorem). The unclamped value is checked against a small negative tolerance before being clamped to zero (a debug_assert! in error_budget_with_target), so a bug that made it SYSTEMATICALLY negative – as opposed to a few ULP of quadrature noise – fails a debug/test build loudly rather than being silently laundered into 0.0.

Does NOT share ellipse_area_reduction_m2’s two-source degeneracy above – it is one of the few fields on this type that DOES discriminate at sources.len() == 2, the muzzle-velocity/wind-call pair this ticket names as the most likely declaration. The ellipse-area field is degenerate there because AREA is exactly zero for ANY rank-1 covariance, blind to which specific rank-1 covariance it is – removing either of two sources leaves a different rank-1 covariance (one source’s own outer product, not the other’s), but both have zero area, so both report the same “full area” reduction regardless of the real variance split. Hit probability is not blind that way: it depends on the SHAPE of the remaining rank-1 covariance (which is oriented along the surviving source’s own (d_drop_d_x, d_windage_d_x) direction), not merely on whether it is singular. On this module’s own flagship two-source fixture (MuzzleVelocityMps + WindSpeed, resolved(), range 600 m, target 0.5 m x 0.75 m), measured p_hit_gain_if_perfect values are ~0.4416 (perfecting WindSpeed, which nearly dominates windage) and ~0.00008 (perfecting MuzzleVelocityMps) – a difference of three and a half orders of magnitude, not a tie. See p_hit_gain_if_perfect_discriminates_with_only_two_sources in this module’s tests.

Trait Implementations§

Source§

impl Clone for SourceContributionV1

Source§

fn clone(&self) -> SourceContributionV1

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 Debug for SourceContributionV1

Source§

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

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

impl<'de> Deserialize<'de> for SourceContributionV1

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for SourceContributionV1

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for SourceContributionV1

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SourceContributionV1

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.