统计学,风控建模经常遇到正态分布检验。正态分布检验在金融信贷风控建模中常用于变量校验,让模型具有统计学意义。正态分布检验在生物医药领域也有广泛应用。很多NCBI,Science,Nature等知名平台发布生物医药统计论文参考价值有限,很多论文发布者搞不清楚统计学基本原理,误用统计学检验方法或模型。

这节课我先给大家介绍一下正态分布检验是什么,然后用python代码实现。欢迎各位同学学习我录制的更多相关知识从0到1Python数据科学之旅 :https://edu.csdn.net/combo/detail/1929

目录:

1.Shapiro-Wilk test

样本量小于50

2.normaltest

样本量小于50, normaltest运用了D’Agostino–Pearson综合测试法,每组样本数大于20

3.Lilliefors-test

- for intermediate sample numbers, the Lilliefors-test is good since the original Kolmogorov-Smirnov-test is unreliable when mean and std of the distribution are not known.

4.Kolmogorov-Smirnov(Kolmogorov-Smirnov) test

- the Kolmogorov-Smirnov(Kolmogorov-Smirnov) test should only be used for large sample numbers (>300)

 最新版本代码

# -*- coding: utf-8 -*-
'''
从0到1Python数据科学之旅 :https://edu.csdn.net/combo/detail/1929
讲师csdn学院教学主页:https://edu.csdn.net/lecturer/5602
'''import scipy
from scipy.stats import f
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats
# additional packages
from statsmodels.stats.diagnostic import lilliforsgroup1=[2,3,7,2,6]
group2=[10,8,7,5,10]
group3=[10,13,14,13,15]
list_groups=[group1,group2,group3]
list_total=group1+group2+group3#正态分布测试
def check_normality(testData):#20<样本数<50用normal test算法检验正态分布性if 20<len(testData) <50:p_value= stats.normaltest(testData)[1]if p_value<0.05:print"use normaltest"print "data are not normal distributed"return  Falseelse:print"use normaltest"print "data are normal distributed"return True#样本数小于50用Shapiro-Wilk算法检验正态分布性if len(testData) <50:p_value= stats.shapiro(testData)[1]if p_value<0.05:print "use shapiro:"print "data are not normal distributed"return  Falseelse:print "use shapiro:"print "data are normal distributed"return Trueif 300>=len(testData) >=50:p_value= lillifors(testData)[1]if p_value<0.05:print "use lillifors:"print "data are not normal distributed"return  Falseelse:print "use lillifors:"print "data are normal distributed"return Trueif len(testData) >300: p_value= stats.kstest(testData,'norm')[1]if p_value<0.05:print "use kstest:"print "data are not normal distributed"return  Falseelse:print "use kstest:"print "data are normal distributed"return True#对所有样本组进行正态性检验
def NormalTest(list_groups):for group in list_groups:#正态性检验status=check_normality(group1)if status==False :return False#对所有样本组进行正态性检验
NormalTest(list_groups)

pp-plot和qq-plot结论都很类似。如果数据服从正太分布,生成的点会很好依附在y=x直线上

In all three cases the results are similar: if the two distributions being compared
are similar, the points will approximately lie on the line y D x. If the distributions
are linearly related, the points will approximately lie on a line, but not necessarily
on the line y D x (Fig. 7.1).
In Python, a probability plot can be generated with the command
stats.probplot(data, plot=plt)

https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.probplot.html

a) Probability-Plots

用于可视化评估分布,绘制分位点来比较概率分布

sample quantilies是你的样本原始的数据
sample distribution
In statistics different tools are available for the visual assessments of distributions.
A number of graphical methods exist for comparing two probability distributions by plotting their quantiles, or closely related parameters, against each other:

# -*- coding: utf-8 -*-
#从0到1Python数据科学之旅 :https://edu.csdn.net/combo/detail/1929
#讲师csdn学院教学主页:https://edu.csdn.net/lecturer/5602
import numpy as np
import pylab
import scipy.stats as statsmeasurements = np.random.normal(loc = 20, scale = 5, size=100)
stats.probplot(measurements, dist="norm", plot=pylab)
pylab.show()

7.1 Probability-plot, to
check for normality of a

