pub struct CorrelationGroup {
pub name: String,
pub entities: Vec<CorrelationEntity>,
pub matrix: Vec<Vec<f64>>,
}Expand description
A named group of correlated entities and their correlation matrix.
matrix is a symmetric positive-semi-definite matrix stored in
row-major order as Vec<Vec<f64>>. matrix[i][j] is the correlation
coefficient between entities[i] and entities[j].
matrix.len() must equal entities.len().
Cholesky decomposition of the matrix is NOT performed here; that
belongs to cobre-stochastic.
See Input Scenarios §5.
§Examples
use cobre_core::{EntityId, scenario::{CorrelationEntity, CorrelationGroup}};
let group = CorrelationGroup {
name: "Southeast".to_string(),
entities: vec![
CorrelationEntity { entity_type: "inflow".to_string(), id: EntityId(1) },
CorrelationEntity { entity_type: "inflow".to_string(), id: EntityId(2) },
],
matrix: vec![
vec![1.0, 0.8],
vec![0.8, 1.0],
],
};
assert_eq!(group.matrix.len(), 2);Fields§
§name: StringHuman-readable group label (e.g., "Southeast", "North").
entities: Vec<CorrelationEntity>Ordered list of entities whose correlation is captured by matrix.
matrix: Vec<Vec<f64>>Symmetric correlation matrix in row-major order.
matrix[i][j] = correlation between entities[i] and entities[j].
Diagonal entries must be 1.0. Shape: entities.len() × entities.len().
Trait Implementations§
Source§impl Clone for CorrelationGroup
impl Clone for CorrelationGroup
Source§fn clone(&self) -> CorrelationGroup
fn clone(&self) -> CorrelationGroup
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 CorrelationGroup
impl Debug for CorrelationGroup
Source§impl PartialEq for CorrelationGroup
impl PartialEq for CorrelationGroup
impl StructuralPartialEq for CorrelationGroup
Auto Trait Implementations§
impl Freeze for CorrelationGroup
impl RefUnwindSafe for CorrelationGroup
impl Send for CorrelationGroup
impl Sync for CorrelationGroup
impl Unpin for CorrelationGroup
impl UnsafeUnpin for CorrelationGroup
impl UnwindSafe for CorrelationGroup
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