pub struct AutoETS { /* private fields */ }Expand description
Automatic ETS model selection.
Implementations§
Source§impl AutoETS
impl AutoETS
Sourcepub fn new(
season_length: usize,
spec: impl TryInto<AutoSpec, Error = Error>,
) -> Result<Self, Error>
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:
Nfor no componentAfor additiveMfor multiplicativeZfor 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.
Sourcepub fn from_spec(season_length: usize, spec: AutoSpec) -> Self
pub fn from_spec(season_length: usize, spec: AutoSpec) -> Self
Create a new AutoETS model with the given period and model search specification.
Sourcepub fn season_length(&self) -> usize
pub fn season_length(&self) -> usize
Get the season length of the model.
Sourcepub fn non_seasonal() -> Self
pub fn non_seasonal() -> Self
Create a new AutoETS model search without any seasonal components.
Equivalent to AutoETS::new(1, "ZZN").
Sourcepub fn damped(self, damped: bool) -> Result<Self, Error>
pub fn damped(self, damped: bool) -> Result<Self, Error>
Fix the search to consider only damped or undamped trend.
Sourcepub fn alpha(self, alpha: f64) -> Self
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.
Sourcepub fn beta(self, beta: f64) -> Self
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.
Sourcepub fn gamma(self, gamma: f64) -> Self
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.
Sourcepub fn phi(self, phi: f64) -> Self
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.
Sourcepub fn allow_multiplicative_trend(self, allow: bool) -> Self
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 Fit for AutoETS
impl Fit for AutoETS
Source§fn fit(&self, y: &[f64]) -> Result<Self::Fitted, Error>
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.
Source§type Fitted = FittedAutoETS
type Fitted = FittedAutoETS
fit method.Auto Trait Implementations§
impl Freeze for AutoETS
impl RefUnwindSafe for AutoETS
impl Send for AutoETS
impl Sync for AutoETS
impl Unpin for AutoETS
impl UnwindSafe for AutoETS
Blanket Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.