RegressionModel<T>.RSquared Property

Gets the R Squared value for the regression.

Definition

Namespace: Numerics.NET.DataAnalysis.Models
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
C#
public double RSquared { get; }

Property Value

Double
The R Squared value for the regression.

Remarks

The R2 value indicates the ratio of variation that is explained by the model to the total variation in the model. Its value is always between 0 and 1, where 0 indicates the model explains nothing, and 1 means the model explains the data perfectly.

Note that in most situations, irreducible errors in measurement will prevent the model from explaing all the variation. Models using a larger set of factors may produce an R2 value that is closer to 1. However, it may be that the additional factors are essentially modeling noise.

The AdjustedRSquared property returns the adjusted R2 value, which is a somewhat better indicator of goodness of fit.

Exceptions

InvalidOperationException

The property is accessed before the model has been computed.

See Also