mvtsa.representation.PCAModel#
- class mvtsa.representation.PCAModel(n_components=0.95, center=True, scale=False, lags=0)[source]#
Bases:
objectPrincipal component model with monitoring statistics.
- Parameters:
- n_components
int,floatorstr Retained components (see
resolve_n_components()).- centerbool
Subtract the mean before the eigen-decomposition. With
Falsethe model describes the data about the origin, which makes the \(T^2\) statistic sensitive to the drift of the operating point.- scalebool
Divide every variable by its standard deviation (correlation PCA).
- lags
int Number of lags: if positive, the model is a dynamic PCA model fitted to the lag-extended matrix (
mvtsa.preprocessing.dynamize()).
- n_components
- Attributes:
Examples
>>> rng = np.random.default_rng(0) >>> t = rng.normal(size=(200, 1)) >>> X = np.hstack([t, 2 * t, -t]) + 0.01 * rng.normal(size=(200, 3)) >>> PCAModel(0.99).fit(X).n_components_ 1
- contributions(X, statistic='Q')[source]#
Contribution of every variable to \(Q\) or \(T^2\) at every sample (columns refer to the possibly lagged variables).
- control_limits(alpha=0.01)[source]#
Upper control limits of \(T^2\) (F distribution) and \(Q\) (Jackson and Mudholkar, 1979) at significance
alpha.
- similarity(other, kind='krzanowski')[source]#
PCA similarity factor between two fitted models (see
krzanowski_similarity(),lambda_similarity()).