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

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

<refentry version="5.0-subset Scilab" xml:id="distfun_hygestat" 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_hygestat</refname>
    <refpurpose>Hypergeometric  mean and variance</refpurpose>
  </refnamediv>


<refsynopsisdiv>
   <title>Calling Sequence</title>
   <synopsis>
   MN = distfun_hygestat(M,k,N)
   [MN,V] = distfun_hygestat(M,k,N)
   
   </synopsis>
</refsynopsisdiv>

<refsection>
   <title>Parameters</title>
   <variablelist>
   <varlistentry><term>M :</term>
      <listitem><para> a matrix of doubles, the size of total population. M belongs to the set {0,1,2,3........}</para></listitem></varlistentry>
   <varlistentry><term>k :</term>
      <listitem><para> a matrix of doubles, the number of success states in the population. k belongs to the set {0,1,2,3,.......M-1,M}</para></listitem></varlistentry>
   <varlistentry><term>N :</term>
      <listitem><para> a matrix of doubles, the total number of draws in the experiment. N belongs to the set {0,1,2,3.......M-1,M}</para></listitem></varlistentry>
   <varlistentry><term>MN :</term>
      <listitem><para> a matrix of doubles, the mean</para></listitem></varlistentry>
   <varlistentry><term>V :</term>
      <listitem><para> a matrix of doubles, the variance</para></listitem></varlistentry>
   </variablelist>
</refsection>

<refsection>
   <title>Description</title>
   <para>
Computes statistics from the Hypergeometric distribution.
   </para>
   <para>
Any scalar input argument is expanded to a matrix of
doubles of the same size as the other input arguments.
   </para>
   <para>
The Mean and Variance of the Hypergeometric Distribution are
   </para>
   <para>
<latex>
\begin{eqnarray}
MN &amp;=&amp; N \frac{k}{M} \\
V &amp;=&amp; N \frac{k}{M} \left(1-\frac{k}{M}\right) \frac{M-N}{M-1}
\end{eqnarray}
</latex>
   </para>
   <para>
The expression (M-N)/(M-1) is called the correction factor.
This comes from the comparison with the variance of the binomial
distribution with parameters N and pr=k/M.
   </para>
   <para>
</para>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[
//Accuracy test
M = [50 60 70]
N = [20 30 40]
k = [10 25 35]
[MN,V] = distfun_hygestat ( M,N,k )
V = [1.9591837 3.7076271 4.3478261]
MN = [4 12.5 20]

   ]]></programlisting>
</refsection>

<refsection>
   <title>Bibliography</title>
   <para>http://en.wikipedia.org/wiki/Hypergeometric_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>
