pub struct GaussianCopula { /* private fields */ }Expand description
The Gaussian copula with correlation matrix R.
One draw takes d standard normals z by inverse transform, in order,
sets y = L z with L Lᵀ = R, and returns u_j = Φ(y_j). Kendall’s
tau between dimensions i and j is (2 / π) asin(R_ij); there is no
tail dependence.
use prospicio_core::StreamRng;
use prospicio_prob::copula::{Copula, GaussianCopula};
let c = GaussianCopula::new(&[1.0, 0.5, 0.5, 1.0], 2).unwrap();
let mut u = [0.0; 2];
c.sample(&mut StreamRng::new(1, 0), &mut u);
assert!(u.iter().all(|&x| x > 0.0 && x < 1.0));Implementations§
Trait Implementations§
Source§impl Clone for GaussianCopula
impl Clone for GaussianCopula
Source§fn clone(&self) -> GaussianCopula
fn clone(&self) -> GaussianCopula
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Copula for GaussianCopula
impl Copula for GaussianCopula
Source§impl Debug for GaussianCopula
impl Debug for GaussianCopula
Source§impl PartialEq for GaussianCopula
impl PartialEq for GaussianCopula
impl StructuralPartialEq for GaussianCopula
Auto Trait Implementations§
impl Freeze for GaussianCopula
impl RefUnwindSafe for GaussianCopula
impl Send for GaussianCopula
impl Sync for GaussianCopula
impl Unpin for GaussianCopula
impl UnsafeUnpin for GaussianCopula
impl UnwindSafe for GaussianCopula
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