mse {OmicsPLS} | R Documentation |
Calculate mean squared difference
Description
Calculate mean squared difference
Usage
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
mse(2)
mse(1:10,2:11) == 1
mse(matrix(rnorm(500),100,5),matrix(rnorm(500),100,5))
[Package OmicsPLS version 2.0.2 Index]