Principal Component Analysis.Get QResidual 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#
The squared Euclidean norm of the residual in PCA preprocessing space.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.8.0
public double GetQResidual(
Vector<double> observation
)Parameters
Return Value
DoubleThe 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
| Argument | observation is null. |
| Dimension | The observation length does not match the model's feature count. |
| Invalid | The model has not been fitted. Call Fit() first. |