RandomVector

Struct RandomVector 

Source
pub struct RandomVector<T> {
    pub variables: Vec<RandomVariable>,
    pub probability_matrix: JointProbability<T>,
}
Expand description

A multivariate structure tracking pairs or collections of intersecting random processes over a discrete matrix space.

Fields§

§variables: Vec<RandomVariable>§probability_matrix: JointProbability<T>

Implementations§

Source§

impl RandomVector<f64>

Source

pub fn new(x: Vec<RandomVariable>, px: JointProbability<f64>) -> CDHResult<Self>

Instantiates a new multivariate distribution vector matrix frame context.

§Errors

Returns an Err if the initial input array length drops below 2 or tracking configurations mismatch inside the vectors.

Source

pub fn get_jointprobability(&self) -> CDHResult<JointProbability<f64>>

Evaluates the joint operational probability layout grid configurations.

Source

pub fn marginal_x2(&self, index: usize) -> CDHResult<f64>

Extracts the marginal probability distribution value matching a specific index coordinate for $X_2$.

Source

pub fn marginal_x1(&self, index: usize) -> CDHResult<f64>

Extracts the marginal probability distribution value matching a specific index coordinate for $X_1$.

Source

pub fn conditional_x1(&self, index_x1: usize, index_x2: usize) -> CDHResult<f64>

Computes the conditional probability allocation metric context $P(X_1 \mid X_2)$.

Source

pub fn conditional_x2(&self, index_x1: usize, index_x2: usize) -> CDHResult<f64>

Computes the conditional probability allocation metric context $P(X_2 \mid X_1)$.

Source

pub fn conditional_expectation_x1<H>( &self, index_x2: usize, h: H, ) -> CDHResult<f64>
where H: Fn(f64) -> f64,

Calculates the conditional expectation variable limit $E[h(X_1) \mid X_2 = x_2]$.

Source

pub fn conditional_expectation_x2<H>( &self, index_x1: usize, h: H, ) -> CDHResult<f64>
where H: Fn(f64) -> f64,

Calculates the conditional expectation variable limit $E[h(X_2) \mid X_1 = x_1]$.

Source

pub fn joint_expectation<F>(&self, g: F) -> CDHResult<f64>
where F: Fn(f64, f64) -> f64,

Evaluates joint expectation transformations $E[g(X, Y)]$ over the combined sample domains.

Source

pub fn covariance(&self) -> CDHResult<f64>

  1. THE COVARIANCE CALCULATOR Uses your exact definitional formula: E[(X1 - E(X1))(X2 - E(X2))] Computes the true covariance spatial scaling link metric between two random processes.

$$\text{Cov}(X,Y) = E[(X - E[X])(Y - E[Y])]$$

Source

pub fn correlation(&self) -> CDHResult<f64>

Evaluates Pearson’s joint population correlation coefficient ($\rho$) containing zero-variance protections.

Trait Implementations§

Source§

impl<T: Debug> Debug for RandomVector<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for RandomVector<T>

§

impl<T> RefUnwindSafe for RandomVector<T>
where T: RefUnwindSafe,

§

impl<T> Send for RandomVector<T>
where T: Send,

§

impl<T> Sync for RandomVector<T>
where T: Sync,

§

impl<T> Unpin for RandomVector<T>
where T: Unpin,

§

impl<T> UnwindSafe for RandomVector<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.