Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Scilab 5.5.2
Change language to: English - Português - 日本語 - Русский

Please note that the recommended version of Scilab is 6.0.2. This page might be outdated.
See the recommended documentation of this function

mean absolute deviation

Arguments

x

real or complex vector or matrix

Description

This function computes the mean absolute deviation of a real or complex vector or matrix x.

For a vector or matrix x, s2=mad(x) returns in scalar s2 the mean absolute deviation of all the entries of x.

s2=mad(x,'r') (or, equivalently, s2=mad(x,1)) returns in each entry of the column vector s2 the mean absolute deviation of each column of x.

s2=mad(x,'c') (or, equivalently, s2=mad(x,2)) returns in each entry of the column vector s2 the mean absolute deviation of each row of x.

Examples

x  = [2 2 3 4 14];

// Mean absolute deviation of a set of data
// Expected = (|2-5|+|2-5|+|3-5|+|4-5|+|14-5|) / 5 = 3.6

Bibliography

Reference: Wonacott T.H.& Wonacott R.J. .- Introductory Statistics, 5th edition, John Wiley, 1990.