anchor.diff:                              |> Seq.map (fun (t,s) -> t * s / (s + w))
                               |> Seq.medianAbsoluteDev                            
                               )
  -                        |> Seq.toArray                                            
  +                        |> Seq.toArray  
  +                        |> Array.map (fun (x) ->if nan.Equals(x) then 100. else x)
                       k, Seq.stDev mads / Array.median mads
                       )
  -                                
  -            let pMinCvSd = cvSd |> Array.minBy snd |> fst // kleinste oder größte quantile mit kleinster cv
  -            Quantile.InPlace.modeInPLace pMinCvSd si
  + 
  +            let pMinCvSd = cvSd |> Array.minBy snd |> fst 
  +            Quantile.InPlace.modeInPLace pMinCvSd si'
   
   
           /// Estimates s0 from given data set. Chosen to minimize the coefficient of variation of the test statistics 
  
positive.code:                         cur |> Array.minBy (fun (dis,deis,delta)-> delta )
                  x,y)
          
          let cutsFromUp  = cuts ups los |> Array.map (fun (a,b) -> getDi a, getDi b )
  
          let cutsFromLow = cuts los ups |> Array.map (fun (a,b) -> getDi b, getDi a )
          [|cutsFromUp;cutsFromLow|]|> Array.concat |> Array.distinct
          
  
  
negative.code:                 ups.[i] <- replaceDeltaAbs ups.[i] ups.[i-1]
                  
          // monoton increase los (inplace)
          let los' = los |> Array.map (fun (a,b,c) -> a,b, abs c)
          for i=1 to los'.Length-1 do
              if getDelta los'.[i] > getDelta los'.[i-1] then
                  los'.[i] <- replaceDeltaAbs los'.[i] los.[i-1]
          // find the matching cutoffs
          let cuts set1 set2=
              set1
              |> Array.map (fun x -> 
                  let cur =
                      set2
                      |> Array.filter (fun (dis,deis,delta) -> delta >= (getDelta x) )
  