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

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

<refentry version="5.0-subset Scilab" xml:id="distfun_poissrnd" 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_poissrnd</refname>
    <refpurpose>Poisson random numbers</refpurpose>
  </refnamediv>


<refsynopsisdiv>
   <title>Calling Sequence</title>
   <synopsis>
   x = distfun_poissrnd(lambda)
   x = distfun_poissrnd(lambda,[m,n])
   x = distfun_poissrnd(lambda,m,n)
   
   </synopsis>
</refsynopsisdiv>

<refsection>
   <title>Parameters</title>
   <variablelist>
   <varlistentry><term>lambda :</term>
      <listitem><para> a matrix of doubles, the average rate of occurrence. lambda>0.</para></listitem></varlistentry>
   <varlistentry><term>m :</term>
      <listitem><para> a 1-by-1 matrix of floating point integers, the number of rows of x</para></listitem></varlistentry>
   <varlistentry><term>n :</term>
      <listitem><para> a 1-by-1 matrix of floating point integers, the number of columns of x</para></listitem></varlistentry>
   <varlistentry><term>x:</term>
      <listitem><para> a matrix of doubles, the random numbers in the set {0,1,2,3,...}.</para></listitem></varlistentry>
   </variablelist>
</refsection>

<refsection>
   <title>Description</title>
   <para>
Generates random variables from the Poisson 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 expanded lambda
x = distfun_poissrnd(1:6)

// Check expansion of lambda in x = distfun_poissrnd(lambda)
x = distfun_poissrnd([12 14 20])
// Check x = distfun_poissrnd(lambda,v)
x = distfun_poissrnd(2,[4 5])

// Check mean and variance
N = 50000;
lambda = 13;
x = distfun_poissrnd(lambda,[1 N]);
Mx = mean(x)
Vx = variance(x)
[M,V] = distfun_poissstat (lambda)

// Check actual distribution
lambda=12;
N=10000;
h=scf();
x=distfun_poissrnd(lambda,1,N);
distfun_inthisto(x);
h.children.children(1).children.background=-2;
x=0:2*lambda;
y=distfun_poisspdf(x,lambda);
plot(x,y,"ro-");
xtitle("Poisson Random Numbers","X","Frequency")
legend(["Empirical","Density"]);

   ]]></programlisting>
</refsection>

<refsection>
   <title>Bibliography</title>
   <para>http://en.wikipedia.org/wiki/Poisson_distribution</para>
</refsection>

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