ks test in matlab,ks test - MATLAB等数学软件专版 - 经管之家(原人大经济论坛)

本文详细介绍了如何使用Kolmogorov-Smirnov (K-S) 检验来比较数据集与标准正态分布或其他连续分布的相似性。通过具体的函数调用和参数设置,展示了如何进行单样本K-S检验,包括检验统计量的计算方法及其返回值的含义。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

kstest

One-sample Kolmogorov-Smirnov test

Syntax

h = kstest(x)

h = kstest(x,CDF)

h = kstest(x,CDF,alpha)

h = kstest(x,CDF,alpha,type)

[h,p,ksstat,cv] = kstest(...)

Description

h = kstest(x) performs a Kolmogorov-Smirnov test to compare the values in the data vector x to a standard normal distribution. The null hypothesis is that x has a standard normal distribution. The alternative hypothesis is that x does not have that distribution. The result h is 1 if the test rejects the null hypothesis at the 5% significance level, 0 otherwise.

The test statistic is:

where F(x) is the empirical cdf and G(x) is the standard normal cdf.

h = kstest(x,CDF) compares the distribution of x to the hypothesized continuous distribution defined by CDF, which is either a two-column matrix or a ProbDist object of the ProbDistUnivParam class or ProbDistUnivKernel class. When CDF is a matrix, column 1 contains a set of possible x values, and column 2 contains the corresponding hypothesized cumulative distribution function values G(x). If possible, define CDF so that column 1 contains the values in x. If there are values in x not found in column 1 of CDF, kstest approximates G(x) by interpolation. All values in x must lie in the interval between the smallest and largest values in the first column of CDF. If the second argument is empty ([]), kstest uses the standard normal distribution.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值