\section{RANDNBIN Generate Negative Binomial Random Variables}

\subsection{Usage}

Generates random variables with a negative binomial distribution.
The general syntax for its use is
\begin{verbatim}
   y = randnbin(r,p)
\end{verbatim}
where \verb|r| is a vector of integers representing the number of
successes, and \verb|p| is the probability of success.
\subsection{Function Internals}

A negative binomial random variable describes the number of failures
\verb|x| that occur in \verb|x+r| bernoulli trials, with a success on the 
\verb|x+r| trial.  The pdf is given by
\[
  P_{r,p}(x)=\left(\begin{matrix}x+r-1\\r-1\end{matrix}\right)p^r(1-p)^x.
\]
\subsection{Example}

Here we generate some negative binomial random variables:
\begin{verbatim}
--> randnbin(3*ones(1,4),.01)

ans = 

 150 274 304 159 

--> randnbin(6*ones(1,4),.01)

ans = 

 657 626 357 663 


\end{verbatim}
