pub struct Design { /* private fields */ }Expand description
A design matrix (rows are observations, columns are coefficients), with an offset and prior weights.
Stored column by column. The offset (default 0) enters the linear
predictor with a fixed coefficient of 1, as ln(exposure) does in a
log-link frequency model; the weights (default 1) divide the variance.
Implementations§
Source§impl Design
impl Design
Sourcepub fn new(names: Vec<String>, columns: Vec<Vec<f64>>) -> Result<Self>
pub fn new(names: Vec<String>, columns: Vec<Vec<f64>>) -> Result<Self>
A design from named columns. Fails if they differ in length, are empty, or hold a non-finite value.
Sourcepub fn with_offset(self, offset: Vec<f64>) -> Result<Self>
pub fn with_offset(self, offset: Vec<f64>) -> Result<Self>
Sets the offset, one value per row.
Sourcepub fn with_weights(self, weights: Vec<f64>) -> Result<Self>
pub fn with_weights(self, weights: Vec<f64>) -> Result<Self>
Sets the prior weights, one positive value per row.
Sourcepub fn linear_predictor(&self, beta: &[f64]) -> Vec<f64>
pub fn linear_predictor(&self, beta: &[f64]) -> Vec<f64>
X β + offset.
Trait Implementations§
impl StructuralPartialEq for Design
Auto Trait Implementations§
impl Freeze for Design
impl RefUnwindSafe for Design
impl Send for Design
impl Sync for Design
impl Unpin for Design
impl UnsafeUnpin for Design
impl UnwindSafe for Design
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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