itcdf

The itcdf function calculates the inverse student's t cumulative distribution function (CDF).

Synopsis

itcdf(prob,degrees_of_freedom)

Summary

The student's t-CDF represents the probability p that a single observation from the t-distribution with ν degrees of freedom will fall in the interval [−∞, x). Thus the inverse student's t-CDF returns x, given p and ν.

Example

 

  1. Create a 1-dimensional array of size 10 filled with values from 0.5 to 9.5.

    AFL% store(build(<x:double>[i=0:9], i+1/2.0), inputs);

    The output is:

    {i} x
    {0} 0.5
    {1} 1.5
    {2} 2.5
    {3} 3.5
    {4} 4.5
    {5} 5.5
    {6} 6.5
    {7} 7.5
    {8} 8.5
    {9} 9.5
  2. Apply the tcdf function to the attribute x for 4 degrees of freedom and store the result in array probabilities:

    AFL% store(apply(inputs, t_4d, tcdf(x, 4)), probabilities);


    The output is:

    {i} x,t_4d
    {0} 0.5,0.678335
    {1} 1.5,0.896
    {2} 2.5,0.966617
    {3} 3.5,0.987552
    {4} 4.5,0.994589
    {5} 5.5,0.997336
    {6} 6.5,0.998555
    {7} 7.5,0.999155
    {8} 8.5,0.999475
    {9} 9.5,0.999657
  3. Apply the inverse student's t function:

    AFL% apply(probabilities, inverse, itcdf(t_4d, 4));


    The output is:

    {i} x,t_4d,inverse
    {0} 0.5,0.678335,0.5
    {1} 1.5,0.896,1.5
    {2} 2.5,0.966617,2.5
    {3} 3.5,0.987552,3.5
    {4} 4.5,0.994589,4.5
    {5} 5.5,0.997336,5.5
    {6} 6.5,0.998555,6.5
    {7} 7.5,0.999155,7.5
    {8} 8.5,0.999475,8.5
    {9} 9.5,0.999657,9.5
  4. Remove the example arrays:

    AFL% remove(inputs); remove(probabilities);