Skip to main content
. Author manuscript; available in PMC: 2009 Sep 21.
Published in final edited form as: Int J Comput Biol Drug Des. 2008 Jan 1;1(4):368–395. doi: 10.1504/IJCBDD.2008.022208

Algorithm 4.

Moving Window Smoothing

  1. Let x1x2, ≤ … ≤ xn be the n ordered data points, with corresponding intensity measurements y1y2 ≤ … ≤yn.

  2. Let w ≥ 0 be the window size, which defines the neighborhood about the data point.

  3. for i = 1 to n do

  4. Let l = max(l,iw) be the left boundary of the window.

  5. Let r = min(n,i + w) be the right boundary of the window.

  6. Let f(·) be the smoothing function. For the mean, this would be

    f(x)=1rl+1j=lrxj

    and for the median this would be

    f(x)={x(rl+1)/2+1,(rl+1)odd,12(x(rl+1)/2+x(rl+1)/2+1),(rl+1)even,

    where [·] denotes the floor function.

  7. Compute the estimate ŷj = f(xj).

  8. end for