pub struct GlmSpec {
pub terms: Vec<Term>,
pub family: String,
pub link: String,
}Expand description
General Linear Model (GLM) specification.
Contains the design matrix terms and the distributional family/link function. Can be constructed from raw data rows and a model specification, and provides methods for extracting the design matrix, computing dimensions, and adding random effects (placeholder for GLMM).
Fields§
§terms: Vec<Term>§family: String§link: StringImplementations§
Source§impl GlmSpec
impl GlmSpec
pub fn new(terms: Vec<Term>) -> Self
Sourcepub fn from_rows(
data: &[HashMap<String, f64>],
x_names: &[String],
model: &Value,
) -> Self
pub fn from_rows( data: &[HashMap<String, f64>], x_names: &[String], model: &Value, ) -> Self
Build from data rows and a model specification dict.
Sourcepub fn design_matrix(&self) -> (Vec<String>, Vec<Vec<f64>>)
pub fn design_matrix(&self) -> (Vec<String>, Vec<Vec<f64>>)
Design matrix as (column_names, column_data).
pub fn n_obs(&self) -> usize
pub fn n_predictors(&self) -> usize
Sourcepub fn with_random_effects(self, _z_terms: Vec<Term>) -> Self
pub fn with_random_effects(self, _z_terms: Vec<Term>) -> Self
Add random effects (Z matrix) — placeholder for GLMM.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GlmSpec
impl RefUnwindSafe for GlmSpec
impl Send for GlmSpec
impl Sync for GlmSpec
impl Unpin for GlmSpec
impl UnsafeUnpin for GlmSpec
impl UnwindSafe for GlmSpec
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