The OpenD Programming Language

simpleLinearRegression.simpleLinearRegression

  1. sumType!YRange[2] simpleLinearRegression(XRange x, YRange y)
    template simpleLinearRegression(Summation summation = Summation.kbn)
    @safe
    sumType!YRange[2]
    simpleLinearRegression
    (
    XRange
    YRange
    )
    (
    XRange x
    ,
    YRange y
    )
    if (
    isInputRange!XRange &&
    &&
    !(
    isArray!XRange &&
    isArray!YRange
    )
    &&
    isFloatingPoint!(sumType!YRange)
    )
  2. sumType!(Y[])[2] simpleLinearRegression(X[] x, Y[] y)
  3. template simpleLinearRegression(string summation)

Parameters

x XRange

x[i] points

y YRange

f(x[i]) values

Return Value

Type: sumType!YRange[2]

The pair of shift and slope of the linear curve.

Meta