UNPKG

862 BMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function mad
4
5Compute the median absolute deviation of a matrix or a list with values.
6The median absolute deviation is defined as the median of the absolute
7deviations from the median.
8
9
10## Syntax
11
12```js
13math.mad(a, b, c, ...)
14math.mad(A)
15```
16
17### Parameters
18
19Parameter | Type | Description
20--------- | ---- | -----------
21`array` | Array &#124; Matrix | A single matrix or multiple scalar values.
22
23### Returns
24
25Type | Description
26---- | -----------
27* | The median absolute deviation.
28
29
30## Examples
31
32```js
33math.mad(10, 20, 30) // returns 10
34math.mad([1, 2, 3]) // returns 1
35math.mad([[1, 2, 3], [4, 5, 6]]) // returns 1.5
36```
37
38
39## See also
40
41[median](median.md),
42[mean](mean.md),
43[std](std.md),
44[abs](abs.md)