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

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

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


<refsynopsisdiv>
   <title>Calling Sequence</title>
   <synopsis>
   M = distfun_binostat(N,pr)
   [M,V] = distfun_binostat(N,pr)
   
   </synopsis>
</refsynopsisdiv>

<refsection>
   <title>Parameters</title>
   <variablelist>
   <varlistentry><term>pr :</term>
      <listitem><para> a matrix of doubles, the probability of getting success in a Bernoulli trial. pr in [0,1].</para></listitem></varlistentry>
   <varlistentry><term>N :</term>
      <listitem><para> a matrix of doubles , the total number of binomial trials . N belongs to the set {1,2,3,4,.......}</para></listitem></varlistentry>
   <varlistentry><term>M :</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 Binomial 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 Binomial Distribution is:
   </para>
   <para>
<latex>
\begin{eqnarray}
M &amp;=&amp; N p_r \\
V &amp;=&amp; N p_r (1-p_r)
\end{eqnarray}
</latex>
   </para>
   <para>
</para>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[

// Check with expanded N
N = [10 100 1000 10000]
pr = 0.1
[m,v] = distfun_binostat(N,pr)
me = [1 10 100 1000]
ve = [0.9 9 90 900]

//Check with expanded pr
N = 100
pr = [0.1 0.2 0.3 0.4]
[m,v] = distfun_binostat(N,pr)
me = [10 20 30 40]
ve = [9 16 21 24]

//Check with both N and pr expanded
N = [10 100 1000 10000]
pr = [0.1 0.2 0.3 0.4]
[m,v] = distfun_binostat(N,pr)
me = [1 20 300 4000]
ve = [0.9 16 210 2400]

   ]]></programlisting>
</refsection>

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