[−][src]Struct yata::methods::TEMA
Triple Exponential Moving Average of specified length
for timeseries of type ValueType
Parameters
Has a single parameter length
: PeriodType
length
should be > 0
Input type
Input type is ValueType
Output type
Output type is ValueType
Examples
use yata::core::Method; use yata::methods::TEMA; // TEMA of length=3 let mut tema = TEMA::new(3, 1.0).unwrap(); tema.next(1.0); tema.next(2.0); assert_eq!(tema.next(3.0), 2.9375); assert_eq!(tema.next(4.0), 4.0);
Performance
O(1)
See also
Trait Implementations
impl Clone for TEMA
[src]
impl Copy for TEMA
[src]
impl Debug for TEMA
[src]
impl<'de> Deserialize<'de> for TEMA
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Method<'_> for TEMA
[src]
type Params = PeriodType
Method parameters
type Input = ValueType
Input value type
type Output = Self::Input
Output value type
pub fn new(length: Self::Params, value: Self::Input) -> Result<Self, Error>
[src]
pub fn next(&mut self, value: Self::Input) -> Self::Output
[src]
pub fn name(&self) -> &str
[src]
pub fn memsize(&self) -> (usize, usize) where
Self: Sized,
[src]
Self: Sized,
pub fn over<S>(&'a mut self, inputs: S) -> Vec<Self::Output> where
S: Sequence<Self::Input>,
Self: Sized,
[src]
S: Sequence<Self::Input>,
Self: Sized,
pub fn apply<'b: 'a, T, S>(&'a mut self, sequence: &'b mut S) where
S: Sequence<T> + AsMut<[T]>,
Self: Method<'a, Input = T, Output = T> + Sized,
T: Copy,
[src]
S: Sequence<T> + AsMut<[T]>,
Self: Method<'a, Input = T, Output = T> + Sized,
T: Copy,
pub fn new_over<S>(
parameters: Self::Params,
inputs: S
) -> Result<Vec<Self::Output>, Error> where
S: Sequence<Self::Input>,
Self::Input: Clone,
Self: Sized + 'a,
[src]
parameters: Self::Params,
inputs: S
) -> Result<Vec<Self::Output>, Error> where
S: Sequence<Self::Input>,
Self::Input: Clone,
Self: Sized + 'a,
pub fn new_apply<T, S>(
parameters: Self::Params,
sequence: &'a mut S
) -> Result<(), Error> where
T: Copy,
S: Sequence<T> + AsMut<[T]>,
Self: Method<'a, Input = T, Output = T> + Sized + 'a,
[src]
parameters: Self::Params,
sequence: &'a mut S
) -> Result<(), Error> where
T: Copy,
S: Sequence<T> + AsMut<[T]>,
Self: Method<'a, Input = T, Output = T> + Sized + 'a,
pub fn into_fn(self) -> Box<dyn FnMut(Self::Input) -> Self::Output> where
Self: Sized + 'static,
[src]
Self: Sized + 'static,
pub fn new_fn(
params: Self::Params,
initial_value: Self::Input
) -> Result<Box<dyn FnMut(Self::Input) -> Self::Output>, Error> where
Self: Sized + 'static,
[src]
params: Self::Params,
initial_value: Self::Input
) -> Result<Box<dyn FnMut(Self::Input) -> Self::Output>, Error> where
Self: Sized + 'static,
impl Serialize for TEMA
[src]
Auto Trait Implementations
impl RefUnwindSafe for TEMA
[src]
impl Send for TEMA
[src]
impl Sync for TEMA
[src]
impl Unpin for TEMA
[src]
impl UnwindSafe for TEMA
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,