pub struct DynamicFactorModel {
pub loadings: Array2<f64>,
pub ar_matrices: Vec<Array2<f64>>,
pub factors: Array2<f64>,
pub r: Array2<f64>,
pub q: Array2<f64>,
pub n_factors: usize,
pub n_vars: usize,
pub n_lags: usize,
pub log_lik_history: Vec<f64>,
}Expand description
Fitted Dynamic Factor Model.
All fields correspond to the last EM iterate (or the converged
solution when max_iter is large enough).
Fields§
§loadings: Array2<f64>Factor loading matrix Λ of shape (n_vars, n_factors).
ar_matrices: Vec<Array2<f64>>VAR coefficient matrices [A_1, ..., A_p], each (n_factors, n_factors).
factors: Array2<f64>Smoothed factors, shape (T, n_factors).
r: Array2<f64>Idiosyncratic covariance matrix R, shape (n_vars, n_vars) (diagonal).
q: Array2<f64>Factor innovation covariance Q, shape (n_factors, n_factors).
n_factors: usizeNumber of latent factors.
n_vars: usizeNumber of observed variables.
n_lags: usizeNumber of VAR lags.
log_lik_history: Vec<f64>EM log-likelihood trajectory (one value per iteration).
Implementations§
Source§impl DynamicFactorModel
impl DynamicFactorModel
Sourcepub fn extract_factors(&self) -> Array2<f64>
pub fn extract_factors(&self) -> Array2<f64>
Return the smoothed factor matrix (rows = time, cols = factors).
This is a convenience alias for the factors field.
Sourcepub fn forecast_one_step(&self) -> StatsResult<Array1<f64>>
pub fn forecast_one_step(&self) -> StatsResult<Array1<f64>>
One-step-ahead forecast of the observations at time T+1, given
the last smoothed factor state.
Returns a K-vector X̂_{T+1} = Λ * E[F_{T+1} | X_{1:T}].
Trait Implementations§
Source§impl Clone for DynamicFactorModel
impl Clone for DynamicFactorModel
Source§fn clone(&self) -> DynamicFactorModel
fn clone(&self) -> DynamicFactorModel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DynamicFactorModel
impl RefUnwindSafe for DynamicFactorModel
impl Send for DynamicFactorModel
impl Sync for DynamicFactorModel
impl Unpin for DynamicFactorModel
impl UnsafeUnpin for DynamicFactorModel
impl UnwindSafe for DynamicFactorModel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§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.