Skip to contents

The residuals of the fitted line sum to zero, which is the dS/dB normal equation.

Usage

LsqResid(x, y)

Arguments

x, y

equal-length data vectors, n >= 2.

Value

list(residual_sum, A, B).

References

Morin, D. J. (2016). Probability: For the Enthusiastic Beginner. Createspace. Eq (6.92).

Examples

LsqResid(c(2, 3, 3, 5, 7), c(1, 1, 3, 4, 6))$residual_sum
#> [1] 0