Skip to content

Commit

Permalink
movmad: Correct docstring and BIST details missed in 6403d1525ef6 (bu…
Browse files Browse the repository at this point in the history
…g #66156)

* movmad.m: Correct nancond docstring description from movmax to movmad.  Change bug
number flag in BISTs to indicate nancond bugs are resolved.
  • Loading branch information
NRJank committed Sep 26, 2024
1 parent d3c56dc commit 4f7470b
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions scripts/statistics/movmad.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@
##
## If the optional argument @var{dim} is given, operate along this dimension.
##
## The optional argument @var{nancond} is a string that controls how @code{NaN}
## and @code{NA} values affect the output of @qcode{"movmax"}. The value
## @qcode{"includenan"} causes @code{NaN} and @code{NA} values to be
## included in the moving window, and any window slice containing @code{NaN} or
## @code{NA} values will return @code{NaN} for that element. The value
## @qcode{"omitnan"} (default) causes @qcode{"movmax"} to ignore any @code{NaN}
## or @code{NA} values resulting in fewer elements being used to calculate the
## maximum for that window slice. If @qcode{"omitnan"} is specified and a
## window slice contains all @code{NaN} or @code{NA} values, @qcode{"movmax"}
## returns @code{NaN} for that element. The values @qcode{"includemissing"} and
## @qcode{"omitmissing"} may be used synonymously with @qcode{"includenan"} and
## @qcode{"omitnan"}, respectively.
## The optional argument @var{nancond} is a string that controls how
## @code{NaN} and @code{NA} values affect the output of @qcode{"movmad"}. The
## value @qcode{"includenan"} causes @code{NaN} and @code{NA} values to be
## included in the moving window, and any window slice containing @code{NaN}
## or @code{NA} values will return @code{NaN} for that element. The value
## @qcode{"omitnan"} (default) causes @qcode{"movmad"} to ignore any
## @code{NaN} or @code{NA} values resulting in fewer elements being used to
## calculate the mad for that window slice. If @qcode{"omitnan"} is specified
## and a window slice contains all @code{NaN} or @code{NA} values,
## @qcode{"movmad"} returns @code{NaN} for that element. The values
## @qcode{"includemissing"} and @qcode{"omitmissing"} may be used synonymously
## with @qcode{"includenan"} and @qcode{"omitnan"}, respectively.
##
## The calculation can be controlled by specifying @var{property}/@var{value}
## pairs. Valid properties are @qcode{"Endpoints"} and
Expand Down Expand Up @@ -97,9 +97,9 @@

%!assert <*55241> (movmad ((1:10).', 3), [0.5; repmat(2/3, 8, 1); 0.5], eps)

%!assert <66156> (movmad ([1:4, NaN(1,3), 8:10], 3), movmad ([1:4, NaN(1,3), 8:10], 3, "includenan"))
%!assert <66156> (movmad ([1:4, NaN(1,3), 8:10], 3, "includenan"), [1/2, 2/3, 2/3, NaN(1,5), 2/3, 1/2], eps)
%!assert <66156> (movmad ([1:4, NaN(1,3), 8:10], 3, "omitnan"), [1/2, 2/3, 2/3, 1/2, 0, NaN, 0, 1/2, 2/3 1/2], eps)
%!assert <*66156> (movmad ([1:4, NaN(1,3), 8:10], 3), movmad ([1:4, NaN(1,3), 8:10], 3, "includenan"))
%!assert <*66156> (movmad ([1:4, NaN(1,3), 8:10], 3, "includenan"), [1/2, 2/3, 2/3, NaN(1,5), 2/3, 1/2], eps)
%!assert <*66156> (movmad ([1:4, NaN(1,3), 8:10], 3, "omitnan"), [1/2, 2/3, 2/3, 1/2, 0, NaN, 0, 1/2, 2/3 1/2], eps)


## Test input validation
Expand Down

0 comments on commit 4f7470b

Please sign in to comment.