1 |
|
2 |
|
3 | # Function mad
|
4 |
|
5 | Compute the median absolute deviation of a matrix or a list with values.
|
6 | The median absolute deviation is defined as the median of the absolute
|
7 | deviations from the median.
|
8 |
|
9 |
|
10 | ## Syntax
|
11 |
|
12 | ```js
|
13 | math.mad(a, b, c, ...)
|
14 | math.mad(A)
|
15 | ```
|
16 |
|
17 | ### Parameters
|
18 |
|
19 | Parameter | Type | Description
|
20 | --------- | ---- | -----------
|
21 | `array` | Array | Matrix | A single matrix or multiple scalar values.
|
22 |
|
23 | ### Returns
|
24 |
|
25 | Type | Description
|
26 | ---- | -----------
|
27 | * | The median absolute deviation.
|
28 |
|
29 |
|
30 | ## Examples
|
31 |
|
32 | ```js
|
33 | math.mad(10, 20, 30) // returns 10
|
34 | math.mad([1, 2, 3]) // returns 1
|
35 | math.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)
|