pub struct CorrelationConfig {
pub fields: Vec<CorrelatedField>,
pub matrix: Vec<f64>,
pub copula_type: CopulaType,
}Expand description
Configuration for the correlation engine.
Fields§
§fields: Vec<CorrelatedField>Fields to correlate
matrix: Vec<f64>Correlation matrix (upper triangular, row-major order) For n fields, this should have n*(n-1)/2 elements
copula_type: CopulaTypeType of copula to use for dependency structure
Implementations§
Source§impl CorrelationConfig
impl CorrelationConfig
Sourcepub fn new(fields: Vec<CorrelatedField>, matrix: Vec<f64>) -> Self
pub fn new(fields: Vec<CorrelatedField>, matrix: Vec<f64>) -> Self
Create a new correlation configuration.
Sourcepub fn bivariate(
field1: CorrelatedField,
field2: CorrelatedField,
correlation: f64,
) -> Self
pub fn bivariate( field1: CorrelatedField, field2: CorrelatedField, correlation: f64, ) -> Self
Create configuration for two fields with a single correlation.
Sourcepub fn to_full_matrix(&self) -> Vec<Vec<f64>>
pub fn to_full_matrix(&self) -> Vec<Vec<f64>>
Convert upper triangular to full correlation matrix.
Sourcepub fn field_names(&self) -> Vec<&str>
pub fn field_names(&self) -> Vec<&str>
Get field names.
Trait Implementations§
Source§impl Clone for CorrelationConfig
impl Clone for CorrelationConfig
Source§fn clone(&self) -> CorrelationConfig
fn clone(&self) -> CorrelationConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 CorrelationConfig
impl Debug for CorrelationConfig
Source§impl Default for CorrelationConfig
impl Default for CorrelationConfig
Source§impl<'de> Deserialize<'de> for CorrelationConfig
impl<'de> Deserialize<'de> for CorrelationConfig
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
Auto Trait Implementations§
impl Freeze for CorrelationConfig
impl RefUnwindSafe for CorrelationConfig
impl Send for CorrelationConfig
impl Sync for CorrelationConfig
impl Unpin for CorrelationConfig
impl UnwindSafe for CorrelationConfig
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