pub struct Morris { /* private fields */ }Expand description
A Morris screening: the factors, the grid’s number of levels and the number of paths. It
serializes as its fields, and reads back through Morris::new’s checks.
Implementations§
Source§impl Morris
impl Morris
Sourcepub fn new(
factors: Vec<Factor>,
levels: usize,
paths: usize,
) -> Result<Self, AnalysisError>
pub fn new( factors: Vec<Factor>, levels: usize, paths: usize, ) -> Result<Self, AnalysisError>
A screening of factors on a grid of levels levels, with paths paths.
§Errors
AnalysisError::TooFewwith no factors, fewer than 2 levels, or fewer than 2 paths (a standard deviation needs two).AnalysisError::DuplicateFactorfor two factors with one name.AnalysisError::Unsupportedfor an odd number of levels: Morris’s stepΔis a whole number of levels only for an even one.AnalysisError::Countfor more thanMAX_LEVELSlevels, or a design of more thanMAX_DESIGN_POINTSpoints orMAX_DESIGN_VALUEScoordinates.
Sourcepub fn design(&self, seed: u64) -> MorrisDesign
pub fn design(&self, seed: u64) -> MorrisDesign
The paths of a screening seeded with seed. Path j draws from its own stream,
SeededRng::for_stream(seed, &[j]): its start’s levels, then a direction for each
factor, then the order (a Fisher–Yates shuffle), so it is the same however many paths are
drawn.
Sourcepub fn screen(
&self,
seed: u64,
model: impl FnMut(&[f64]) -> f64,
) -> Result<Screening, AnalysisError>
pub fn screen( &self, seed: u64, model: impl FnMut(&[f64]) -> f64, ) -> Result<Screening, AnalysisError>
Draws the design seeded with seed, runs model at each of its points in order, and
analyses the outputs (MorrisDesign::analyze).
§Errors
Sourcepub fn population(
&self,
model: impl FnMut(&[f64]) -> f64,
) -> Result<Vec<ElementaryEffects>, AnalysisError>
pub fn population( &self, model: impl FnMut(&[f64]) -> f64, ) -> Result<Vec<ElementaryEffects>, AnalysisError>
Each factor’s elementary effects over the whole grid: Fᵢ’s mean, mean absolute value and
standard deviation, exactly, from model run once at each of the grid’s p^k points.
These are what Morris::screen estimates.
§Errors
AnalysisError::Countfor a grid of more thanMAX_POPULATION_POINTSpoints, its countp^ksaturating atusize::MAX.AnalysisError::Outputfor an output that isn’t finite, at its grid point’s index (factor 0’s level the fastest-changing digit).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Morris
impl<'de> Deserialize<'de> for Morris
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>,
impl StructuralPartialEq for Morris
Auto Trait Implementations§
impl Freeze for Morris
impl RefUnwindSafe for Morris
impl Send for Morris
impl Sync for Morris
impl Unpin for Morris
impl UnsafeUnpin for Morris
impl UnwindSafe for Morris
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more