<?xml version="1.0" encoding="UTF-8"?>

<!--
 *
 * This help file was generated from distfun_chi2inv.sci using help_from_sci().
 *
 -->

<refentry version="5.0-subset Scilab" xml:id="distfun_chi2inv" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:scilab="http://www.scilab.org"
          xmlns:db="http://docbook.org/ns/docbook">

  <refnamediv>
    <refname>distfun_chi2inv</refname>
    <refpurpose>Chi-squared Inverse CDF</refpurpose>
  </refnamediv>


<refsynopsisdiv>
   <title>Calling Sequence</title>
   <synopsis>
   x = distfun_chi2cdf(p,k)
   x = distfun_chi2cdf(p,k,lowertail)
   
   </synopsis>
</refsynopsisdiv>

<refsection>
   <title>Parameters</title>
   <variablelist>
   <varlistentry><term>p :</term>
      <listitem><para> a matrix of doubles, the probability.</para></listitem></varlistentry>
   <varlistentry><term>k :</term>
      <listitem><para> a matrix of doubles, the number of degrees of freedom, k>0 (can be non integer)</para></listitem></varlistentry>
   <varlistentry><term>lowertail :</term>
      <listitem><para> a 1-by-1 matrix of booleans, the tail (default lowertail=%t). If lowertail is true (the default), then considers P(X&lt;=x) otherwise P(X&gt;x).</para></listitem></varlistentry>
   <varlistentry><term>x :</term>
      <listitem><para> a matrix of doubles, the outcome. x belongs to the set {0,1,2,3,......}</para></listitem></varlistentry>
   </variablelist>
</refsection>

<refsection>
   <title>Description</title>
   <para>
Computes the Inverse cumulative distribution function of
the Chi-squared distribution function.
   </para>
   <para>
Any scalar input argument is expanded to a matrix of doubles
of the same size as the other input arguments.
   </para>
   <para>
</para>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[
// Test with p scalar, k scalar
computed = distfun_chi2inv(0.4,5)
expected = 3.6554996

// Test with expanded p, k scalar
computed = distfun_chi2inv([0.2 0.6],5)
expected = [2.3425343 5.1318671]

// Test with p scalar, k expanded
computed = distfun_chi2inv(0.44,[4 7])
expected = [2.9870195 5.827751]

// Test with both p,k expanded
computed = distfun_chi2inv([0.22 0.66],[3 4])
expected = [1.0878828 4.5215487]

// Test small values of p
x = distfun_chi2inv(1.e-15,6)
expected = 0.0000363
x = distfun_chi2inv(1.e-15,6,%f)
expected = 82.67507

   ]]></programlisting>
</refsection>

<refsection>
   <title>Bibliography</title>
   <para>http://en.wikipedia.org/wiki/Chi-squared_distribution</para>
</refsection>

<refsection>
   <title>Authors</title>
   <simplelist type="vert">
   <member>Copyright (C) 2012 - Prateek Papriwal</member>
   <member>Copyright (C) 2012 - Michael Baudin</member>
   </simplelist>
</refsection>
</refentry>
