Esta página aún no se ha traducido para esta versión. Puede ver la versión más reciente de esta página en inglés.

chi2cdf

Chi-square cumulative distribution function

Sintaxis

p = chi2cdf(x,v)
p = chi2cdf(x,v,'upper')

Description

p = chi2cdf(x,v) computes the chi-square cdf at each of the values in x using the corresponding degrees of freedom in v. x and v can be vectors, matrices, or multidimensional arrays that have the same size. A scalar input is expanded to a constant array with the same dimensions as the other input. The degrees of freedom parameters in v must be positive, and the values in x must lie on the interval [0 Inf].

p = chi2cdf(x,v,'upper') returns the complement of the chi-square cdf at each value in x, using an algorithm that more accurately computes the extreme upper tail probabilities.

The χ2 cdf for a given value x and degrees-of-freedom ν is

p=F(x|ν)=0xt(ν2)/2et/22ν/2Γ(ν/2)dt

where Γ( · ) is the Gamma function.

The chi-square density function with ν degrees-of-freedom is the same as the gamma density function with parameters ν/2 and 2.

Ejemplos

contraer todo

probability = chi2cdf(5,1:5)
probability = 1×5

    0.9747    0.9179    0.8282    0.7127    0.5841

probability = chi2cdf(1:5,1:5)
probability = 1×5

    0.6827    0.6321    0.6084    0.5940    0.5841

Capacidades ampliadas

Generación de código C/C++
Generar código C y C++ utilizando MATLAB® Coder™.

Introducido antes de R2006a