Struct light_curve_feature::features::BeyondNStd [−][src]
pub struct BeyondNStd<T> { /* fields omitted */ }
Expand description
Fraction of observations beyond $n,\sigma_m$ from the mean magnitude $\langle m \rangle$
$$ \mathrm{beyond}~n,\sigma_m \equiv \frac{\sum_i I_{|m - \langle m \rangle| > n,\sigma_m}(m_i)}{N}, $$ where $I$ is the indicator function, $N$ is the number of observations, $\langle m \rangle$ is the mean magnitude and $\sigma_m = \sqrt{\sum_i (m_i - \langle m \rangle)^2 / (N-1)}$ is the magnitude standard deviation.
- Depends on: magnitude
- Minimum number of observations: 2
- Number of features: 1
D’Isanto et al. 2016 DOI:10.1093/mnras/stw157
Example
use light_curve_feature::*;
use light_curve_common::all_close;
use std::f64::consts::SQRT_2;
let fe = FeatureExtractor::new(vec![BeyondNStd::default(), BeyondNStd::new(2.0)]);
let time = [0.0; 21]; // Doesn't depend on time
let mut magn = vec![0.0; 17];
magn.extend_from_slice(&[SQRT_2, -SQRT_2, 2.0 * SQRT_2, -2.0 * SQRT_2]);
let mut ts = TimeSeries::new_without_weight(&time[..], &magn[..]);
assert_eq!(0.0, ts.m.get_mean());
assert!((1.0 - ts.m.get_std()).abs() < 1e-15);
assert_eq!(vec![4.0 / 21.0, 2.0 / 21.0], fe.eval(&mut ts).unwrap());
Implementations
Trait Implementations
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>,
Deserialize this value from the given Serde deserializer. Read more
Size of vectors returned by eval(), get_names() and get_descriptions() Read more
Minimum time series length required to successfully evaluate feature
If time array used by the feature
If magnitude array is used by the feature
If weight array is used by the feature
If feature requires time-sorting on the input TimeSeries
Vector of feature values or EvaluatorError
Returns vector of feature values and fill invalid components with given value
Checks if TimeSeries has enough points to evaluate the feature
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl<T> RefUnwindSafe for BeyondNStd<T> where
T: RefUnwindSafe,
impl<T> Send for BeyondNStd<T> where
T: Send,
impl<T> Sync for BeyondNStd<T> where
T: Sync,
impl<T> Unpin for BeyondNStd<T> where
T: Unpin,
impl<T> UnwindSafe for BeyondNStd<T> where
T: UnwindSafe,
Blanket Implementations
Convert the given value into an approximately equivalent representation.
impl<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.
Convert the subject into an approximately equivalent representation.
Mutably borrows from an owned value. Read more
Approximate the subject with the default scheme.
fn 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.
Approximate the subject to a given type with the default scheme.
fn 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.
Attempt to convert the subject to a given type.