pub struct BazinFit { /* private fields */ }
Expand description
Bazin function fit
Five fit parameters and goodness of fit (reduced $\chi^2$) of the Bazin function developed for core-collapsed supernovae:
$$ f(t) = A \frac{ \mathrm{e}^{ -(t-t_0)/\tau_\mathrm{fall} } }{ 1 + \mathrm{e}^{ -(t - t_0) / \tau_\mathrm{rise} } } + B. $$
Note, that the Bazin function is developed to be used with fluxes, not magnitudes. Also note a typo in the Eq. (1) of the original paper, the minus sign is missed in the “rise” exponent.
- Depends on: time, magnitude, magnitude error
- Minimum number of observations: 6
- Number of features: 6
Bazin et al. 2009 DOI:10.1051/0004-6361/200911847
Implementations§
Source§impl BazinFit
impl BazinFit
Sourcepub fn new<BLP>(
algorithm: CurveFitAlgorithm,
ln_prior: BLP,
inits_bounds: BazinInitsBounds,
) -> Selfwhere
BLP: Into<BazinLnPrior>,
pub fn new<BLP>(
algorithm: CurveFitAlgorithm,
ln_prior: BLP,
inits_bounds: BazinInitsBounds,
) -> Selfwhere
BLP: Into<BazinLnPrior>,
New BazinFit instance
algorithm
specifies which optimization method is used, it is an instance of the
CurveFitAlgorithm, currently supported algorithms are MCMC,
LMSDER (a Levenberg–Marquard algorithm modification,
requires gsl
Cargo feature), and Ceres (trust-region
algorithm, requires ceres
Cargo feature).
ln_prior
is an instance of BazinLnPrior and specifies the natural logarithm of the prior
to use. Some curve-fit algorithms doesn’t support this and ignores the prior
Sourcepub fn default_algorithm() -> CurveFitAlgorithm
pub fn default_algorithm() -> CurveFitAlgorithm
Default McmcCurveFit for BazinFit
Sourcepub fn default_ln_prior() -> BazinLnPrior
pub fn default_ln_prior() -> BazinLnPrior
pub fn default_inits_bounds() -> BazinInitsBounds
pub const fn doc() -> &'static str
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BazinFit
impl<'de> Deserialize<'de> for BazinFit
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl EvaluatorInfoTrait for BazinFit
impl EvaluatorInfoTrait for BazinFit
Source§fn min_ts_length(&self) -> usize
fn min_ts_length(&self) -> usize
Source§fn is_t_required(&self) -> bool
fn is_t_required(&self) -> bool
Source§fn is_m_required(&self) -> bool
fn is_m_required(&self) -> bool
Source§fn is_w_required(&self) -> bool
fn is_w_required(&self) -> bool
Source§fn is_sorting_required(&self) -> bool
fn is_sorting_required(&self) -> bool
Source§impl<T> FeatureEvaluator<T> for BazinFitwhere
T: Float,
impl<T> FeatureEvaluator<T> for BazinFitwhere
T: Float,
Source§fn eval(&self, ts: &mut TimeSeries<'_, T>) -> Result<Vec<T>, EvaluatorError>
fn eval(&self, ts: &mut TimeSeries<'_, T>) -> Result<Vec<T>, EvaluatorError>
EvaluatorError
Source§fn eval_or_fill(&self, ts: &mut TimeSeries<'_, T>, fill_value: T) -> Vec<T>
fn eval_or_fill(&self, ts: &mut TimeSeries<'_, T>, fill_value: T) -> Vec<T>
Source§fn check_ts_length(
&self,
ts: &TimeSeries<'_, T>,
) -> Result<usize, EvaluatorError>
fn check_ts_length( &self, ts: &TimeSeries<'_, T>, ) -> Result<usize, EvaluatorError>
Source§impl<T> FitDerivalivesTrait<T, NPARAMS> for BazinFitwhere
T: Float,
impl<T> FitDerivalivesTrait<T, NPARAMS> for BazinFitwhere
T: Float,
fn derivatives(t: T, param: &[T; 5], jac: &mut [T; 5])
Source§impl FitFeatureEvaluatorGettersTrait<NPARAMS> for BazinFit
impl FitFeatureEvaluatorGettersTrait<NPARAMS> for BazinFit
fn get_algorithm(&self) -> &CurveFitAlgorithm
fn ln_prior_from_ts<T: Float>( &self, ts: &mut TimeSeries<'_, T>, ) -> LnPrior<NPARAMS>
Source§impl<T> FitFunctionTrait<T, NPARAMS> for BazinFitwhere
T: Float,
impl<T> FitFunctionTrait<T, NPARAMS> for BazinFitwhere
T: Float,
Source§impl<T> FitInitsBoundsTrait<T, NPARAMS> for BazinFitwhere
T: Float,
impl<T> FitInitsBoundsTrait<T, NPARAMS> for BazinFitwhere
T: Float,
fn init_and_bounds_from_ts( &self, ts: &mut TimeSeries<'_, T>, ) -> FitInitsBoundsArrays<NPARAMS>
Source§impl<T, U> FitModelTrait<T, U, NPARAMS> for BazinFit
impl<T, U> FitModelTrait<T, U, NPARAMS> for BazinFit
Source§impl<U> FitParametersInternalDimlessTrait<U, NPARAMS> for BazinFitwhere
U: LikeFloat,
impl<U> FitParametersInternalDimlessTrait<U, NPARAMS> for BazinFitwhere
U: LikeFloat,
fn dimensionless_to_internal(params: &[U; 5]) -> [U; 5]
fn internal_to_dimensionless(params: &[U; 5]) -> [U; 5]
Source§impl FitParametersInternalExternalTrait<NPARAMS> for BazinFit
impl FitParametersInternalExternalTrait<NPARAMS> for BazinFit
Source§impl FitParametersOriginalDimLessTrait<NPARAMS> for BazinFit
impl FitParametersOriginalDimLessTrait<NPARAMS> for BazinFit
Source§impl JsonSchema for BazinFit
impl JsonSchema for BazinFit
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreAuto Trait Implementations§
impl Freeze for BazinFit
impl RefUnwindSafe for BazinFit
impl Send for BazinFit
impl Sync for BazinFit
impl Unpin for BazinFit
impl UnwindSafe for BazinFit
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
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, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
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 more