Struct light_curve_feature::features::VillarFit
source · pub struct VillarFit { /* private fields */ }
Expand description
Villar function fit
Seven fit parameters and goodness of fit (reduced $\chi^2$) of the Villar function developed for supernovae classification:
$$ f(t) = c + \frac{A}{ 1 + \exp{\frac{-(t - t_0)}{\tau_\mathrm{rise}}}} \left\{ \begin{array}{ll} 1 - \frac{\nu (t - t_0)}{\gamma}, &t < t_0 + \gamma \\ (1 - \nu) \exp{\frac{-(t-t_0-\gamma)}{\tau_\mathrm{fall}}}, &t \geq t_0 + \gamma \end{array} \right. $$ where $A, \gamma, \tau_\mathrm{rise}, \tau_\mathrm{fall} > 0$, $\nu \in [0; 1)$.Here we introduce a new dimensionless parameter $\nu$ instead of the plateau slope $\beta$ from the orioginal paper: $\nu \equiv -\beta \gamma / A$.
Note, that the Villar function is developed to be used with fluxes, not magnitudes.
- Depends on: time, magnitude, magnitude error
- Minimum number of observations: 8
- Number of features: 8
Villar et al. 2019 DOI:10.3847/1538-4357/ab418c
Implementations§
source§impl VillarFit
impl VillarFit
sourcepub fn new<VLP>(
algorithm: CurveFitAlgorithm,
ln_prior: VLP,
inits_bounds: VillarInitsBounds
) -> Selfwhere
VLP: Into<VillarLnPrior>,
pub fn new<VLP>(
algorithm: CurveFitAlgorithm,
ln_prior: VLP,
inits_bounds: VillarInitsBounds
) -> Selfwhere
VLP: Into<VillarLnPrior>,
New VillarFit instance
algorithm
specifies which optimization method is used, it is an instance of the
CurveFitAlgorithm, currently supported algorithms are MCMC and
LMSDER (a Levenberg–Marquard algorithm modification,
requires gsl
Cargo feature).
ln_prior
is an instance of LnPrior 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 VillarFit
sourcepub fn default_ln_prior() -> VillarLnPrior
pub fn default_ln_prior() -> VillarLnPrior
Default VillarLnPrior for VillarFit
pub fn default_inits_bounds() -> VillarInitsBounds
pub const fn doc() -> &'static str
Trait Implementations§
source§impl<'de> Deserialize<'de> for VillarFit
impl<'de> Deserialize<'de> for VillarFit
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 VillarFit
impl EvaluatorInfoTrait for VillarFit
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 VillarFitwhere
T: Float,
impl<T> FeatureEvaluator<T> for VillarFitwhere
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 VillarFitwhere
T: Float,
impl<T> FitDerivalivesTrait<T, NPARAMS> for VillarFitwhere
T: Float,
fn derivatives(t: T, param: &[T; 7], jac: &mut [T; 7])
source§impl FitFeatureEvaluatorGettersTrait<NPARAMS> for VillarFit
impl FitFeatureEvaluatorGettersTrait<NPARAMS> for VillarFit
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 VillarFitwhere
T: Float,
impl<T> FitFunctionTrait<T, NPARAMS> for VillarFitwhere
T: Float,
source§impl<T> FitInitsBoundsTrait<T, NPARAMS> for VillarFitwhere
T: Float,
impl<T> FitInitsBoundsTrait<T, NPARAMS> for VillarFitwhere
T: Float,
fn init_and_bounds_from_ts( &self, ts: &mut TimeSeries<'_, T> ) -> FitInitsBoundsArrays<NPARAMS>
source§impl<T, U> FitModelTrait<T, U, NPARAMS> for VillarFit
impl<T, U> FitModelTrait<T, U, NPARAMS> for VillarFit
source§impl<U> FitParametersInternalDimlessTrait<U, NPARAMS> for VillarFitwhere
U: LikeFloat,
impl<U> FitParametersInternalDimlessTrait<U, NPARAMS> for VillarFitwhere
U: LikeFloat,
fn dimensionless_to_internal(params: &[U; 7]) -> [U; 7]
fn internal_to_dimensionless(params: &[U; 7]) -> [U; 7]
source§impl FitParametersInternalExternalTrait<NPARAMS> for VillarFit
impl FitParametersInternalExternalTrait<NPARAMS> for VillarFit
source§impl FitParametersOriginalDimLessTrait<NPARAMS> for VillarFit
impl FitParametersOriginalDimLessTrait<NPARAMS> for VillarFit
source§impl JsonSchema for VillarFit
impl JsonSchema for VillarFit
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 VillarFit
impl RefUnwindSafe for VillarFit
impl Send for VillarFit
impl Sync for VillarFit
impl Unpin for VillarFit
impl UnwindSafe for VillarFit
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