pub struct EconomicsStatisticsPolicy {
pub per_pair: String,
pub location: String,
pub interval: String,
pub confidence_bp: u32,
pub resamples: u32,
pub seed: u64,
pub min_pairs_for_interval: usize,
}Expand description
How per-pair results are aggregated into a headline value and its interval. Every parameter of the bootstrap is declared here, its generator seed included, so the same runs always give the same interval.
use majordomus_cli::economics::model::EconomicsStatisticsPolicy;
let s: EconomicsStatisticsPolicy = serde_json::from_value(serde_json::json!({
"per_pair": "1 - treatment / control on total tokens", "location": "median",
"interval": "bootstrap percentile", "confidence_bp": 9500, "resamples": 10000,
"seed": 20260924, "min_pairs_for_interval": 5
}))
.unwrap();
assert_eq!(f64::from(s.confidence_bp) / 100.0, 95.0, "basis points, not percent");
assert_eq!(serde_json::to_value(&s).unwrap()["seed"], 20260924);Fields§
§per_pair: StringThe per-pair formula, in words.
location: StringThe location statistic reported as the headline.
interval: StringHow the interval is computed.
confidence_bp: u32Confidence level in basis points: 9500 is 95 %.
resamples: u32Bootstrap resamples.
seed: u64The seed of the bootstrap’s generator, so that the interval is reproducible.
min_pairs_for_interval: usizeBelow this many valid pairs no interval is computed at all.
Trait Implementations§
Source§impl Clone for EconomicsStatisticsPolicy
impl Clone for EconomicsStatisticsPolicy
Source§fn clone(&self) -> EconomicsStatisticsPolicy
fn clone(&self) -> EconomicsStatisticsPolicy
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 EconomicsStatisticsPolicy
impl Debug for EconomicsStatisticsPolicy
Source§impl<'de> Deserialize<'de> for EconomicsStatisticsPolicy
impl<'de> Deserialize<'de> for EconomicsStatisticsPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 JsonSchema for EconomicsStatisticsPolicy
impl JsonSchema for EconomicsStatisticsPolicy
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for EconomicsStatisticsPolicy
impl PartialEq for EconomicsStatisticsPolicy
Source§fn eq(&self, other: &EconomicsStatisticsPolicy) -> bool
fn eq(&self, other: &EconomicsStatisticsPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for EconomicsStatisticsPolicy
Auto Trait Implementations§
impl Freeze for EconomicsStatisticsPolicy
impl RefUnwindSafe for EconomicsStatisticsPolicy
impl Send for EconomicsStatisticsPolicy
impl Sync for EconomicsStatisticsPolicy
impl Unpin for EconomicsStatisticsPolicy
impl UnsafeUnpin for EconomicsStatisticsPolicy
impl UnwindSafe for EconomicsStatisticsPolicy
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