Description Usage Arguments Details Value Examples
Sum of Squared Error
1 | sum_squares(x, y = x)
|
x |
numeric vector |
y |
optional, numeric vector, same length as |
The sum of squared errors for a length n vector x will equal
S_{xx} = ∑_i^n(x - \overline{x})^2,
where \overline{x} is the mean of x.
The cross-product is
S_{xy} = ∑_i^n (x - \overline{x})(y - \overline{y})
either the sum of squared errors for x
(if y
is left out),
or the cross-product of two vectors x
with y
1 2 3 4 5 6 7 | # the sum of squared errors for x
x <- rnorm(10)
sum_squares(x)
# a cross-product
y <- rnorm(10)
sum_squares(x, y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.