

\subsection{\bf Accept/Reject Method for General}
\subsection{\bf Probability Distributions}

\begin{slide}
{\Smallsize
\begin{itemize}
\item Let $p_{\max} = \begin{array}{cc} \max \\ x \end{array}$
$[p(x)]$ for $x_1 \le x \le x_2$.

\begin{description}
\item{$\bullet$} Let $w_{\rm max}$ be any number $> p_{\max}$.
\item{$\bullet$} Generate $x$ uniformly in $[x_1, x_2]$.
\item{$\bullet$} Generate $r$ uniformly in $[0,1]$.
\item{$\bullet$} If $r > \frac{p(x)}{w_{\max}}$, ignore $x$ and start again.
\item{$\bullet$} If $r \le \frac{p(x)}{w_{\max}}$, accept $x$.
\end{description}

\item One can combine this with technique described on previous foils.  

\item Suppose $f(x) dx = d(F(x))$ and we generate $x$ in $[x_1, x_2]$
distributed according to $f(x)$ using exact method described first.

\item This assumes we choose $f(x)$ so that it can be integrated to
find $F(x)$.

\item Now use to accept-reject method or interpolation method with the
probability distribution $p^{\prime}(x) = p(x)/f(x)$

\item We choose $f(x)$ so that it is roughly $p(x)$ so that
$p^{\prime}(x)$ is more slowly varying than $p(x)$.
\end{itemize}
}
\end{slide}

