Class WeightedRSS


  • public class WeightedRSS
    extends Object
    Weighted sum of squared residuals (RSS) for a given function \(f(.)\) and observations \((x_i,y_i)\). \[ RSS = \sum_{i=1}^n w_i [y_i - f(x_i)]^2 \]
    See Also:
    Wikipedia: Least Squares
    • Constructor Detail

      • WeightedRSS

        public WeightedRSS​(UnivariateRealFunction f)
        Constructs a calculator to compute the weighted RSS for a given function.
        Parameters:
        f - a function
    • Method Detail

      • value

        public double value​(double[] x,
                            double[] y,
                            double[] weights)
        Computes the weighted RSS for a set of observations.
        Parameters:
        x - the independent variables
        y - the dependent variables
        weights - the weights
        Returns:
        weighted RSS