pub struct Exponential {
pub rate: Array1<f64>,
pub scale: Array1<f64>,
/* private fields */
}Expand description
The Exponential distribution.
Fields§
§rate: Array1<f64>The rate parameter (1/scale).
scale: Array1<f64>The scale parameter (1/rate).
Trait Implementations§
Source§impl CensoredScorable<CRPScoreCensored> for Exponential
impl CensoredScorable<CRPScoreCensored> for Exponential
Source§fn censored_score(&self, y: &SurvivalData) -> Array1<f64>
fn censored_score(&self, y: &SurvivalData) -> Array1<f64>
Calculates the censored score for each observation.
Source§fn censored_d_score(&self, y: &SurvivalData) -> Array2<f64>
fn censored_d_score(&self, y: &SurvivalData) -> Array2<f64>
Calculates the gradient of the censored score with respect to the distribution’s parameters.
Source§fn censored_metric(&self) -> Array3<f64>
fn censored_metric(&self) -> Array3<f64>
Calculates the Riemannian metric tensor for censored data.
Source§fn total_censored_score(
&self,
y: &SurvivalData,
sample_weight: Option<&Array1<f64>>,
) -> f64
fn total_censored_score( &self, y: &SurvivalData, sample_weight: Option<&Array1<f64>>, ) -> f64
Calculates the total censored score, averaged over all observations.
Source§fn censored_grad(&self, y: &SurvivalData, natural: bool) -> Array2<f64>where
Self: Sized,
fn censored_grad(&self, y: &SurvivalData, natural: bool) -> Array2<f64>where
Self: Sized,
Calculates the gradient for censored data, optionally the natural gradient.
Source§impl CensoredScorable<LogScoreCensored> for Exponential
impl CensoredScorable<LogScoreCensored> for Exponential
Source§fn censored_score(&self, y: &SurvivalData) -> Array1<f64>
fn censored_score(&self, y: &SurvivalData) -> Array1<f64>
Calculates the censored score for each observation.
Source§fn censored_d_score(&self, y: &SurvivalData) -> Array2<f64>
fn censored_d_score(&self, y: &SurvivalData) -> Array2<f64>
Calculates the gradient of the censored score with respect to the distribution’s parameters.
Source§fn censored_metric(&self) -> Array3<f64>
fn censored_metric(&self) -> Array3<f64>
Calculates the Riemannian metric tensor for censored data.
Source§fn total_censored_score(
&self,
y: &SurvivalData,
sample_weight: Option<&Array1<f64>>,
) -> f64
fn total_censored_score( &self, y: &SurvivalData, sample_weight: Option<&Array1<f64>>, ) -> f64
Calculates the total censored score, averaged over all observations.
Source§fn censored_grad(&self, y: &SurvivalData, natural: bool) -> Array2<f64>where
Self: Sized,
fn censored_grad(&self, y: &SurvivalData, natural: bool) -> Array2<f64>where
Self: Sized,
Calculates the gradient for censored data, optionally the natural gradient.
Source§impl Clone for Exponential
impl Clone for Exponential
Source§fn clone(&self) -> Exponential
fn clone(&self) -> Exponential
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 Exponential
impl Debug for Exponential
Source§impl Distribution for Exponential
impl Distribution for Exponential
Source§fn from_params(params: &Array2<f64>) -> Self
fn from_params(params: &Array2<f64>) -> Self
Creates a new distribution from a set of parameters.
Source§fn fit(y: &Array1<f64>) -> Array1<f64>
fn fit(y: &Array1<f64>) -> Array1<f64>
Fits the distribution to the data
y and returns the initial parameters.Source§fn grad<S: Score>(
&self,
y: &Array1<f64>,
_score: S,
natural: bool,
) -> Array2<f64>where
Self: Scorable<S>,
fn grad<S: Score>(
&self,
y: &Array1<f64>,
_score: S,
natural: bool,
) -> Array2<f64>where
Self: Scorable<S>,
Calculates the gradient of the score with respect to the distribution’s parameters.
fn total_score<S: Score>(&self, y: &Array1<f64>, _score: S) -> f64where
Self: Scorable<S>,
Source§impl DistributionMethods for Exponential
impl DistributionMethods for Exponential
Source§fn variance(&self) -> Array1<f64>
fn variance(&self) -> Array1<f64>
Returns the variance of the distribution for each observation.
Source§fn std(&self) -> Array1<f64>
fn std(&self) -> Array1<f64>
Returns the standard deviation of the distribution for each observation.
Source§fn pdf(&self, y: &Array1<f64>) -> Array1<f64>
fn pdf(&self, y: &Array1<f64>) -> Array1<f64>
Evaluates the probability density function at point y for each observation.
Source§fn logpdf(&self, y: &Array1<f64>) -> Array1<f64>
fn logpdf(&self, y: &Array1<f64>) -> Array1<f64>
Evaluates the log probability density function at point y for each observation.
Source§fn cdf(&self, y: &Array1<f64>) -> Array1<f64>
fn cdf(&self, y: &Array1<f64>) -> Array1<f64>
Evaluates the cumulative distribution function at point y for each observation.
Source§fn ppf(&self, q: &Array1<f64>) -> Array1<f64>
fn ppf(&self, q: &Array1<f64>) -> Array1<f64>
Evaluates the percent point function (inverse CDF / quantile function).
Returns the value y such that P(Y <= y) = q.
Source§fn sample(&self, n_samples: usize) -> Array2<f64>
fn sample(&self, n_samples: usize) -> Array2<f64>
Generates random samples from the distribution. Read more
Source§fn mode(&self) -> Array1<f64>
fn mode(&self) -> Array1<f64>
Returns the mode of the distribution for each observation (if well-defined).
Default implementation returns the mean; override for distributions where mode != mean.
Source§impl Scorable<CRPScore> for Exponential
impl Scorable<CRPScore> for Exponential
Source§fn d_score(&self, y: &Array1<f64>) -> Array2<f64>
fn d_score(&self, y: &Array1<f64>) -> Array2<f64>
Calculates the gradient of the score with respect to the distribution’s parameters.
Source§fn metric(&self) -> Array3<f64>
fn metric(&self) -> Array3<f64>
Calculates the Riemannian metric tensor of the score for each observation.
Source§impl Scorable<LogScore> for Exponential
impl Scorable<LogScore> for Exponential
Source§fn d_score(&self, y: &Array1<f64>) -> Array2<f64>
fn d_score(&self, y: &Array1<f64>) -> Array2<f64>
Calculates the gradient of the score with respect to the distribution’s parameters.
Source§fn metric(&self) -> Array3<f64>
fn metric(&self) -> Array3<f64>
Calculates the Riemannian metric tensor of the score for each observation.
impl RegressionDistn for Exponential
Auto Trait Implementations§
impl Freeze for Exponential
impl RefUnwindSafe for Exponential
impl Send for Exponential
impl Sync for Exponential
impl Unpin for Exponential
impl UnwindSafe for Exponential
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
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.