Sample variance and sample standard deviation
1. Definition: The sum of squares of the differences between each data and the average sample in the sample is called the sample variance, and the arithmetic square root of the sample variance is called the sample standard deviation.
Note: Both the sample variance and the sample standard deviation measure the fluctuation size of a sample. The larger the sample variance or sample standard deviation, the larger the fluctuation of the sample data.
Standard deviation andStandard variance
1. Definition: variance is the mean of the sum of squares of the differences between each data and the average. In probability theory and mathematical statistics, variance is used to measure the deviation between a random variable and its mathematical expectation (mean. Standard deviation is most often used as a measure of Statistical Distribution in probability statistics. The standard deviation is defined as the arithmetic square root of variance, reflecting the degree of discretization between individuals in the group.
Weighted average
1. Definition: weighted average is the average of different proportions of data, that is, the original data is calculated according to a reasonable proportion.
The algorithm code is as follows:
StandardDeviation( IList<> (source == ArgumentNullException( (source.Count == variance = SampleStandardDeviation( IList<> (source == ArgumentNullException( (source.Count == || source.Count == variance = Variance( IList<> (source == ArgumentNullException( (source.Count == count = deviation = deviation / SampleVariance( IList<> (source == ArgumentNullException( (source.Count == || source.Count == count = deviation = deviation / (count - WeightedAverage( IList<> source, IList<> (source == ArgumentNullException( (source.Count != ArgumentException( (source.Count == sum = (sum == weight = ( index = ; index < factors.Count; index+++= source[index] * (factors[index] / weight CalculateDeviation(IList<> source, avg = deviation = ( index = ; index < count; index+++= (source[index] - avg) * (source[index] -
The above is widely used in finance .....