3.5.2.41 rmse


Description

rmse (Root-Mean-Square-Error) function, also called RMSD (Root-Mean-Square-Deviation) calculates the norm of the difference between a pair of datasets, and then the mean of the difference, and returns the square root of the mean.

The RMSE value between a prediction dataset y of n values \{x_1, \ x_2,..., \ x_n\} and an observation dataset x \{y_1, \ y_2,..., \ y_n\}, is given by:

RMSE = \sqrt{\frac{\sum_{i=1}^{n} (y_i-x_i)^2}{n}}

Syntax

double rmse(dataset vobs, dataset vpred)

Parameters

vobs

Input, obsevation vector.

vpred

Input, prediction vector.

Return

Return the root mean square error of vector vobs and vpred.

Note: Missing data, masked data and text in vobs and vpred won't be counted.

Example

//Calculate the root mean square error of column A and B.
yr = rmse(col(A),col(B));

See Also

mae, mbe, rms