pub struct LikelihoodEvaluator { /* private fields */ }Expand description
A structure to evaluate and minimize combinations of LikelihoodTerms.
Implementations§
Source§impl LikelihoodEvaluator
impl LikelihoodEvaluator
Sourcepub fn parameters(&self) -> Vec<String>
pub fn parameters(&self) -> Vec<String>
The parameter names used in LikelihoodEvaluator::evaluate’s input in order.
Sourcepub fn evaluate(&self, parameters: &[f64]) -> Result<f64, LadduError>
pub fn evaluate(&self, parameters: &[f64]) -> Result<f64, LadduError>
A function that can be called to evaluate the sum/product of the LikelihoodTerms
contained by this LikelihoodEvaluator.
Sourcepub fn evaluate_gradient(
&self,
parameters: &[f64],
) -> Result<Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, LadduError>
pub fn evaluate_gradient( &self, parameters: &[f64], ) -> Result<Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, LadduError>
Evaluate the gradient of the stored LikelihoodExpression over the events in the Dataset
stored by the LikelihoodEvaluator with the given values for free parameters.
Sourcepub fn minimize(
&self,
p0: &[f64],
bounds: Option<Vec<(f64, f64)>>,
options: Option<MinimizerOptions>,
) -> Result<Status, LadduError>
pub fn minimize( &self, p0: &[f64], bounds: Option<Vec<(f64, f64)>>, options: Option<MinimizerOptions>, ) -> Result<Status, LadduError>
A function that can be called to minimize the sum/product of the LikelihoodTerms
contained by this LikelihoodEvaluator.
See NLL::minimize for more details.
Sourcepub fn mcmc<T>(
&self,
p0: T,
n_steps: usize,
options: Option<MCMCOptions>,
rng: Rng,
) -> Result<Ensemble, LadduError>
pub fn mcmc<T>( &self, p0: T, n_steps: usize, options: Option<MCMCOptions>, rng: Rng, ) -> Result<Ensemble, LadduError>
A function that can be called to perform Markov Chain Monte Carlo sampling
of the sum/product of the LikelihoodTerms
contained by this LikelihoodEvaluator.
See NLL::mcmc for more details.
Trait Implementations§
Source§impl Function<ThreadPool, LadduError> for LikelihoodEvaluator
impl Function<ThreadPool, LadduError> for LikelihoodEvaluator
Source§fn evaluate(
&self,
parameters: &[f64],
thread_pool: &mut ThreadPool,
) -> Result<f64, LadduError>
fn evaluate( &self, parameters: &[f64], thread_pool: &mut ThreadPool, ) -> Result<f64, LadduError>
x with the given arguments/user data. Read moreSource§fn gradient(
&self,
parameters: &[f64],
thread_pool: &mut ThreadPool,
) -> Result<Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, LadduError>
fn gradient( &self, parameters: &[f64], thread_pool: &mut ThreadPool, ) -> Result<Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, LadduError>
x with the given arguments/user data. Read moreSource§fn evaluate_bounded(
&self,
x: &[f64],
bounds: Option<&Vec<Bound>>,
user_data: &mut U,
) -> Result<f64, E>
fn evaluate_bounded( &self, x: &[f64], bounds: Option<&Vec<Bound>>, user_data: &mut U, ) -> Result<f64, E>
x with the given arguments/user data. This
function assumes x is an internal, unbounded vector, but performs a coordinate transform
to bound x when evaluating the function. Read moreSource§fn gradient_bounded(
&self,
x: &[f64],
bounds: Option<&Vec<Bound>>,
user_data: &mut U,
) -> Result<Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, E>
fn gradient_bounded( &self, x: &[f64], bounds: Option<&Vec<Bound>>, user_data: &mut U, ) -> Result<Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, E>
x with the given arguments/user data. This
function assumes x is an internal, unbounded vector, but performs a coordinate transform
to bound x when evaluating the function. Read moreSource§fn hessian(
&self,
x: &[f64],
user_data: &mut U,
) -> Result<Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>, E>
fn hessian( &self, x: &[f64], user_data: &mut U, ) -> Result<Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>, E>
x with the given arguments/user data. Read moreSource§fn hessian_bounded(
&self,
x: &[f64],
bounds: Option<&Vec<Bound>>,
user_data: &mut U,
) -> Result<Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>, E>
fn hessian_bounded( &self, x: &[f64], bounds: Option<&Vec<Bound>>, user_data: &mut U, ) -> Result<Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>, E>
x with the given arguments/user data. This
function assumes x is an internal, unbounded vector, but performs a coordinate transform
to bound x when evaluating the function. Read moreAuto Trait Implementations§
impl Freeze for LikelihoodEvaluator
impl !RefUnwindSafe for LikelihoodEvaluator
impl Send for LikelihoodEvaluator
impl Sync for LikelihoodEvaluator
impl Unpin for LikelihoodEvaluator
impl !UnwindSafe for LikelihoodEvaluator
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
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>
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>
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.