anchor.diff:              h.[idx] <- h.[idx] + 1
       xs |> Seq.iter add
       h
  -//    let h = Histogram(xs, n, min, max)
  -//    Array.init h.BucketCount (fun bi -> int(h.Item(bi).Count))
  -
  -let ridders tolerance (lb, ub) (func : float->float) =
  -    let rec step a fa b fb =
  -        let m = 0.5 * (a+b)
  -        if abs(b-a) < 2.* tolerance then Some m
  -        else
  -            let fm = func m
  -            if sign fa = sign fm
  -            then step m fm b fb
  -            else step a fa m fm
  -        
  -    let flb = func lb
  -    let fub = func ub
  -    if sign flb = sign fub then None
  -    else step lb flb ub fub
  -//    let root = ref 0.0
  -//    if Bisection.TryFindRoot(System.Func<float,float>(func), lb, ub, tolerance, 100, root) then Some(!root) else None
  -
  -let fromRoot defaultRoot root =
  -    match root with | Some(r) -> r | None -> defaultRoot
  -
  +
  +// from http://hackage.haskell.org/package/statistics-0.10.5.0/docs/src/Statistics-Sample-KernelDensity.html#kde
  +//
   // Gaussian kernel density estimator for one-dimensional data, using
   // the method of Botev et al.
   //
  -// NaN in the sample are ignored.
  +// Botev. Z.I., Grotowski J.F., Kroese D.P. (2010). Kernel density estimation via diffusion. 
  +// /Annals of Statistics/ 38(5):2916-2957. <http://arxiv.org/pdf/1011.2602>
   //
   // The result is a pair of vectors, containing:
   //
  
positive.code:         let v = samples.[i]
          samples.[i] <- Complex(scalingFactor * v.Real, scalingFactor * v.Imaginary)
      samples
  let fft (xs:Complex[]) = 
      let samples = Array.copy xs
      Radix2(samples,-1)
  
negative.code:                     if s=1 then h else go (s-1) (f si time) 
              
                  let eq x = x - (len * (2.0 * m_sqrt_pi) * go 6 (f 7.0 x)) ** (-0.4)
                  match bisect 1e-14 (0.0,0.1) eq with Some root -> root | None -> (0.28 * len ** (-0.4))
                  
              let f2 b z = b * exp (sqr z * sqr pi * t_star * (-0.5)) 
              let a2 = Seq.map2 f2 a [| for i in 0..n0-1 do yield fi i |] |> Array.ofSeq
  