由于随机产生的100个正态分布点,测试其正太性。概率图显示100个点很好落在y=x直线附近,所以这些数据有很好正态性。

QQPlot(quantile quantile plot)

http://baike.baidu.com/link?url=o9Z7vr6VdvGAtTRO3RYxQbVu56U_XDaSdibPeVcidMJQ7B6LcAUBHcIro4tLf5BSI5Pu-59W4SPNZ-zRFJ8_FgL3dxJLaUdY0JiB2xUmqie

QQPlot图是用于直观验证一组数据是否来自某个分布,或者验证某两组数据是否来自同一(族)分布。在教学和软件中常用的是检验数据是否来自于正态分布。

# -*- coding: utf-8 -*-
#从0到1Python数据科学之旅 :https://edu.csdn.net/combo/detail/1929
#讲师csdn学院教学主页:https://edu.csdn.net/lecturer/5602
import numpy as np
import statsmodels.api as sm
import pylabtest = np.random.normal(0,1, 1000)sm.qqplot(test, line='45')
pylab.show()

QQ图显示1000个点很好落在y=x直线附近,所以这些数据有很好正态性。

验证右图的生成的卡方数据是否服从正太分布,pp-plot图中,很多点没有很好落在y=x直线附近,所以正态性比较差,R**2只有0.796

# -*- coding: utf-8 -*-<br>#author:231469242@qq.com<br>#微信公众号:pythonEducation
#从0到1Python数据科学之旅 :https://edu.csdn.net/combo/detail/1929
#讲师csdn学院教学主页:https://edu.csdn.net/lecturer/5602
from scipy import stats
import matplotlib.pyplot as plt
import numpy as np
nsample = 100
np.random.seed(7654321)ax1 = plt.subplot(221)#A t distribution with small degrees of freedom:
#生成自由度3,样本量100的t分布数据,自由度太小,正态分布性较差
x = stats.t.rvs(3, size=nsample)
res = stats.probplot(x, plot=plt)#A t distribution with larger degrees of freedom:
#自由度大,数据接近正态分布
ax2 = plt.subplot(222)
x2 = stats.t.rvs(25, size=nsample)
res1 = stats.probplot(x2, plot=plt)#A mixture of two normal distributions with broadcasting:
ax3 = plt.subplot(223)
x3 = stats.norm.rvs(loc=[0,5], scale=[1,1.5],size=(nsample/2.,2)).ravel()
res = stats.probplot(x3, plot=plt)#A standard normal distribution:标准正太分布,pp-plot正态性较好
ax4 = plt.subplot(224)
x4 = stats.norm.rvs(loc=0, scale=1, size=nsample)
res = stats.probplot(x4, plot=plt)#Produce a new figure with a loggamma distribution, using the dist and sparams keywords:fig = plt.figure()
ax = fig.add_subplot(111)
x = stats.loggamma.rvs(c=2.5, size=500)
stats.probplot(x, dist=stats.loggamma, sparams=(2.5,), plot=ax)
ax.set_title("Probplot for loggamma dist with shape parameter 2.5")
plt.show()

综合测试法

代码GitHub下载地址

https://github.com/thomas-haslwanter/statsintro_python/tree/master/ISP/Code_Quantlets/07_CheckNormality_CalcSamplesize/checkNormality

In tests for normality, different challenges can arise: sometimes only few samples
may be available, while other times one may have many data, but some extremely
outlying values. To cope with the different situations different tests for normality
have been developed. These tests to evaluate normality (or similarity to some
specific distribution) can be broadly divided into two categories:
1. Tests based on comparison (“best fit”) with a given distribution, often specified
in terms of its CDF. Examples are the Kolmogorov–Smirnov test, the Lilliefors
test, the Anderson–Darling test, the Cramer–von Mises criterion, as well as the
Shapiro–Wilk and Shapiro–Francia tests.
2. Tests based on descriptive statistics of the sample. Examples are the skewness
test, the kurtosis test, the D’Agostino–Pearson omnibus test, or the Jarque–Bera
test.
For example, the Lilliefors test, which is based on the Kolmogorov–Smirnov
test, quantifies a distance between the empirical distribution function of the sample
and the cumulative distribution function of the reference distribution (Fig. 7.3),
or between the empirical distribution functions of two samples. (The original
Kolmogorov–Smirnov test should not be used if the number of samples is ca. 300.)
The Shapiro–Wilk W test, which depends on the covariance matrix between the
order statistics of the observations, can also be used with 50 samples, and has been
recommended by Altman (1999) and by Ghasemi and Zahediasl (2012).
The Python command stats.normaltest(x) uses the D’Agostino–Pearson
omnibus test. This test  combines a skewness and kurtosis test to produce a single,
global “omnibus” statistic.

