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