■ 표준 편차 구하기

----------------------------------------------------------------------------------------------------

using System;

using System.Collections.Generic;

 

#region 표준 편차 구하기 - GetStandardDeviation(valueList, average)

 

/// <summary>

/// 표준 편차 구하기

/// </summary>

/// <param name="valueList">값 리스트</param>

/// <param name="average">평균</param>

/// <returns>표준 편차</returns>

public static double GetStandardDeviation(List<double> valueList, double average)

{

    double variance = 0d;

 

    foreach(double value in valueList)

    {

        variance += Math.Pow(value - average, 2);

    }

 

    return Math.Sqrt(variance / valueList.Count);

}

 

#endregion

----------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요