RMSE {REEMtree} | R Documentation |
This function finds the difference between corresponding elements of two vectors, finds the mean of the squares of the differences, and then returns the square root. The root mean squared error can also be computed for a subset of the vectors.
RMSE(vector1, vector2, subset=NULL)
vector1 |
Numeric vector of length n |
vector2 |
Numeric vector of length n |
subset |
an optional logical vector indicating the subset of the elements of the vecor that should be used in the fit. All elements are included by default. |
The root mean squared error between the elements of the two vectors included in the subset.
Rebecca Sela rsela@stern.nyu.edu
Sela, Rebecca J., and Simonoff, Jeffrey S., “RE-EM Trees: A New Data Mining Approach for Longitudinal Data”.
vec1 <- 1:20 + rnorm(20) vec2 <- 1:20 + rnorm(20) RMSE(vec1, vec2) RMSE(vec1, vec2, subset=c(rep(TRUE, 10), rep(FALSE, 10)))