pub struct SarimaModel { /* private fields */ }Expand description
SARIMA(p,d,q)(P,D,Q)m.
The multiplicative form is expanded into a single AR polynomial of degree
p + P·m and a single MA polynomial of degree q + Q·m, so the seasonal
orders participate in the forecast recursion rather than only in the
stored parameters. All four coefficient blocks are estimated jointly by
conditional sum of squares, seeded from a Burg fit of the non-seasonal AR
part — the seasonal and non-seasonal AR factors multiply, so estimating
one while pretending the other is absent biases both.
Implementations§
Source§impl SarimaModel
impl SarimaModel
Sourcepub fn from_config(cfg: SarimaConfig) -> Self
pub fn from_config(cfg: SarimaConfig) -> Self
Creates a new SARIMA model from a SarimaConfig.
Sourcepub fn new(
p: usize,
d: usize,
q: usize,
sp: usize,
sd: usize,
sq: usize,
m: usize,
) -> Self
pub fn new( p: usize, d: usize, q: usize, sp: usize, sd: usize, sq: usize, m: usize, ) -> Self
Creates a new SARIMA model with explicit order parameters.
A period m of 0 or 1 leaves no seasonal structure to model; the
seasonal orders are then ignored and the model degenerates to
ARIMA(p,d,q), which is what those periods mean.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SarimaModel
impl<'de> Deserialize<'de> for SarimaModel
Source§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>,
Source§impl ForecastModel for SarimaModel
impl ForecastModel for SarimaModel
Source§fn fit(
&mut self,
timestamps: &[i64],
values: &[f64],
) -> Result<(), ForecastError>
fn fit( &mut self, timestamps: &[i64], values: &[f64], ) -> Result<(), ForecastError>
Source§fn predict(&self, horizon: usize) -> Result<ForecastResult, ForecastError>
fn predict(&self, horizon: usize) -> Result<ForecastResult, ForecastError>
horizon steps ahead.Source§fn update(&mut self, timestamp: i64, value: f64) -> Result<(), ForecastError>
fn update(&mut self, timestamp: i64, value: f64) -> Result<(), ForecastError>
Source§fn model_type(&self) -> ModelType
fn model_type(&self) -> ModelType
Source§fn params(&self) -> &ModelParams
fn params(&self) -> &ModelParams
Source§impl ModelStore for SarimaModel
impl ModelStore for SarimaModel
Source§fn from_bytes(bytes: &[u8]) -> Result<Self, StorageError>where
Self: Sized,
fn from_bytes(bytes: &[u8]) -> Result<Self, StorageError>where
Self: Sized,
Auto Trait Implementations§
impl Freeze for SarimaModel
impl RefUnwindSafe for SarimaModel
impl Send for SarimaModel
impl Sync for SarimaModel
impl Unpin for SarimaModel
impl UnsafeUnpin for SarimaModel
impl UnwindSafe for SarimaModel
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more