Struct light_curve_feature::features::LinexpFit
source · pub struct LinexpFit { /* private fields */ }
Expand description
Linexp function fit
Four fit parameters and goodness of fit (reduced $\chi^2$) of the Linexp function developed for core-collapsed supernovae:
$$ f(t) = A \frac{(t-t_0)}{\tau} \times \exp{\left(\frac{(t-t_0)}{\tau}\right)} + B. $$
Note, that the Linexp function is developed to be used with fluxes, not magnitudes.
- Depends on: time, flux, flux error
- Minimum number of observations: 5
- Number of features: 5
Implementations§
source§impl LinexpFit
impl LinexpFit
sourcepub fn new<BLP>(
algorithm: CurveFitAlgorithm,
ln_prior: BLP,
inits_bounds: LinexpInitsBounds
) -> Selfwhere
BLP: Into<LinexpLnPrior>,
pub fn new<BLP>(
algorithm: CurveFitAlgorithm,
ln_prior: BLP,
inits_bounds: LinexpInitsBounds
) -> Selfwhere
BLP: Into<LinexpLnPrior>,
New LinexpFit 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 LinexpLnPrior 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 LinexpFit
sourcepub fn default_ln_prior() -> LinexpLnPrior
pub fn default_ln_prior() -> LinexpLnPrior
pub fn default_inits_bounds() -> LinexpInitsBounds
pub const fn doc() -> &'static str
Trait Implementations§
source§impl<'de> Deserialize<'de> for LinexpFit
impl<'de> Deserialize<'de> for LinexpFit
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 LinexpFit
impl EvaluatorInfoTrait for LinexpFit
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 LinexpFitwhere
T: Float,
impl<T> FeatureEvaluator<T> for LinexpFitwhere
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 LinexpFitwhere
T: Float,
impl<T> FitDerivalivesTrait<T, NPARAMS> for LinexpFitwhere
T: Float,
fn derivatives(t: T, param: &[T; 4], jac: &mut [T; 4])
source§impl FitFeatureEvaluatorGettersTrait<NPARAMS> for LinexpFit
impl FitFeatureEvaluatorGettersTrait<NPARAMS> for LinexpFit
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 LinexpFitwhere
T: Float,
impl<T> FitFunctionTrait<T, NPARAMS> for LinexpFitwhere
T: Float,
source§impl<T> FitInitsBoundsTrait<T, NPARAMS> for LinexpFitwhere
T: Float,
impl<T> FitInitsBoundsTrait<T, NPARAMS> for LinexpFitwhere
T: Float,
fn init_and_bounds_from_ts( &self, ts: &mut TimeSeries<'_, T> ) -> FitInitsBoundsArrays<NPARAMS>
source§impl<T, U> FitModelTrait<T, U, NPARAMS> for LinexpFit
impl<T, U> FitModelTrait<T, U, NPARAMS> for LinexpFit
source§impl<U> FitParametersInternalDimlessTrait<U, NPARAMS> for LinexpFitwhere
U: LikeFloat,
impl<U> FitParametersInternalDimlessTrait<U, NPARAMS> for LinexpFitwhere
U: LikeFloat,
fn dimensionless_to_internal(params: &[U; 4]) -> [U; 4]
fn internal_to_dimensionless(params: &[U; 4]) -> [U; 4]
source§impl FitParametersInternalExternalTrait<NPARAMS> for LinexpFit
impl FitParametersInternalExternalTrait<NPARAMS> for LinexpFit
source§impl FitParametersOriginalDimLessTrait<NPARAMS> for LinexpFit
impl FitParametersOriginalDimLessTrait<NPARAMS> for LinexpFit
source§impl JsonSchema for LinexpFit
impl JsonSchema for LinexpFit
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(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreAuto Trait Implementations§
impl Freeze for LinexpFit
impl RefUnwindSafe for LinexpFit
impl Send for LinexpFit
impl Sync for LinexpFit
impl Unpin for LinexpFit
impl UnwindSafe for LinexpFit
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,
§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, 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