Rms

Description

rms function returns the root mean square of a vector.

The rms value for a set of n values \{x_1, \ x_2,..., \ x_n\} is given by:

x_{\mathrm{rms}}=\sqrt{ \frac{ \sum_{i=1}^{n} x_i^2 }{n} }

Syntax

double rms(dataset vd)

Parameters

vd

Input vector to calculate

Return

Return the root mean square of a vector.

Note: Missing values in vd won't be counted.

Example

//Calculate the root mean square of a vector.
yr = rms(col(A));

See Also

Ss, StdDev, StdDevP