Problem 44449. Moving Median Absolute Deviation
The median absolute deviation (MAD) is defined as
MAD = median(abs(A − median(A)))
for a rolling window of length n. For example:
move_mad(1:10, 5)
returns [1 1 1 1 1 1];
move_mad(logspace(0, 1, 10), 3)
returns [0.292 0.377 0.486 0.628 0.811 1.048 1.353 1.748]
Round the result to 3 digits.
Solution Stats
Problem Comments
-
5 Comments
Show
2 older comments
goc3
on 29 Sep 2020
The test suite has had a tolerance applied.
ChrisR
on 3 Jul 2021
The tolerance isn't defined in the test suite.
goc3
on 7 Jul 2021
@ChrisR: the tolerance is hard-coded into the assert lines (1e-3).
Solution Comments
Show commentsProblem Recent Solvers13
Suggested Problems
-
Project Euler: Problem 16, Sums of Digits of Powers of Two
141 Solvers
-
Sum of diagonal of a square matrix
1590 Solvers
-
Flip the main diagonal of a matrix
838 Solvers
-
305 Solvers
-
475 Solvers
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!