sse: SSE

Description Usage Arguments Value Examples

Description

Calculates the sum of squared errors (SSE) between x and the target.

Usage

1
sse(x, target, na.rm = FALSE)

Arguments

x

numeric vector

target

numeric vector

na.rm

logical; should NAs be removed before the calculation?

Value

An atomic numeric vector containing the calculated SSE

Examples

1
2
3
4
sse(c(1, 2, 3), c(2, 3, 4))                 #> 1 + 1 + 1 =  3.0
sse(c(1, 2, 3), c(3, 4, 5))                 #> 4 + 4 + 4 = 12.0
sse(c(1, 2, NA), c(1, 2, 3))                #> NA
sse(c(1, 2, NA), c(1, 2, 3), na.rm = TRUE)  #> 0 + 0 = 0.0

max-graham/metrics documentation built on May 5, 2019, 5:53 p.m.