Struct augurs_ets::AutoETS

source ·
pub struct AutoETS { /* private fields */ }
Expand description

Automatic ETS model selection.

Implementations§

source§

impl AutoETS

source

pub fn new( season_length: usize, spec: impl TryInto<AutoSpec, Error = Error>, ) -> Result<Self, Error>

Create a new AutoETS model with the given period and model search specification string.

The specification string should be of the form XXX where the first character is the error component, the second is the trend component, and the third is the seasonal component. The possible values for each component are:

  • N for no component
  • A for additive
  • M for multiplicative
  • Z for automatic

Using Z for any component will cause the model to try all possible values for that component. For example, ZAZ will try all possible error and seasonal components, but only additive trend components.

§Errors

An error will be returned if the specification string is not of the correct length or contains invalid characters.

source

pub fn from_spec(season_length: usize, spec: AutoSpec) -> Self

Create a new AutoETS model with the given period and model search specification.

source

pub fn season_length(&self) -> usize

Get the season length of the model.

source

pub fn spec(&self) -> AutoSpec

Get the search specification.

source

pub fn non_seasonal() -> Self

Create a new AutoETS model search without any seasonal components.

Equivalent to AutoETS::new(1, "ZZN").

source

pub fn damped(self, damped: bool) -> Result<Self, Error>

Fix the search to consider only damped or undamped trend.

source

pub fn alpha(self, alpha: f64) -> Self

Set the value of alpha to use when fitting the model.

See the docs for Params::alpha for more details on alpha.

source

pub fn beta(self, beta: f64) -> Self

Set the value of beta to use when fitting the model.

See the docs for Params::beta for more details on beta.

source

pub fn gamma(self, gamma: f64) -> Self

Set the value of gamma to use when fitting the model.

See the docs for Params::gamma for more details on gamma.

source

pub fn phi(self, phi: f64) -> Self

Set the value of phi to use when fitting the model.

See the docs for Params::phi for more details on phi.

source

pub fn allow_multiplicative_trend(self, allow: bool) -> Self

Include models with multiplicative trend during automatic model selection.

By default, models with multiplicative trend are excluded from the search space.

Trait Implementations§

source§

impl Clone for AutoETS

source§

fn clone(&self) -> AutoETS

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AutoETS

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Fit for AutoETS

source§

fn fit(&self, y: &[f64]) -> Result<Self::Fitted, Error>

Search for the best model, fitting it to the data.

The model is stored on the AutoETS struct and can be retrieved with the model method. It is also returned by this function.

§Errors

If no model can be found, or if any parameters are invalid, this function returns an error.

§

type Fitted = FittedAutoETS

The type of the fitted model produced by the fit method.
§

type Error = Error

The type of error returned when fitting the model.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more