Exemplo n.º 1
0
    public static void chi_square_noncentral_cdf_values_test()
    //****************************************************************************80
    //
    //  Purpose:
    //
    //    CHI_SQUARE_NONCENTRAL_CDF_VALUES_TEST tests CHI_SQUARE_NONCENTRAL_CDF_VALUES.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    09 February 2007
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        int    df     = 0;
        double fx     = 0;
        double lambda = 0;
        double x      = 0;

        Console.WriteLine("");
        Console.WriteLine("CHI_SQUARE_NONCENTRAL_CDF_VALUES_TEST:");
        Console.WriteLine("  CHI_SQUARE_NONCENTRAL_CDF_VALUES returns values of");
        Console.WriteLine("  the noncentral Chi-Squared Cumulative Density Function.");
        Console.WriteLine("");
        Console.WriteLine("      X      LAMBDA     DF     CDF");
        Console.WriteLine("");
        int n_data = 0;

        for (;;)
        {
            Chi.chi_square_noncentral_cdf_values(ref n_data, ref df, ref lambda, ref x, ref fx);
            if (n_data == 0)
            {
                break;
            }

            Console.WriteLine("  "
                              + x.ToString(CultureInfo.InvariantCulture).PadLeft(10) + "  "
                              + lambda.ToString(CultureInfo.InvariantCulture).PadLeft(8) + "  "
                              + df.ToString(CultureInfo.InvariantCulture).PadLeft(4) + "  "
                              + fx.ToString(CultureInfo.InvariantCulture).PadLeft(12) + "");
        }
    }