pub struct SesResult {
pub smoothed: Vec<f64>,
pub forecast: f64,
pub fitted: Vec<f64>,
pub alpha: f64,
}Expand description
Result of simple exponential smoothing at each time step.
Fields§
§smoothed: Vec<f64>Smoothed values.
forecast: f64One-step-ahead forecast for the next period.
fitted: Vec<f64>One-step-ahead in-sample forecasts: fitted[t] = smoothed[t − 1], and
fitted[0] the initial level data[0].
alpha: f64The smoothing constant α.
Implementations§
Source§impl SesResult
impl SesResult
Sourcepub const FIRST_ERROR: usize = 1
pub const FIRST_ERROR: usize = 1
The index of the first one-step error the smoother learns from: before it the fitted value is the initialisation.
Sourcepub fn residuals(&self, data: &[f64]) -> Vec<Option<f64>>
pub fn residuals(&self, data: &[f64]) -> Vec<Option<f64>>
data[t] − fitted[t], None at the initialisation.
Sourcepub fn forecasts(
&self,
data: &[f64],
horizon: usize,
level: f64,
) -> Option<Vec<SmoothingForecast>>
pub fn forecasts( &self, data: &[f64], horizon: usize, level: f64, ) -> Option<Vec<SmoothingForecast>>
Forecasts 1..=horizon steps ahead with the prediction interval of
ETS(A,N,N) at two-sided level (module documentation); data is the
series smoothed (for σ). None when level is not in (0, 1).
Sourcepub fn first_passage(
&self,
data: &[f64],
horizon: usize,
threshold: f64,
quantiles: &[f64],
paths: usize,
seed: u64,
) -> Option<FirstPassage>
pub fn first_passage( &self, data: &[f64], horizon: usize, threshold: f64, quantiles: &[f64], paths: usize, seed: u64, ) -> Option<FirstPassage>
When the forecast total over steps 1, 2, … first reaches threshold
(non-zero; from below when positive, from above when negative), over
paths simulated futures of the fitted model seeded with seed, within
horizon steps – with the quantiles (each in (0, 1]) of that time
(FirstPassage). data is the series smoothed (for σ). None when
an argument is outside those ranges or there is no one-step error to
estimate σ from.