public double DiversityCivilState() { List <double> listeCount = new List <double>(); foreach (CivilState item in Enum.GetValues(typeof(CivilState))) { listeCount.Add(this.employees.Where(x => x.civil_State == item).Count()); } return(Math.Round((KernelDensity.GaussianKernel(1 / Statistics.StandardDeviation(listeCount))) * 100)); }
public double DiversityDisabilities() { List <double> listeCount = new List <double>(); foreach (Disabilities item in Enum.GetValues(typeof(Disabilities))) { listeCount.Add(this.employees.Where(x => x.disabilities == item).Count()); } return(Math.Round((1 - KernelDensity.GaussianKernel(1 / Statistics.StandardDeviation(listeCount))) * 100)); }
public double DiversityAge() { List <double> listeCount = new List <double>(); foreach (Age item in Enum.GetValues(typeof(Age))) { listeCount.Add(this.employees.Where(x => x.age == item).Count()); } var y = Statistics.StandardDeviation(listeCount); return(Math.Round((KernelDensity.GaussianKernel(1 / y)) * 100)); }
public void KDETestGaussianKernelBandwidth1() { //Density of standard normal distribution at 0 AssertHelpers.AlmostEqualRelative(0.398942280401433, KernelDensity.GaussianKernel(0), 10); var estimate = KernelDensity.EstimateGaussian(-3.5d, 1.0d, _testData); AssertHelpers.AlmostEqualRelative(0.004115405028907, estimate, 10); estimate = KernelDensity.EstimateGaussian(0.0d, 1.0d, _testData); AssertHelpers.AlmostEqualRelative(0.310485907659139, estimate, 10); estimate = KernelDensity.EstimateGaussian(2.0d, 1.0d, _testData); AssertHelpers.AlmostEqualRelative(0.099698581377801, estimate, 10); }