pub struct NormalFixedMean {
pub loc: Array1<f64>,
pub scale: Array1<f64>,
pub var: Array1<f64>,
/* private fields */
}Expand description
Normal distribution with mean fixed at 0.
Has one parameter: log(scale).
Fields§
§loc: Array1<f64>The location parameter (fixed at 0.0).
scale: Array1<f64>The scale parameter.
var: Array1<f64>The variance.
Trait Implementations§
Source§impl Clone for NormalFixedMean
impl Clone for NormalFixedMean
Source§fn clone(&self) -> NormalFixedMean
fn clone(&self) -> NormalFixedMean
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 NormalFixedMean
impl Debug for NormalFixedMean
Source§impl Distribution for NormalFixedMean
impl Distribution for NormalFixedMean
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 NormalFixedMean
impl DistributionMethods for NormalFixedMean
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 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 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 interval(&self, alpha: f64) -> (Array1<f64>, Array1<f64>)
fn interval(&self, alpha: f64) -> (Array1<f64>, Array1<f64>)
Returns the confidence interval for each observation. Read more
Source§impl Scorable<CRPScore> for NormalFixedMean
impl Scorable<CRPScore> for NormalFixedMean
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 NormalFixedMean
impl Scorable<LogScore> for NormalFixedMean
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 NormalFixedMean
Auto Trait Implementations§
impl Freeze for NormalFixedMean
impl RefUnwindSafe for NormalFixedMean
impl Send for NormalFixedMean
impl Sync for NormalFixedMean
impl Unpin for NormalFixedMean
impl UnwindSafe for NormalFixedMean
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.