# -*- coding: utf-8 -*-'''
从0到1Python数据科学之旅 :https://edu.csdn.net/combo/detail/1929
讲师csdn学院教学主页:https://edu.csdn.net/lecturer/5602Graphical and quantitative check, if a given distribution is normal.
- For small sample-numbers (<50), you should use the Shapiro-Wilk test or the "normaltest"
- for intermediate sample numbers, the Lilliefors-test is good since the original Kolmogorov-Smirnov-test is unreliable when mean and std of the distribution
are not known.
- the Kolmogorov-Smirnov(Kolmogorov-Smirnov) test should only be used for large sample numbers (>300)
'''# Copyright(c) 2015, Thomas Haslwanter. All rights reserved, under the CC BY-SA 4.0 International License# Import standard packages
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats
import pandas as pd# additional packages
from statsmodels.stats.diagnostic import lilliforsdef check_normality():'''Check if the distribution is normal.'''# Set the parametersnumData = 1000myMean = 0mySD = 3# To get reproducable values, I provide a seed valuenp.random.seed(1234)  # Generate and show random datadata = stats.norm.rvs(myMean, mySD, size=numData)fewData = data[:100]plt.hist(data)plt.show()# --- >>> START stats <<< ---# Graphical test: if the data lie on a line, they are pretty much# normally distributed_ = stats.probplot(data, plot=plt)plt.show()pVals = pd.Series()pFewVals = pd.Series()# The scipy normaltest is based on D-Agostino and Pearsons test that# combines skew and kurtosis to produce an omnibus test of normality._, pVals['Omnibus']    = stats.normaltest(data)_, pFewVals['Omnibus'] = stats.normaltest(fewData)# Shapiro-Wilk test_, pVals['Shapiro-Wilk']    = stats.shapiro(data)_, pFewVals['Shapiro-Wilk'] = stats.shapiro(fewData)# Or you can check for normality with Lilliefors-test_, pVals['Lilliefors']    = lillifors(data)_, pFewVals['Lilliefors'] = lillifors(fewData)# Alternatively with original Kolmogorov-Smirnov test_, pVals['Kolmogorov-Smirnov']    = stats.kstest((data-np.mean(data))/np.std(data,ddof=1), 'norm')_, pFewVals['Kolmogorov-Smirnov'] = stats.kstest((fewData-np.mean(fewData))/np.std(fewData,ddof=1), 'norm')print('p-values for all {0} data points: ----------------'.format(len(data)))print(pVals)print('p-values for the first 100 data points: ----------------')print(pFewVals)if pVals['Omnibus'] > 0.05:print('Data are normally distributed')# --- >>> STOP stats <<< ---return pVals['Kolmogorov-Smirnov']if __name__ == '__main__':p = check_normality()   print(p)

normaltest

https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.normaltest.html

http://stackoverflow.com/questions/42036907/scipy-stats-normaltest-to-test-the-normality-of-numpy-random-normal

scipy.stats.normaltest运用了D’Agostino–Pearson综合测试法,返回(得分值,p值),得分值=偏态平方+峰态平方

样本量必须大于等于20

UserWarning: kurtosistest only valid for n>=20

If my understanding is correct, it indicates how likely the input data is in normal distribution. I had expected that all the pvalues generated by the above code very close to 1.

Your understanding is incorrect, I'm afraid. The p-value is the probability to get a result that is at least as extreme as the observation under the null hypothesis (i.e. under the assumption that the data is actually normal distributed). It does not need to be close to 1. Usually, p-values greater than 0.05 are considered not significant, which means that normality has not been disproved by the test.

As pointed out by Victor Chubukov, you can get low p-values simply by chance, even if the data is really normally distributed.

Statistical hypothesis testing is rather complex and can appear somewhat counter intuitive. If you need to know more details, Cross Validated is the place to get more detailed answers.

# -*- coding: utf-8 -*-
'''
从0到1Python数据科学之旅 :https://edu.csdn.net/combo/detail/1929
讲师csdn学院教学主页:https://edu.csdn.net/lecturer/5602
样本量必须大于等于20
UserWarning: kurtosistest only valid for n>=20
'''import numpy
from numpy import random
from scipy import statsd = numpy.random.normal(size=1000)
n = stats.normaltest(d)
print (n)
# -*- coding: utf-8 -*-
#从0到1Python数据科学之旅 :https://edu.csdn.net/combo/detail/1929
#讲师csdn学院教学主页:https://edu.csdn.net/lecturer/5602import numpy,scipy
from numpy import random
from scipy import statsfor i in range(0, 10):d = numpy.random.normal(size=50000)n = scipy.stats.normaltest(d)print (n)

H0:样本服从正太分布

p值都大于0.05,H0成立

 Shapiro-Wilk

https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.shapiro.html

#样本数小于50用Shapiro-Wilk算法检验正态分布性

 For small sample-numbers (<50), you should use the Shapiro-Wilk test or the "normaltest"
# -*- coding: utf-8 -*-
#从0到1Python数据科学之旅 :https://edu.csdn.net/combo/detail/1929
#讲师csdn学院教学主页:https://edu.csdn.net/lecturer/5602import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
x = stats.norm.rvs(loc=5, scale=3, size=49)
stats.shapiro(x)
'''
p值大于0.05,H0成立,数据呈现正态分布
Out[9]: (0.9735164046287537, 0.3322194814682007)
'''
plt.hist(x)

Lilliefors-test适用于中等样本数据- for intermediate sample numbers, the Lilliefors-test is good since the original Kolmogorov-Smirnov-test is unreliable when mean and std of the distribution are not known.

In statistics, the Lilliefors test, named after Hubert Lilliefors, professor of statistics at George Washington University, is a normality test based on the Kolmogorov–Smirnov test. It is used to test the null hypothesis that data come from a normally distributed population, when the null hypothesis does not specify which normal distribution; i.e., it does not specify the expected value and variance of the distribution.

statsmodels.stats.diagnostic.lilliefors

  • http://www.statsmodels.org/stable/generated/statsmodels.stats.diagnostic.lilliefors.html

  • statsmodels.stats.diagnostic.lilliefors(xpvalmethod='approx')

  • lilliefors test for normality,

    Kolmogorov Smirnov test with estimated mean and variance

    Parameters:

    x : array_like, 1d

    data series, sample

    pvalmethod : ‘approx’, ‘table’

    ‘approx’ uses the approximation formula of Dalal and Wilkinson, valid for pvalues < 0.1. If the pvalue is larger than 0.1, then the result of table is returned ‘table’ uses the table from Dalal and Wilkinson, which is available for pvalues between 0.001 and 0.2, and the formula of Lilliefors for large n (n>900). Values in the table are linearly interpolated. Values outside the range will be returned as bounds, 0.2 for large and 0.001 for small pvalues.

    Returns:

    ksstat : float

    Kolmogorov-Smirnov test statistic with estimated mean and variance.

    pvalue : float

    If the pvalue is lower than some threshold, e.g. 0.05, then we can reject the Null hypothesis that the sample comes from a normal distribution

    Notes

    Reported power to distinguish normal from some other distributions is lower than with the Anderson-Darling test.

    could be vectorized

# -*- coding: utf-8 -*-
'''
从0到1Python数据科学之旅 :https://edu.csdn.net/combo/detail/1929
讲师csdn学院教学主页:https://edu.csdn.net/lecturer/5602样本量必须大于等于20
UserWarning: kurtosistest only valid for n>=20
'''import numpy
from numpy import random
from statsmodels.stats.diagnostic import lilliforsd = numpy.random.normal(size=200)
n = lillifors(d)
print (n)
'''
(0.047470987201221337, 0.3052490552871156)
'''

Kolmogorov-Smirnov(Kolmogorov-Smirnov) test

https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.kstest.html

#scipy.stats.kstest- the Kolmogorov-Smirnov(Kolmogorov-Smirnov) test should only be used for large sample numbers (>300)

# -*- coding: utf-8 -*-
'''
从0到1Python数据科学之旅 :https://edu.csdn.net/combo/detail/1929
讲师csdn学院教学主页:https://edu.csdn.net/lecturer/5602样本量必须大于等于20
UserWarning: kurtosistest only valid for n>=20
'''import numpy
from numpy import random
from scipy import statsd = numpy.random.normal(size=1000)
n = stats.kstest(d,'norm')
print (n)'''
KstestResult(statistic=0.028620435047503723, pvalue=0.38131540630243177)
'''

K-S检验是以两位苏联数学家Kolmogorov和Smirnov的名字命名的,它是一个拟合优度检验。K-S检验通过对两个分布之间的差异的分析,判断样本的观察结果是否来自制定分布的总体。

  • 数据录入

首先把要分析的数据导入到SPSS软件中,如图所示:

  • 步骤1

点击“分析”,然后选择“非参数检验(N)”,选择“旧对话框”中的“1-样本K-S(1)”,如图所示。

  • 步骤2

这里,我们只对“身高”和“体重”进行检验,所以把两变量导入到“检验变量列表(T)”,如图所示。

  • 步骤3

然后点击“选项”,选择“描述性(D)”,点击“继续”。如图所示。

  • 结果分析

点击“确定”,即可得到以下结果。

由于身高和体重的双侧显著性取值均小于0.10,故否定零假设,即认为初中生的身高和体重不服从正态分布。

1

 

http://www.cnblogs.com/sddai/p/5737408.html

柯尔莫哥洛夫-斯米尔诺夫检验(Колмогоров-Смирнов检验)基于累计分布函数,用以检验两个经验分布是否不同或一个经验分布与另一个理想分布是否不同。

在进行 cumulative probability统计(如下图)的时候,你怎么知道组之间是否有显著性差异?有人首先想到单因素方差分析或双尾检验(2 tailed TEST)。其实这些是不准确的,最好采用Kolmogorov-Smirnov test(柯尔莫诺夫-斯米尔诺夫检验)来分析变量是否符合某种分布或比较两组之间有无显著性差异。

Kolmogorov-Smirnov test原理:寻找最大距离(Distance), 所以常简称为D法。 适用于大样本。 KS test checks if two independent distributions are similar or different, by generating cumulative probability plots for two distributions and finding the distance along the y-axis for a given x values between the two curves. From all the distances calculated for each x value, the maximum distance is searched.

如何分析结果呢?This maximum distance or maximum difference is then plugged into KS probability function to calculate the probability value.  The lower the probability value is the less likely the two distributions are similar.  Conversely, the higher or more close to 1 the value is the more similar the two distributions are.极端情况:如果P值为1的话,说明两给数据基本相同,如果P值无限接近0,说明两组数据差异性极大。

有一个网站可以进行在线的统计,你只需要输入数据就可以了。地址如下:http://www.physics.csbsju.edu/stats/KS-test.n.plot_form.html

当然还有更多的软件支持这个统计,如SPSS,SAS,MiniAnalysis,Clampfit10

根据软件统计出来后给出的结果决定有没有显著性差异,如果D max值>D 0.05。则认为有显著性差异。D 0.05的经验算法:1.36/SQRT(N) 其中SQRT为平方要,N为样本数。D 0.01经验算法1.64/SQRT(N) 。当然最准确的办法还是去查KS检定表。不过大多数软件如CLAMPFIT,MINIANALYSIS统计出来的结果都是直接有P值。根据这个值(alpha=0.05)就可以断定有没有差异了。

在统计学中,柯尔莫可洛夫-斯米洛夫检验基于累计分布函数,用以检验两个经验分布是否不同或一个经验分布与另一个理想分布是否不同。

在进行累计概率(cumulative probability)统计的时候,你怎么知道组之间是否有显著性差异?有人首先想到单因素方差分析或双尾检验(2 tailedTEST)。其实这些是不准确的,最好采用Kolmogorov-Smirnov test(柯尔莫诺夫-斯米尔诺夫检验)来分析变量是否符合某种分布或比较两组之间有无显著性差异。

分类:

1、Single sample Kolmogorov-Smirnov goodness-of-fit hypothesis test.

采用柯尔莫诺夫-斯米尔诺夫检验来分析变量是否符合某种分布,可以检验的分布有正态分布、均匀分布、Poission分布和指数分布。指令如下:

>> H = KSTEST(X,CDF,ALPHA,TAIL) % X为待检测样本,CDF可选:如果空缺,则默认为检测标准正态分布;

如果填写两列的矩阵,第一列是x的可能的值,第二列是相应的假设累计概率分布函数的值G(x)。ALPHA是显著性水平(默认0.05)。TAIL是表示检验的类型(默认unequal,不平衡)。还有larger,smaller可以选择。

如果,H=1 则否定无效假设; H=0,不否定无效假设(在alpha水平上)

例如,

x = -2:1:4
x =
  -2  -1   0   1   2   3   4

[h,p,k,c] = kstest(x,[],0.05,0)
h =
   0
p =
   0.13632
k =
   0.41277
c =
   0.48342

The test fails to reject the null hypothesis that the values come from a standard normal distribution.

2、Two-sample Kolmogorov-Smirnov test

检验两个数据向量之间的分布的。

>>[h,p,ks2stat] = kstest2(x1,x2,alpha,tail)

% x1,x2都为向量,ALPHA是显著性水平(默认0.05)。TAIL是表示检验的类型(默认unequal,不平衡)。

例如,x = -1:1:5
y = randn(20,1);
[h,p,k] = kstest2(x,y)
h =
     0
p =
    0.0774
k =
    0.5214

Kolmogorov–Smirnov test (K–S test)

wiki翻译起来太麻烦,还有可能曲解本意,最好看原版解释。

In statistics, the Kolmogorov–Smirnov test (K–S test) is a form of minimum distance estimation used as a nonparametric test of equality of one-dimensional probability distributions used to compare a sample with a reference probability distribution (one-sample K–S test), or to compare two samples (two-sample K–S test). The Kolmogorov–Smirnov statistic quantifies a distance between theempirical distribution function of the sample and the cumulative distribution function of the reference distribution, or between the empirical distribution functions of two samples. The null distribution of this statistic is calculated under the null hypothesis that the samples are drawn from the same distribution (in the two-sample case) or that the sample is drawn from the reference distribution (in the one-sample case). In each case, the distributions considered under the null hypothesis are continuous distributions but are otherwise unrestricted.

The two-sample KS test is one of the most useful and general nonparametric methods for comparing two samples, as it is sensitive to differences in both location and shape of the empirical cumulative distribution functions of the two samples.

The Kolmogorov–Smirnov test can be modified to serve as a goodness of fit test. In the special case of testing for normality of the distribution, samples are standardized and compared with a standard normal distribution. This is equivalent to setting the mean and variance of the reference distribution equal to the sample estimates, and it is known that using the sample to modify the null hypothesis reduces the power of a test. Correcting for this bias leads to theLilliefors test. However, even Lilliefors' modification is less powerful than the Shapiro–Wilk test or Anderson–Darling test for testing normality.[1]

KS比卡方检验更加简单和方便,但ks用于评估正态分布时,样本量需要大于300

欢迎访问讲师csdn学院教学主页:https://edu.csdn.net/lecturer/5602,学习更多python机器学习模型实战。

Tests for normality正态分布检验(python代码实现)相关推荐

  1. ks检验python代码_如何使用适当的标准化方法从KolmogorovSmirnov测试(ks测试)中获得正确的p_值和ks_值?...

    我正在研究一个财务问题,我要实现一个函数,在每只股票的信号回报率的正态分布之间使用Kolmogorov-Smirnov检验(KS-test).我将对每个股票的信号回报率在正态分布上运行KS测试,对于这 ...

  2. ks检验python代码_python scipy stats.kstest用法及代码示例

    进行Kolmogorov-Smirnov测试是否合身. 这将针对给定的分布G(x)对观察到的随机变量的分布F(x)进行测试.在原假设下,两个分布相同,F(x)= G(x).替代假设可以是" ...

  3. 统计学(一): Z 分数 正态分布 (附 Python 实现代码) --Z 检验先修; Z 分数与正态分布两者关系; Z 分数与百分位数的异同;面试要点(以心理学实验为舟)

    背景介绍   笔者的第一本心理学启蒙教材<西奥蒂尼社会心理学>:揭开了自我.环境.群体之间看不见的影响力." 行为背后的目的到底是什么?" " 目的背后的人和 ...

  4. python实现D‘Agostino‘s K-squared test正态分布检验

    python实现D'Agostino's K-squared test正态分布检验 测试数据样本是否具有高斯分布. 假设条件 每个样本中的观察结果都是独立且均等分布的(iid). 解释 H0:样本具有 ...

  5. python实现Shapiro-Wilk正态分布检验

    python实现Shapiro-Wilk正态分布检验 Shapiro-Wilk检验 Shapiro-Wilk检验等显著性假设检验方法,则从统计学意义上将样本分布与正态分布进行比较,以确定数据是否显示出 ...

  6. python实现Anderson-Darling正态分布检验

    python实现Anderson-Darling正态分布检验 正态性检验 确定您绘制样本所基于的总体是否呈非正态分布的单样本假设检验.许多统计过程均依赖于总体正态性,且使用正态性检验确定否定此假设是不 ...

  7. 检测样本分布是不是正态分布,绘制其正态分布概率图及异常值检测-python代码实现

    根据一份正态分布数据绘制正态分布概率图及异常值检测-python代码实现 当我们拿到一份数据时,想要检测数据概率分布是不是正太分布,一个好的方法是绘制其概率图 这里我们根据自制的数据首先生成一份正太分 ...

  8. python怎么做q检验_统计学_Cochran’s Q Test(python代码实现)

    医药项目统计联系QQ:231469242 cochran Q 测试用于非参数检验,特别是对分,二分 成功或失败 有效或无效 活着或死了 有缺陷的或无缺陷的 python代码 无显著差异,结论一致 # ...

  9. Python实操:正态分布检验

    利用Python检测一组数据是否服从正态分布 内容待补充 参考下文: 正态分布检验之Python实现

  10. 使用python实现正态分布检验

    本次的正态分布检验的数据描述为What's Normal? – Temperature, Gender, and Heart Rate中的数据,其中数据源中包含体温.性别和心率三个数据.这次我们选择文 ...

最新文章

  1. CQRS体系结构模式实践案例:Tiny Library:领域仓储与事件存储
  2. Pandas 中的 concat 函数
  3. php常见的几种排序以及二分法查找
  4. 二叉排序树的中序遍历规律_看懂这篇文章,玩转二叉查找树
  5. (转载)java语言对时间的处理
  6. 2018年第九届蓝桥杯 - 省赛 - C/C++大学B组 - F.递增三元组
  7. 20175212童皓桢 Java实验二-面向对象程序设计实验报告
  8. c语言中数组大小10000,C语言,怎么存一个很大的数,比方说10000的阶乘
  9. [Unity 游戏设计的元素]
  10. 未来机器人哆拉A梦身上的高科技程序应用
  11. 实验八 java多线程操作_20182310实验八实验报告
  12. 知云文献翻译打不开_文献翻译工具-知云文献翻译
  13. 【错误】expected constructor, destructor, or type conversion before '.' token - 第八个游侠的日志 - 网易博客...
  14. Java时间类之间的转换案例——计算自己活了多少天
  15. DirectX 9.0 SDK安装
  16. vs关于_CRT_SECURE_NO_WARNINGS警告说明
  17. MFC总结之CListCtrl用法及技巧
  18. 图论专题考试2 爆零祭
  19. 想下载B站视频却不知如何下手?一文教你爬B站!
  20. 啥是各向同性、各向异性GNN:

热门文章

  1. linux系统基本特点分时,Linux操作系统四个优点.docx
  2. 中班音乐活动 机器人_幼儿园大班音乐活动教案:《机器人》
  3. 异型烟分拣 机器人_细支烟、标准烟共线分拣可行性研究
  4. vs中四点画矩形的算法_实战基于图割算法的木材表面缺陷图像分析
  5. kaggle房价预测特征意思_未来销量预测——Kaggle基础方案(三):特征工程及线下验证划分...
  6. MySQL 5.6版本二进制包多实例安装
  7. 字节对齐 pragma
  8. 对代码更有信心--单元测试工具Mockito简单介绍
  9. linkin大话设计模式--命令模式
  10. 委托解绑的一个小问题