anchor.diff:                  let length = (float Wtemp.NumCols)
                   diagVecNew |> Vector.map (fun x -> x / trace * length)
               for i = 0 to xVal.Length - 1 do Wtemp.[i,i] <- finalDiag.[i]
  +            Wtemp
  +        else
  +            let Wtemp = Matrix.create xVal.Length xVal.Length 0.
  +            let cvOfVec =
  +                if yVal.Length%numRep = 0 then
  +                    let length = yVal.Length / numRep 
  +                    let cv = vector [for i = 0 to length-1 do yield yVal.[i*numRep..i*numRep+numRep-1] |> fun g -> max 0. (System.Math.Log((1./(Math.Abs(Seq.cvPopulation g))),2.))(*(1./((Seq.cvPopulation g) + 0.25))*)] //0.25???
  +                    cv
  +                else failwithf "arrLength no multiple of replicate number"
  +            printfn "%A" cvOfVec
  +
  +            
  +            for i = 0 to xVal.Length - 1 do Wtemp.[i,i] <- cvOfVec.[i]
               Wtemp
                   
       let getInitialEstimate (D:Matrix<float>) (H:Matrix<float>) (W:Matrix<float>) (n) (y)= 
  
positive.code:                 let lambdafin = lambd
                  ((efin,gcvmin),afin,lambdafin,cfin)
                      )
          |> unzip4List
          |> fun (x,afin,lambdafin,c) -> ((x |> Array.unzip),afin,lambdafin,c)
          |> fun tmp -> 
              let e = tmp |> fun (a,b,c,d) -> fst a
  
negative.code:         Array.foldBack (fun (a,b,c,d) (accA,accB,accC,accD) -> a::accA, b::accB, c::accC, d::accD) arr ([],[],[],[])
          |> fun (ra,rb,rc,rd) -> Array.ofList ra,Array.ofList rb,Array.ofList rc,Array.ofList rd
      
      let private unzip4 li =
          let length = Seq.length li
          let la = Array.zeroCreate length
          let lb = Array.zeroCreate length
  