Skip to contents

A = (mean(xy) - mean(x)mean(y))/(mean(x^2) - mean(x)^2) and B = mean(y) - A mean(x); the ratio form of B is computed independently and the two must agree. The defaults are the book's five-point worked data set.

Usage

LsqFit(x = NULL, y = NULL)

Arguments

x, y

equal-length data vectors, n >= 2.

Value

list(A, B, S).

References

Morin, D. J. (2016). Probability: For the Enthusiastic Beginner. Createspace. Eqs (6.42)-(6.49), (6.82).

Examples

LsqFit()$A
#> [1] 1