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
sourceimpl VillarFit
impl VillarFit
sourcepub fn new<VLP>(
algorithm: CurveFitAlgorithm,
ln_prior: VLP,
inits_bounds: VillarInitsBounds
) -> Self where
VLP: Into<VillarLnPrior>,
pub fn new<VLP>(
algorithm: CurveFitAlgorithm,
ln_prior: VLP,
inits_bounds: VillarInitsBounds
) -> Self where
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 fn doc() -> &'static str
Trait Implementations
sourceimpl<'de> Deserialize<'de> for VillarFit
impl<'de> Deserialize<'de> for VillarFit
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl EvaluatorInfoTrait for VillarFit
impl EvaluatorInfoTrait for VillarFit
sourcefn size_hint(&self) -> usize
fn size_hint(&self) -> usize
Size of vectors returned by eval(), get_names() and get_descriptions() Read more
sourcefn min_ts_length(&self) -> usize
fn min_ts_length(&self) -> usize
Minimum time series length required to successfully evaluate feature
sourcefn is_t_required(&self) -> bool
fn is_t_required(&self) -> bool
If time array used by the feature
sourcefn is_m_required(&self) -> bool
fn is_m_required(&self) -> bool
If magnitude array is used by the feature
sourcefn is_w_required(&self) -> bool
fn is_w_required(&self) -> bool
If weight array is used by the feature
sourcefn is_sorting_required(&self) -> bool
fn is_sorting_required(&self) -> bool
If feature requires time-sorting on the input TimeSeries
sourceimpl<T> FeatureEvaluator<T> for VillarFit where
T: Float,
impl<T> FeatureEvaluator<T> for VillarFit where
T: Float,
sourcefn eval(&self, ts: &mut TimeSeries<'_, T>) -> Result<Vec<T>, EvaluatorError>
fn eval(&self, ts: &mut TimeSeries<'_, T>) -> Result<Vec<T>, EvaluatorError>
Vector of feature values or EvaluatorError
sourcefn 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>
Returns vector of feature values and fill invalid components with given value
sourcefn check_ts_length(
&self,
ts: &TimeSeries<'_, T>
) -> Result<usize, EvaluatorError>
fn check_ts_length(
&self,
ts: &TimeSeries<'_, T>
) -> Result<usize, EvaluatorError>
Checks if TimeSeries has enough points to evaluate the feature
sourceimpl<T> FitDerivalivesTrait<T, NPARAMS> for VillarFit where
T: Float,
impl<T> FitDerivalivesTrait<T, NPARAMS> for VillarFit where
T: Float,
sourceimpl 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>
sourceimpl<T> FitFunctionTrait<T, NPARAMS> for VillarFit where
T: Float,
impl<T> FitFunctionTrait<T, NPARAMS> for VillarFit where
T: Float,
sourceimpl<T> FitInitsBoundsTrait<T, NPARAMS> for VillarFit where
T: Float,
impl<T> FitInitsBoundsTrait<T, NPARAMS> for VillarFit where
T: Float,
fn init_and_bounds_from_ts(
&self,
ts: &mut TimeSeries<'_, T>
) -> FitInitsBoundsArrays<NPARAMS>
sourceimpl<T, U> FitModelTrait<T, U, NPARAMS> for VillarFit where
T: Float + Into<U>,
U: LikeFloat,
impl<T, U> FitModelTrait<T, U, NPARAMS> for VillarFit where
T: Float + Into<U>,
U: LikeFloat,
sourceimpl<U> FitParametersInternalDimlessTrait<U, NPARAMS> for VillarFit where
U: LikeFloat,
impl<U> FitParametersInternalDimlessTrait<U, NPARAMS> for VillarFit where
U: LikeFloat,
sourceimpl FitParametersInternalExternalTrait<NPARAMS> for VillarFit
impl FitParametersInternalExternalTrait<NPARAMS> for VillarFit
fn convert_to_internal(
norm_data: &NormalizedData<f64>,
orig: &[f64; NPARAMS]
) -> [f64; NPARAMS]
fn convert_to_external(
norm_data: &NormalizedData<f64>,
params: &[f64; NPARAMS]
) -> [f64; NPARAMS]
sourceimpl FitParametersOriginalDimLessTrait<NPARAMS> for VillarFit
impl FitParametersOriginalDimLessTrait<NPARAMS> for VillarFit
sourceimpl JsonSchema for VillarFit
impl JsonSchema for VillarFit
sourcefn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
sourcefn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
sourcefn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the $ref
keyword. Read more
Auto Trait Implementations
impl RefUnwindSafe for VillarFit
impl Send for VillarFit
impl Sync for VillarFit
impl Unpin for VillarFit
impl UnwindSafe for VillarFit
Blanket Implementations
sourceimpl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
sourcefn 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>
Convert the given value into an approximately equivalent representation.
sourceimpl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
sourcefn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
sourcefn approx(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
fn approx(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
Approximate the subject with the default scheme.
sourcefn approx_by<Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_by<Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject with a specific scheme.
sourceimpl<T> ConvUtil for T
impl<T> ConvUtil for T
sourcefn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
Approximate the subject to a given type with the default scheme.
sourcefn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.