Description | The vector X is analyzed. If the elements are in strict descending order, −1 is returned; if they are either constant or in strict ascending order, +1 is returned. Otherwise the return value is 0. If X contains passages that are increasing as well as passages that remain at a constant value, X is regarded as monotonous only if the increasing passage follows the constant passage, but not the other way round. Thus, the series 0, 0, 0, 1, 2, 3 will be accepted as monotonous (return value +1), whereas the series 1, 2, 3, 4, 4, 4 will not (return value 0). Also the initially constant, then falling series 0, 0, 0, −1, -2, -3 will not be regarded as monotonous. |
|