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

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

<refentry version="5.0-subset Scilab" xml:id="distfun_unidcdf" 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_unidcdf</refname>
    <refpurpose>Uniform Discrete CDF</refpurpose>
  </refnamediv>


<refsynopsisdiv>
   <title>Calling Sequence</title>
   <synopsis>
   p = distfun_unidcdf ( x , N )
   p = distfun_unidcdf ( x , N , lowertail )
   
   </synopsis>
</refsynopsisdiv>

<refsection>
   <title>Parameters</title>
   <variablelist>
   <varlistentry><term>x :</term>
      <listitem><para> a matrix of doubles, the outcome</para></listitem></varlistentry>
   <varlistentry><term>N :</term>
      <listitem><para> a matrix of doubles, the upper bound (with N&gt;=1)</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>p :</term>
      <listitem><para> a matrix of doubles, the probability.</para></listitem></varlistentry>
   </variablelist>
</refsection>

<refsection>
   <title>Description</title>
   <para>
Computes the cumulated probability distribution function of
the Uniform Discrete 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>
The function definition is:
   </para>
   <para>
<latex>
\begin{eqnarray}
f(x,a,b) =
\left\{
\begin{array}{l}
0, \textrm{ if } x\leq 1, \\
\frac{\lfloor x\rfloor}{N}, \textrm{ if } x\in[1,N], \\
1, \textrm{ if } x\geq N.
\end{array}
\right.
\end{eqnarray}
</latex>
   </para>
   <para>
</para>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[
// Test expanded arguments
c = distfun_unidcdf ( [1 2 3] , [4 5 6] )
e = [ 0. 0.25 0.4]

// Plot the function
N=5;
scf();
x = 1:N;
y = distfun_unidcdf(x , N);
plot(x,y,"ro-");
gca().data_bounds(:,2)=[0;1];
xtitle("Uniform Discrete CDF (N=5)","x","$P(X\leq x)$");

// See upper tail
p = distfun_unidcdf ( 3, 7 )
q = distfun_unidcdf ( 3, 7 , %f )
p+q

   ]]></programlisting>
</refsection>

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