pub struct BinnedGuideTerm { /* private fields */ }
Expand description
A LikelihoodTerm
whose size is proportional to the χ²-distance from a binned projection of
the fit to a provided set of datapoints representing the true values in each bin.
This is intended to be used as follows. Suppose we perform a binned fit to a simple amplitude
which is not parameterized over the binning variable. We then form a new
Model
which is
parameterized over said variable, and we wish to perform an unbinned fit. If we can isolate
terms which are not interfering, we could imagine fitting the unbinned data with a cost
function that minimizes the distance to the result from the binned fit. From there, it is up to
the user to decide what to do with this minimum. Caution should be used, as this will not be
the minimum of the NLL
, but of the guide term only. However, this minimum could be used as
an intermediate for getting close to a global minimum if the likelihood landscape has many
local minima. Then a true fit could be performed, starting at this intermediate point.
Implementations§
Source§impl BinnedGuideTerm
impl BinnedGuideTerm
Sourcepub fn new<V, L, T, U, E>(
nll: Box<NLL>,
variable: &V,
amplitude_sets: &[T],
bins: usize,
range: (f64, f64),
count_sets: &[U],
error_sets: Option<&[E]>,
) -> Box<BinnedGuideTerm>
pub fn new<V, L, T, U, E>( nll: Box<NLL>, variable: &V, amplitude_sets: &[T], bins: usize, range: (f64, f64), count_sets: &[U], error_sets: Option<&[E]>, ) -> Box<BinnedGuideTerm>
Construct a new BinnedGuideTerm
This term takes a list of subsets of amplitudes, activates each set, and compares the projected
histogram to the known one provided at construction. Both count_sets
and error_sets
should
have the same shape, and their first dimension should be the same as that of amplitude_sets
.
The intended usage is to provide some sets of amplitudes to isolate, like [["amp1", "amp2"], ["amp3"]]
,
along with some known counts for a binned fit (count_sets ~ [[histogram counts involving "amp1" and "amp2"], [histogram counts involving "amp3"]]
and simlar for error_sets
).
Trait Implementations§
Source§impl Clone for BinnedGuideTerm
impl Clone for BinnedGuideTerm
Source§fn clone(&self) -> BinnedGuideTerm
fn clone(&self) -> BinnedGuideTerm
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl LikelihoodTerm for BinnedGuideTerm
impl LikelihoodTerm for BinnedGuideTerm
Source§fn parameters(&self) -> Vec<String>
fn parameters(&self) -> Vec<String>
LikelihoodTerm::evaluate
.Auto Trait Implementations§
impl Freeze for BinnedGuideTerm
impl !RefUnwindSafe for BinnedGuideTerm
impl Send for BinnedGuideTerm
impl Sync for BinnedGuideTerm
impl Unpin for BinnedGuideTerm
impl !UnwindSafe for BinnedGuideTerm
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> 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>
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.