pub trait CPD:
Clone
+ Debug
+ Labelled
+ PartialEq
+ AbsDiffEq
+ RelativeEq {
type Support;
type Parameters;
type Statistics;
// Required methods
fn conditioning_labels(&self) -> &Labels;
fn parameters(&self) -> &Self::Parameters;
fn parameters_size(&self) -> usize;
fn sample_statistics(&self) -> Option<&Self::Statistics>;
fn sample_log_likelihood(&self) -> Option<f64>;
fn pf(&self, x: &Self::Support, z: &Self::Support) -> f64;
fn sample<R: Rng>(&self, rng: &mut R, z: &Self::Support) -> Self::Support;
}Expand description
A trait for conditional probability distributions.
Required Associated Types§
Sourcetype Parameters
type Parameters
The type of the parameters.
Sourcetype Statistics
type Statistics
The type of the sufficient statistics.
Required Methods§
Sourcefn conditioning_labels(&self) -> &Labels
fn conditioning_labels(&self) -> &Labels
Sourcefn parameters(&self) -> &Self::Parameters
fn parameters(&self) -> &Self::Parameters
Sourcefn parameters_size(&self) -> usize
fn parameters_size(&self) -> usize
Sourcefn sample_statistics(&self) -> Option<&Self::Statistics>
fn sample_statistics(&self) -> Option<&Self::Statistics>
Returns the sufficient statistics, if any.
§Returns
An option containing a reference to the sufficient statistics.
Sourcefn sample_log_likelihood(&self) -> Option<f64>
fn sample_log_likelihood(&self) -> Option<f64>
Returns the log-likelihood of the fitted dataset, if any.
§Returns
An option containing the log-likelihood.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.