RMSE {REEMtree}R Documentation

Compute the root mean squared error of the elements of two vectors

Description

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.

Usage

RMSE(vector1, vector2, subset=NULL)

Arguments

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.

Value

The root mean squared error between the elements of the two vectors included in the subset.

Author(s)

Rebecca Sela rsela@stern.nyu.edu

References

Sela, Rebecca J., and Simonoff, Jeffrey S., “RE-EM Trees: A New Data Mining Approach for Longitudinal Data”.

See Also

PredictionTest

Examples

vec1 <- 1:20 + rnorm(20)
vec2 <- 1:20 + rnorm(20)
RMSE(vec1, vec2)
RMSE(vec1, vec2, subset=c(rep(TRUE, 10), rep(FALSE, 10)))


[Package REEMtree version 1.0 Index]