PrincipalComponentAnalysis.GetQResidual Method

Returns the Q-residual, also known as squared prediction error (SPE), for an observation.

Definition

Namespace: Numerics.NET.Statistics.Multivariate
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.8.0
C#
public double GetQResidual(
	Vector<double> observation
)

Parameters

observation  Vector<Double>
The observation, with the same feature order as the training data.

Return Value

Double
The squared Euclidean norm of the residual in PCA preprocessing space.

Remarks

The fitted preprocessing is applied to the observation. The result is the squared norm of the difference between this preprocessed observation and its reconstruction using the currently retained NumberOfComponents principal components. When scaling is enabled, this generally differs from squared reconstruction error in the original measurement units.

This method is also available on deployed and deserialized models.

Exceptions

ArgumentNullExceptionobservation is null.
DimensionMismatchExceptionThe observation length does not match the model's feature count.
InvalidOperationExceptionThe model has not been fitted. Call Fit() first.

See Also