It calculates the maximum over consecutive elements centered within a
specified window.
For each index i, it considers a window of length points centered around i.
When length is odd, the center falls exactly on i and the window extends
equally to both sides.
When length is even, the window extends one less point to the left than to
the right and the rolling max is not exactly centered.
Values near the start of the series use windows with fewer than length
data points if there are not enough preceding elements to form a full window.
Similarly for values at the end.