Xiaoxing He分享 http://blog.sciencenet.cn/u/hexiaoxing

博文

Chi-square variance test - MATLAB vartest

已有 3404 次阅读 2016-1-9 02:08 |个人分类:Matlab|系统分类:科研笔记

http://cn.mathworks.com/help/stats/chi-square-distribution.html 

Different solutions coming from the……shows a good consistency. Do you mean the results of the chi2 test?),

Chi-Square Distribution

Overview

The chi-square distribution is commonly used in hypothesis testing, particularly the chi-squared test for goodness of fit.

Parameters

The chi-square distribution uses the following parameter.

ParameterDescriptionSupport
νDegrees of freedomν is a nonnegative integer value


Probability Density Function

The probability density function (pdf) is

y=f(xν)=x(ν2)/2ex/22ν2Γ(ν/2)

where Γ( · ) is the Gamma function, ν is the degrees of freedom, and x ≥ 0.

Cumulative Distribution Function

The cumulative distribution function (cdf) is

p=F(xν)=x0t(ν2)/2et/22ν/2Γ(ν/2)dt

where Γ( · ) is the Gamma function, ν is the degrees of freedom, and x ≥ 0.

Descriptive Statistics

The mean is ν.

The variance is 2ν.

Relationship to Other Distributions

The χ2 distribution is a special case of the gamma distribution where b = 2 in the equation for gamma distribution below.

y=f(xa,b)=1baΓ(a)xa1exb

The χ2 distribution gets special attention because of its importance in normal sampling theory. If a set of n observations is normally distributed with variance σ2, and s2 is the sample standard deviation, then

(n1)s2σ2χ2(n1)

This relationship is used to calculate confidence intervals for the estimate of the normal parameter σ2 in the function normfit.

ExamplesCompute Chi-Square Distribution pdf

Compute the pdf of a chi-square distribution with 4 degrees of freedom.

x = 0:0.2:15;y = chi2pdf(x,4);

Plot the pdf.

figure;plot(x,y)

The chi-square distribution is skewed to the right, especially for few degrees of freedom.





https://blog.sciencenet.cn/blog-2985083-949133.html

上一篇:UNAVCO Software
下一篇:Matlab求方差,均值,均方差,协方差的函数
收藏 IP: 59.172.176.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-10-21 02:55

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部