Độ lệch chuẩn là gì?
Độ lệch chuẩn là một số mô tả cách trải rộng các giá trị.
Độ lệch chuẩn thấp có nghĩa là hầu hết các số gần với giá trị trung bình [trung bình].
Độ lệch chuẩn cao có nghĩa là các giá trị được trải ra trên phạm vi rộng hơn.
Ví dụ: Lần này chúng tôi đã đăng ký tốc độ 7 xe:
speed = [86,87,88,86,87,85,86]
Độ lệch chuẩn là:
0.9
Có nghĩa là hầu hết các giá trị nằm trong phạm vi 0,9 từ giá trị trung bình, là 86,4.
Chúng ta hãy làm tương tự với lựa chọn các số có phạm vi rộng hơn:
speed = [32,111,138,28,59,77,97]
Độ lệch chuẩn là:
37.85
Có nghĩa là hầu hết các giá trị nằm trong phạm vi 0,9 từ giá trị trung bình, là 86,4.
Chúng ta hãy làm tương tự với lựa chọn các số có phạm vi rộng hơn:
Có nghĩa là hầu hết các giá trị nằm trong phạm vi 37,85 từ giá trị trung bình, là 77,4.
Như bạn có thể thấy, độ lệch chuẩn cao hơn cho thấy các giá trị được trải ra trên phạm vi rộng hơn.
Mô -đun Numpy có một phương pháp để tính độ lệch chuẩn:
Thí dụ
Sử dụng phương pháp Numpy
Standard Deviation of the sample is 1.58113883008418980 để tìm độ lệch chuẩn:
Nhập khẩu Numpy
print[x]
Tốc độ = [86,87,88,86,87,85,86]
x = numpy.std [tốc độ]
Thí dụ
Sử dụng phương pháp Numpy
Standard Deviation of the sample is 1.58113883008418980 để tìm độ lệch chuẩn:
Nhập khẩu Numpy
print[x]
Tốc độ = [86,87,88,86,87,85,86]
x = numpy.std [tốc độ]
Hãy tự mình thử »
Thí dụ
Tốc độ = [32,111,138,28,59,77,97]
Phương sai
Phương sai là một số khác cho biết cách trải rộng các giá trị như thế nào.
Standard Deviation of the sample is 1.58113883008418981
Trong thực tế, nếu bạn lấy căn bậc hai của phương sai, bạn sẽ có được độ lệch chuẩn!
Standard Deviation of the sample is 1.58113883008418982
Hoặc cách khác, nếu bạn tự nhân lên độ lệch chuẩn, bạn sẽ nhận được phương sai!
Để tính toán phương sai bạn phải làm như sau:
Standard Deviation of the sample is 1.58113883008418984
Standard Deviation of the sample is 1.58113883008418985
Standard Deviation of the sample is 1.58113883008418986
Standard Deviation of the sample is 1.58113883008418987
Standard Deviation of the sample is 1.58113883008418988
Standard Deviation of the sample is 1.58113883008418989
1. Tìm ý nghĩa:
2. Đối với mỗi giá trị: Tìm sự khác biệt so với giá trị trung bình:
3. Đối với mỗi sự khác biệt: Tìm giá trị vuông:
x = numpy.std [tốc độ]
Hãy tự mình thử »
Thí dụ
Sử dụng phương pháp Numpy
Standard Deviation of the sample is 1.58113883008418980 để tìm độ lệch chuẩn:
Nhập khẩu Numpy
print[x]
Tốc độ = [86,87,88,86,87,85,86]
x = numpy.std [tốc độ]
Hãy tự mình thử »
Thí dụ
Tốc độ = [32,111,138,28,59,77,97]
Như bạn có thể thấy, độ lệch chuẩn cao hơn cho thấy các giá trị được trải ra trên phạm vi rộng hơn.
Mô -đun Numpy có một phương pháp để tính độ lệch chuẩn:
Thí dụ
Sử dụng phương pháp Numpy
Standard Deviation of the sample is 1.58113883008418980 để tìm độ lệch chuẩn:
Nhập khẩu Numpy
print[x]
Tốc độ = [86,87,88,86,87,85,86]
x = numpy.std [tốc độ]
Hãy tự mình thử »σ
Thí dụσ2
Tốc độ = [32,111,138,28,59,77,97]
Phương sai
Mô -đun thống kê trong Python cung cấp một hàm được gọi là stdev [], có thể được sử dụng để tính độ lệch chuẩn. Chức năng stdev [] chỉ tính toán độ lệch chuẩn từ một mẫu dữ liệu, thay vì toàn bộ dân số. & NBSP;stdev[] , which can be used to calculate the standard deviation. stdev[] function only calculates standard deviation from a sample of data, rather than an entire population.
Để tính độ lệch chuẩn của toàn bộ dân số, một hàm khác được gọi là pstdev [] được sử dụng. & Nbsp;pstdev[] is used.
Độ lệch chuẩn là một thước đo của sự lây lan trong thống kê. Nó được sử dụng để định lượng thước đo của sự lan truyền, biến thể của một tập hợp các giá trị dữ liệu. Nó rất giống với phương sai, đưa ra thước đo độ lệch trong khi phương sai cung cấp giá trị bình phương. Bộ được trải ra ngoài giá trị trung bình trung bình của chúng. Một thuộc tính hữu ích của độ lệch chuẩn là, không giống như phương sai, nó được biểu thị bằng cùng một đơn vị với dữ liệu. & NBSP; is a measure of spread in Statistics. It is used to quantify the measure of spread, variation of a set of data values. It is very much similar to variance, gives the measure of deviation whereas variance provides the squared value.
A low measure of Standard Deviation indicates that the data are less spread out, whereas a high value of Standard Deviation shows that the data in a set are spread apart from their mean average
values. A useful property of the standard deviation is that, unlike the variance, it is expressed in the same units as the data.
Standard Deviation is calculated by :where x1, x2, x3.....xn are observed values in sample data,is the mean value of observations and N is the number of sample observations.
Cú pháp: Stdev [[Data-Set], Xbar] tham số: & nbsp; [Data]: Một số có thể có số có giá trị thực. Độ lệch của các giá trị được truyền dưới dạng tham số. Exexceptions: & nbsp; StatisticerError được nâng lên cho dữ liệu-set nhỏ hơn 2 giá trị được truyền dưới dạng tham số. -Set. & nbsp; & nbsp; stdev[ [data-set], xbar ]
Parameters :
[data] : An iterable with real valued numbers.
xbar [Optional]: Takes actual mean of data-set as value.
Returnype : Returns the actual standard deviation of the values passed as parameter.
Exceptions :
StatisticsError is raised for data-set less than 2 values passed as parameter.
Impossible/precision-less values when the value provided as xbar doesn’t match actual mean of the data-set.
Mã số 1: & nbsp; & nbsp;
Python3
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725254
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725255
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725256
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725257
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725258
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725259____________
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.51
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.5030 ____33____________
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.55________________
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.57
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.58
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.59
Standard Deviation of Sample set is 0.60470378423379060
Standard Deviation of Sample set is 0.60470378423379061
Standard Deviation of Sample set is 0.60470378423379062
Standard Deviation of Sample set is 0.60470378423379063
Standard Deviation of Sample set is 0.60470378423379064
Đầu ra: & nbsp;
Standard Deviation of the sample is 1.5811388300841898
Mã số 2: Trình diễn stdev [] trên một tập hợp các loại dữ liệu khác nhau & nbsp; & nbsp; Demonstrate stdev[] on a varying set of data types
Python3
Standard Deviation of Sample set is 0.60470378423379065
Standard Deviation of Sample set is 0.60470378423379066
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725254
Standard Deviation of Sample set is 0.60470378423379068
Standard Deviation of Sample set is 0.60470378423379065
Traceback [most recent call last]: File "/home/f921f9269b061f1cc4e5fc74abf6ce10.py", line 12, in print[statistics.stdev[sample]] File "/usr/lib/python3.5/statistics.py", line 617, in stdev var = variance[data, xbar] File "/usr/lib/python3.5/statistics.py", line 555, in variance raise StatisticsError['variance requires at least two data points'] statistics.StatisticsError: variance requires at least two data points0
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725254
Traceback [most recent call last]: File "/home/f921f9269b061f1cc4e5fc74abf6ce10.py", line 12, in print[statistics.stdev[sample]] File "/usr/lib/python3.5/statistics.py", line 617, in stdev var = variance[data, xbar] File "/usr/lib/python3.5/statistics.py", line 555, in variance raise StatisticsError['variance requires at least two data points'] statistics.StatisticsError: variance requires at least two data points2
Traceback [most recent call last]: File "/home/f921f9269b061f1cc4e5fc74abf6ce10.py", line 12, in print[statistics.stdev[sample]] File "/usr/lib/python3.5/statistics.py", line 617, in stdev var = variance[data, xbar] File "/usr/lib/python3.5/statistics.py", line 555, in variance raise StatisticsError['variance requires at least two data points'] statistics.StatisticsError: variance requires at least two data points3
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725257
Standard Deviation of Sample set is 0.60470378423379060
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725259____________
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.51
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.50
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.57
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.50
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.55
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.50
Standard Deviation of Sample set is 0.6047037842337906444 ____30666
Các
E
Standard Deviation of the sample is 1.581138830084189813
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725257
Standard Deviation of Sample set is 0.60470378423379060
Standard Deviation of the sample is 1.581138830084189816
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.50
Standard Deviation of the sample is 1.581138830084189818
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.50 ____
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.59
Standard Deviation of Sample set is 0.60470378423379060
Standard Deviation of the sample is 1.581138830084189828
Standard Deviation of the sample is 1.581138830084189829
Standard Deviation of Sample set is 0.60470378423379063
Standard Deviation of the sample is 1.581138830084189831
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.59
Standard Deviation of Sample set is 0.60470378423379060
Standard Deviation of the sample is 1.581138830084189834
Standard Deviation of the sample is 1.581138830084189829
Standard Deviation of Sample set is 0.60470378423379063
Standard Deviation of the sample is 1.581138830084189837
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.59
Standard Deviation of Sample set is 0.60470378423379060
Standard Deviation of the sample is 1.581138830084189840
Standard Deviation of the sample is 1.581138830084189829
Standard Deviation of Sample set is 0.60470378423379063
Standard Deviation of the sample is 1.581138830084189843
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.59
Standard Deviation of Sample set is 0.60470378423379060
Standard Deviation of the sample is 1.581138830084189846
Standard Deviation of the sample is 1.581138830084189829
Standard Deviation of Sample set is 0.60470378423379063
Standard Deviation of the sample is 1.581138830084189849
Đầu ra: & nbsp;
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.41967844833872525
Mã số 2: Trình diễn stdev [] trên một tập hợp các loại dữ liệu khác nhau & nbsp; & nbsp;Demonstrate the difference between results of variance[] and stdev[]
Python3
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725254
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725255
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725256
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725257
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725258
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725259____________
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.51
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.5030 ____33____________
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.55________________
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.57
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.58
Standard Deviation of Sample set is 0.60470378423379062
Standard Deviation of Sample set is 0.60470378423379063
Standard Deviation of Sample set is 0.60470378423379064
Standard Deviation of the sample is 1.581138830084189868
Standard Deviation of Sample set is 0.60470378423379063
Standard Deviation of Sample set is 0.60470378423379064
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.59
Standard Deviation of Sample set is 0.60470378423379060
Standard Deviation of the sample is 1.581138830084189873
Standard Deviation of the sample is 1.581138830084189874
Standard Deviation of Sample set is 0.60470378423379063
Standard Deviation of the sample is 1.581138830084189876
Đầu ra: & nbsp;
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.5
Mã số 2: Trình diễn stdev [] trên một tập hợp các loại dữ liệu khác nhau & nbsp; & nbsp; Demonstrate the use of xbar parameter
Python3
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725254
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725255
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725256
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725257
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725258
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725259____________
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.51
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.5030 ____33____________
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.55________________
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.57
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.58
Standard Deviation of Sample set is 0.60470378423379062
Standard Deviation of Sample set is 0.60470378423379063
Standard Deviation of Sample set is 0.60470378423379064
Đầu ra: & nbsp;
Mã số 2: Trình diễn stdev [] trên một tập hợp các loại dữ liệu khác nhau & nbsp; & nbsp;
Đầu ra: & nbsp;
Standard Deviation of Sample set is 0.6047037842337906
Mã số 5: Thể hiện StatisticerRor & nbsp; & nbsp; Demonstrates StatisticsError
Python3
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725254
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725255
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725256
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725257
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725258
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.419678448338725259
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.58
Standard Deviation of the sample is 1.5811388300841898 Variance of the sample is 2.59
The Standard Deviation of Sample1 is 3.9761191895520196 The Standard Deviation of Sample2 is 1.8708286933869707 The Standard Deviation of Sample3 is 7.8182478855559445 The Standard Deviation of Sample4 is 0.4196784483387252513
Đầu ra: & nbsp;
Traceback [most recent call last]: File "/home/f921f9269b061f1cc4e5fc74abf6ce10.py", line 12, in print[statistics.stdev[sample]] File "/usr/lib/python3.5/statistics.py", line 617, in stdev var = variance[data, xbar] File "/usr/lib/python3.5/statistics.py", line 555, in variance raise StatisticsError['variance requires at least two data points'] statistics.StatisticsError: variance requires at least two data points
Ứng dụng: & nbsp; & nbsp;
- Độ lệch chuẩn là rất cần thiết trong lĩnh vực toán học thống kê và nghiên cứu thống kê. Nó thường được sử dụng để đo lường sự tự tin trong các tính toán thống kê. Ví dụ, biên độ sai số trong tính toán các dấu của bài kiểm tra được xác định bằng cách tính độ lệch chuẩn dự kiến trong kết quả nếu cùng một bài kiểm tra được tiến hành nhiều lần.
- Nó rất hữu ích trong lĩnh vực nghiên cứu tài chính cũng như nó giúp xác định biên lợi nhuận và lỗ. Độ lệch chuẩn cũng rất quan trọng, trong đó độ lệch chuẩn về tỷ lệ hoàn vốn đầu tư là thước đo sự biến động của khoản đầu tư.