chi2cdf

The chi2cdf function calculates the chi-squared cumulative distribution (CDF).

Synopsis

AQL% SELECT chi2cdf(x,k) FROM array;

Summary 

The chi-squared distribution with k degrees of freedom (DOF) is the distribution of a sum of the squares of independent standard normal random variables x. The chi-squared CDF is:

 

 

where γ is the lower incomplete gamma function, Γ is the Gamma function, and k is the number of degrees of freedom for the system.

Example

Calculate the chi2cdf for System Consisting of Numbers 1–10 with Degree of Freedom 5.

To calculate the chi2cdf for System Consisting of Numbers 1–10 with Degree of Freedom 5, do the following:

  1. Create a 1-dimensional array called system_array of size 10 with chunk size 10 and a double attribute called system:

    AFL% CREATE ARRAY system_array<system:double>[i=0:9];  
  2. Put numerical values of 1–10 into cells of the array:

    AQL% SELECT * 
         INTO system_array 
         FROM build(system_array,i+1/1.0); 
  3. Apply the function chi2cdf to the attribute system:

    AQL% SELECT chi2cdf(system,5)
         INTO target_array 
         FROM system_array;


    The output is:

    {i} expr
    {0} 0.0374342
    {1} 0.150855
    {2} 0.300014
    {3} 0.450584
    {4} 0.58412
    {5} 0.693781
    {6} 0.77936
    {7} 0.843764
    {8} 0.890936
    {9} 0.924765

Inverse 

ichi2cdf: Inverse chi-squared CDF.