anchor.diff:    // end moving window functions
   
     // Helps create an expanding window calculation
  -  //   minObs is the minimum number of observations 
  +  //   winSz is the minimum window size
     //   fupdate takes the current state and incoming observation to the next state
     //   ftransf takes the current state to the current output
     let internal expandingWindowFn winSz initState fupdate ftransf (source: seq<_>) =
       source 
       |> Seq.scan fupdate initState 
  -    |> Seq.skip winSz
       |> Seq.map ftransf 
   
     // Knuth/Welford algorithm for online stats updating
  -  // ref: http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#On-line_algorithm            
  +  // see: http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#On-line_algorithm            
     type Moments = { 
       nobs : float 
       sum  : float 
  
positive.code:              state := fupdate !state curr outg
             yield !state |> ftransf
           else 
             r := (!r - 1) }
  
    type Sums = { nobs: float; sum: float; sump2: float; sump3: float; sump4: float }
  
  
negative.code:   let internal applyMovingStatsTransform moment winSz minObs (proj: Sums -> float) series =
      checkWinSz winSz minObs
      let filtProj s = if (int s.nobs) >= minObs then Some(proj s) else None
      let calcDense = movingWindowFn winSz (initSumsDense moment) (updateSumsDense moment) proj nan
      let calcSparse = movingWindowFn winSz (initSumsSparse moment) (updateSumsSparse moment) filtProj None
      applySeriesProj calcDense calcSparse series
  
    let internal variance s =
      let v = (s.nobs * s.sump2 - s.sum * s.sum) / (s.nobs * s.nobs - s.nobs) 
  