Monetary_server/Monetary_server/GaussHandler.cs
/// <summary>
/// This methond calculates the simple reaction time (SRT)
/// </summary>
/// <param name="results"></param>
This methond calculates the simple reaction time (SRT)
This methond calculates the simple reaction time ( SRT )
public static double GetAcceptableReationTime(double[] results)
        {
            double mean = 0;
            var valid = 0;
            foreach (var result in results)
            {
                if (result < 0) continue;
                mean += result;
                valid++;
            }
            if (valid == 0)
                return double.MaxValue;
            mean /= valid;
            double sumOfSquaresOfDifferences = 0;
            foreach (var result in results)
            {
                if (result < 0) continue;
                sumOfSquaresOfDifferences += Math.Pow(result - mean, 2);
            }
            double stDev = Math.Sqrt(sumOfSquaresOfDifferences / valid);
            return Z * stDev + mean;
        }
public static double GetAcceptableReationTime ( double [ ] results ) { double mean = 0 ; var valid = 0 ; foreach ( var result in results ) { if ( result < 0 ) continue ; mean += result ; valid ++ ; } if ( valid == 0 ) return double . MaxValue ; mean /= valid ; double sumOfSquaresOfDifferences = 0 ; foreach ( var result in results ) { if ( result < 0 ) continue ; sumOfSquaresOfDifferences += Math . Pow ( result - mean , 2 ) ; } double stDev = Math . Sqrt ( sumOfSquaresOfDifferences / valid ) ; return Z * stDev + mean ; }
This methond calculates the simple reaction time (SRT)
This methond calculates the simple reaction time ( SRT )
results
double[]
None