mse: Calculate mean squared difference

Description Usage Arguments Details Value Examples

View source: R/O2PLS.R

Description

Calculate mean squared difference

Usage

1
mse(x, y = 0, na.rm = FALSE)

Arguments

x

Numeric vector or matrix.

y

Numeric vector or matrix. Defaults to 0.

na.rm

Remove NA's?

Details

Is equal to ssq(x-y)/length(c(x)). If x and y are of unequal length, the invoked minus-operator will try to make the best out of it by recycling elements of the shorter object (usually you don't want that). In particular if x is an N x p matrix and y an N x 1 vector, y is subtracted from each column of x, and if y=0 (default) you get the mean of vec(x^2)

Value

The mean of the squared differences elementwise.

Examples

1
2
3
mse(2)
mse(1:10,2:11) == 1
mse(matrix(rnorm(500),100,5),matrix(rnorm(500),100,5))

selbouhaddani/O2PLS documentation built on May 29, 2019, 5:53 p.m.