anchor.diff:              |> Seq.scan (fun state kv -> (kv.Key, kv.Value + snd state)) (0.,0.)
               |> Seq.find (fun (x,y) -> y >= target)
           x
  -        
   
  +    /// Chooses a random element from this PMF
  +    [<Obsolete("Use 'Empirical.sample' instead")>]
  +    let random pmf = 
  +        sampleFrom pmf
       
       /// Computes the mean of a PMF
       let mean (pmf:Map<float,float>) =
  
positive.code: 
  /// Represents a probability mass function (map from values to probabilities).
  module Empirical =
  
      ///// probability mass function    
      //let create bandwidth data =        
  
negative.code: 
  
      /// Chooses a random element from this PMF
      let sampleFrom (pmf:Map<float,float>) = 
          if pmf.Count <= 0 then raise (System.Exception("Pmf contains no values") )  
          let target = FSharp.Stats.Random.rndgen.NextFloat()
          //pmf |> Seq.map (fun kv -> (kv.Key,kv.Value)) |> Seq.scan (fun state (k,v) -> (k, v + snd state)) (0.,0.)
  