<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="m11066">
  
  <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Functions of Random Variables</name>
  
  <metadata xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
  <md:version xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2.5</md:version>
  <md:created xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2003/03/11</md:created>
  <md:revised xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2003/03/31</md:revised>
  <md:authorlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="ngk">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Nick</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Kingsbury</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">ngk10@cam.ac.uk</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="liqun">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Liqun</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Wang</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">liqun@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="ngk">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Nick</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Kingsbury</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">ngk10@cam.ac.uk</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">random variable</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">This module introduces functions of random variables.</md:abstract>
</metadata>
  
  <content xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    
    <section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec1">
      <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Problem:</name>
    
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec1para1">
	If the random variable <m:math><m:ci>Y</m:ci></m:math> is a 
	monotonic increasing function of random variable 
	<m:math><m:ci>X</m:ci></m:math> such that 
 
	<m:math display="block">
	  <m:apply>
	    <m:eq/>
	    <m:ci>Y</m:ci>
	    <m:apply>
	      <m:ci type="fn">g</m:ci>
	      <m:ci>X</m:ci>
	    </m:apply>
	  </m:apply>
	</m:math>

	and 

	<m:math display="block">
	  <m:apply>
	    <m:eq/>
	    <m:ci>X</m:ci>
	    <m:apply>
	      <m:apply>
		<m:inverse/>
		<m:ci type="fn">g</m:ci>
	      </m:apply>
	      <m:ci>Y</m:ci>
	    </m:apply>
	  </m:apply>
	</m:math>

	(inversion of 
	<m:math>
	  <m:apply>
	    <m:ci type="fn">g</m:ci>
	    <m:ci>.</m:ci>
	  </m:apply>
	</m:math> requires it to be monotonic) then, given the cdf 
	
	<m:math>
	  <m:apply>
	    <m:ci type="fn">
	      <m:msub>
		<m:mi>F</m:mi>
		<m:mi>X</m:mi>
	      </m:msub>
	    </m:ci>
	    <m:ci>x</m:ci>
	  </m:apply>
	</m:math> and the function 
	
	<m:math>
	  <m:apply>
	    <m:ci type="fn">g</m:ci>
	    <m:ci>.</m:ci>
	  </m:apply>
	</m:math>, what are 
	
	<m:math>
	  <m:apply>
	    <m:ci type="fn">
	      <m:msub>
		<m:mi>F</m:mi>
		<m:mi>Y</m:mi>
	      </m:msub>
	    </m:ci>
	    <m:ci>y</m:ci>
	  </m:apply>
	</m:math> and 
	
	<m:math>
	  <m:apply>
	    <m:ci type="fn">
	      <m:msub>
		<m:mi>f</m:mi>
		<m:mi>Y</m:mi>
	      </m:msub>
	    </m:ci>
	    <m:ci>y</m:ci>
	  </m:apply>
	</m:math>, the cdf and pdf of <m:math>
	  <m:ci>Y</m:ci>
	</m:math>?
      </para>
    </section>
    

    <section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec2">
      <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Solution:</name>
      
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec2para1">
	If 
	<m:math>
	  <m:apply>
	    <m:ci type="fn">g</m:ci>
	    <m:ci>.</m:ci>
	  </m:apply>
	</m:math> is monotonic increasing, the cdf of
	<m:math><m:ci>Y</m:ci></m:math> is given by 
	
	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq18">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>F</m:mi>
		    <m:mi>Y</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>y</m:ci>
	      </m:apply>
	      <m:apply>
		<m:csymbol definitionURL="http://cnx.rice.edu/cd/cnxmath.ocd#probability"/> 
		<m:apply>
		  <m:leq/>
		  <m:ci>Y</m:ci>
		  <m:ci>y</m:ci>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:csymbol definitionURL="http://cnx.rice.edu/cd/cnxmath.ocd#probability"/> 
		<m:apply>
		  <m:leq/>
		  <m:apply>
		    <m:ci type="fn">g</m:ci>
		    <m:ci>X</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:ci type="fn">g</m:ci>
		    <m:ci>x</m:ci>
		  </m:apply>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:csymbol definitionURL="http://cnx.rice.edu/cd/cnxmath.ocd#probability"/> 
		<m:apply>
		  <m:leq/>
		  <m:ci>X</m:ci>
		  <m:ci>x</m:ci>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>F</m:mi>
		    <m:mi>X</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>x</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>
	
	where 
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:ci>y</m:ci>
	    <m:apply>
	      <m:ci type="fn">g</m:ci>
	      <m:ci>x</m:ci>
	    </m:apply>
	  </m:apply>
	</m:math>.
      </para>
      
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec2para2">
	The pdf of <m:math><m:ci>Y</m:ci></m:math> may be found as
	follows: 
	
	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq19">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>f</m:mi>
		    <m:mi>Y</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>y</m:ci>
	      </m:apply>
	      <m:apply>
		<m:diff/>
		<m:bvar>
		  <m:ci>y</m:ci>
		</m:bvar>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>F</m:mi>
		      <m:mi>Y</m:mi>
		    </m:msub>
		  </m:ci>
		  <m:ci>y</m:ci>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:diff/>
		<m:bvar>
		  <m:ci>y</m:ci>
		</m:bvar>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>F</m:mi>
		      <m:mi>X</m:mi>
		    </m:msub>
		  </m:ci>
		  <m:ci>x</m:ci>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:times/>
		<m:apply>
		  <m:diff/>
		  <m:bvar>
		    <m:ci>x</m:ci>
		  </m:bvar>
		  <m:apply>
		    <m:ci type="fn">
		      <m:msub>
			<m:mi>F</m:mi>
			<m:mi>X</m:mi>
		      </m:msub>
		    </m:ci>
		    <m:ci>x</m:ci>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:diff/>
		  <m:bvar>
		    <m:ci>y</m:ci>
		  </m:bvar>
		  <m:ci>x</m:ci>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:times/>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>f</m:mi>
		      <m:mi>X</m:mi>
		    </m:msub>
		  </m:ci>
		  <m:ci>x</m:ci>
		</m:apply>
		<m:apply>
		  <m:diff/>
		  <m:bvar>
		    <m:ci>y</m:ci>
		  </m:bvar>
		  <m:ci>x</m:ci>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>
	
	Defining 
	<m:math display="block">
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:diff/>
	      <m:bvar>
		<m:ci>x</m:ci>
	      </m:bvar>
	      <m:ci>y</m:ci>
	    </m:apply>
	    <m:apply>
	      <m:diff/>
	      <m:apply>
		<m:ci type="fn">g</m:ci>
		<m:ci>x</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math> and 
	
	<m:math display="block">
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:ci type="fn">
		<m:msub>
		  <m:mi>f</m:mi>
		  <m:mi>Y</m:mi>
		</m:msub>
	      </m:ci>
	      <m:ci>y</m:ci>
	    </m:apply>
	    <m:apply>
	      <m:divide/>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>f</m:mi>
		    <m:mi>X</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>x</m:ci>
	      </m:apply>
	      <m:apply>
		<m:diff/>
		<m:apply>
		  <m:ci type="fn">g</m:ci>
		  <m:ci>x</m:ci>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>
	
	This relation is illustrated in <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" strength="7" target="figure1"/>, using a geometric construction to relate 
	<m:math>
	  <m:ci>
	    <m:msub>
	      <m:mi>f</m:mi>
	      <m:mi>Y</m:mi>
	    </m:msub>
	  </m:ci>
	</m:math> to 
	
	<m:math>
	  <m:ci>
	    <m:msub>
	      <m:mi>f</m:mi>
	      <m:mi>X</m:mi>
	    </m:msub>
	  </m:ci>
	</m:math> via 
	
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:ci>Y</m:ci>
	    <m:apply>
	      <m:ci type="fn">g</m:ci>
	      <m:ci>X</m:ci>
	    </m:apply>
	  </m:apply>
	</m:math>. The area under each of the pdfs between a given
	  pair of dashed lines must be the same, because the
	  probability of being in a given range of
	  <m:math><m:ci>X</m:ci></m:math> must be the same as the
	  probability of being in the equivalent range of
	  <m:math><m:ci>Y</m:ci></m:math>.		 		
      </para>
      

      <figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="figure1">
	<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="image/png" src="figure1.png"/>
	<caption xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Illustration of monotonic mapping of pdfs by plotting 
	  <m:math>
	    <m:apply>
	      <m:ci type="fn">
		<m:msub>
		  <m:mi>f</m:mi>
		  <m:mi>Y</m:mi>
		</m:msub>
	      </m:ci>
	      <m:ci>y</m:ci>
	    </m:apply>
	  </m:math> rotated by 90°. The non-linearity in this case is 
	
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">g</m:ci>
		<m:ci>X</m:ci>
	      </m:apply>
	      <m:apply>
		<m:minus/>
		<m:apply>
		  <m:plus/>
		  <m:apply>
		    <m:times/>
		    <m:cn>0.4</m:cn>
		    <m:apply>
		      <m:power/>
		      <m:ci>X</m:ci>
		      <m:cn>2</m:cn>
		    </m:apply>
		  </m:apply>
		  <m:ci>X</m:ci>
		</m:apply>
		<m:cn>0.4</m:cn>
	      </m:apply>
	    </m:apply>
	  </m:math>, which is monotonic for 
	  
	  <m:math>
	    <m:apply>
	      <m:leq/>
	      <m:cn>-1</m:cn>
	      <m:ci>X</m:ci>
	      <m:cn>1</m:cn>
	    </m:apply>
	  </m:math>.</caption>
      </figure>
      
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec2para3">
	If 
	<m:math>
	  <m:apply>
	    <m:ci type="fn">g</m:ci>
	    <m:ci>.</m:ci>
	  </m:apply>
	</m:math> is monotonic decreasing (instead of increasing),
	then <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" strength="7" target="eq18"/> becomes  
	
	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq21">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>F</m:mi>
		    <m:mi>Y</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>y</m:ci>
	      </m:apply>
	      <m:apply>
		<m:csymbol definitionURL="http://cnx.rice.edu/cd/cnxmath.ocd#probability"/> 
		<m:apply>
		  <m:leq/>
		  <m:apply>
		    <m:ci type="fn">g</m:ci>
		    <m:ci>X</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:ci type="fn">g</m:ci>
		    <m:ci>x</m:ci>
		  </m:apply>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:csymbol definitionURL="http://cnx.rice.edu/cd/cnxmath.ocd#probability"/> 
		<m:apply>
		  <m:geq/>
		  <m:ci>X</m:ci>
		  <m:ci>x</m:ci>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:minus/>
		<m:cn>1</m:cn>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>F</m:mi>
		      <m:mi>X</m:mi>
		    </m:msub>
		  </m:ci>
		  <m:ci>x</m:ci>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>
	
	and by a similar argument we find that 
	
	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq22">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>f</m:mi>
		    <m:mi>Y</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>y</m:ci>
	      </m:apply>
	      <m:apply>
		<m:divide/>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>f</m:mi>
		      <m:mi>X</m:mi>
		    </m:msub>
		  </m:ci>
		  <m:ci>x</m:ci>
		</m:apply>
		<m:apply>
		  <m:minus/>
		  <m:apply>
		    <m:diff/>
		    <m:apply>
		      <m:ci type="fn">g</m:ci>
		      <m:ci>x</m:ci>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>
	
	In principle, any <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">non-monotonic</term> function 
	<m:math>
	  <m:apply>
	    <m:ci type="fn">g</m:ci>
	    <m:ci>.</m:ci>
	  </m:apply>
	</m:math>  can be split into a finite number of monotonic sections and in that case the pdf result can be generalized to 

	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq23">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>f</m:mi>
		    <m:mi>Y</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>y</m:ci>
	      </m:apply>
	      <m:apply>
		<m:sum/>
		<m:domainofapplication>
		  <m:ci>i</m:ci>
		</m:domainofapplication>
		<m:apply>
		  <m:csymbol definitionURL="http://cnx.rice.edu/cd/cnxmath.ocd#evaluateat"/> 
		  <m:bvar>
		    <m:ci>x</m:ci>
		  </m:bvar>
		  <m:lowlimit>
		    <m:ci>
		      <m:msub>
			<m:mi>x</m:mi>
			<m:mi>i</m:mi>
		      </m:msub>
		    </m:ci>
		  </m:lowlimit>
		  <m:apply>
		    <m:divide/>
		    <m:apply>
		      <m:ci type="fn">
			<m:msub>
			  <m:mi>f</m:mi>
			  <m:mi>X</m:mi>
			</m:msub>
		      </m:ci>
		      <m:ci>x</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:abs/>
		      <m:apply>
			<m:diff/>
			<m:apply>
			  <m:ci type="fn">g</m:ci>
			  <m:ci>x</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>
	
	where the 
	<m:math>
	  <m:ci>
	    <m:msub>
	      <m:mi>x</m:mi>
	      <m:mi>i</m:mi>
	    </m:msub>
	  </m:ci>
	</m:math> are all the solutions of 
	
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:ci type="fn">g</m:ci>
	      <m:ci>x</m:ci>
	    </m:apply>
	    <m:ci>y</m:ci>
	  </m:apply>
	</m:math> at any given <m:math>
	  <m:ci>y</m:ci>
	</m:math>. However care is needed in this case, because if 
	
	<m:math>
	  <m:apply>
	    <m:ci type="fn">g</m:ci>
	    <m:ci>x</m:ci>
	  </m:apply>
	</m:math> is smooth then 
	
	<m:math>
	  <m:apply>
	    <m:diff/>
	    <m:apply>
	      <m:ci type="fn">g</m:ci>
	      <m:ci>x</m:ci>
	    </m:apply>
	  </m:apply>
	</m:math> will become zero at the section boundaries and so 
	
	<m:math>
	  <m:apply>
	    <m:ci type="fn">
	      <m:msub>
		<m:mi>f</m:mi>
		<m:mi>Y</m:mi>
	      </m:msub>
	    </m:ci>
	    <m:ci>y</m:ci>
	  </m:apply>
	</m:math> will tend to infinity at these points.
      </para>
    </section>
    

    <section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec3">
      <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Example - Generation of a Gaussian pdf from a uniform pdf</name>
    
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec3para1">
	If <m:math><m:ci>X</m:ci></m:math> has a uniform pdf from
	<m:math><m:cn>0</m:cn></m:math> to
	<m:math><m:cn>1</m:cn></m:math> (and zero elsewhere), and we
	wish to generate <m:math><m:ci>Y</m:ci></m:math> using 
	
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:ci>Y</m:ci>
	    <m:apply>
	      <m:ci type="fn">g</m:ci>
	      <m:ci>X</m:ci>
	    </m:apply>
	  </m:apply>
	</m:math> such that <m:math><m:ci>Y</m:ci></m:math> 
	
	has a Gaussian (normal) pdf of unit variance and zero mean, what is the required function 
	<m:math>
	  <m:apply>
	    <m:ci type="fn">g</m:ci>
	    <m:ci>.</m:ci>
	  </m:apply>
	</m:math>? 
      </para>

      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec3para2">
	(This function is often needed in computers, because standard random number generators tend to have uniform pdfs, while simulation of noise from the real world requires Gaussian pdfs.)		
      </para>

      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec3para3">
	For these pdfs:
	
	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq24">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>f</m:mi>
		    <m:mi>X</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>x</m:ci>
	      </m:apply>
	      <m:piecewise>
		<m:piece>
		  <m:cn>1</m:cn>
		  <m:apply>
		    <m:leq/>
		    <m:cn>0</m:cn>
		    <m:ci>x</m:ci>
		    <m:cn>1</m:cn>
		  </m:apply>
		</m:piece>
		<m:otherwise>
		  <m:cn>0</m:cn>
		</m:otherwise>
	      </m:piecewise>
	    </m:apply>
	  </m:math>
	</equation>
	
	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq25">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>f</m:mi>
		    <m:mi>Y</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>y</m:ci>
	      </m:apply>
	      <m:apply>
		<m:times/>
		<m:apply>
		  <m:divide/>
		  <m:cn>1</m:cn>
		  <m:apply>
		    <m:root/>
		    <m:apply>
		      <m:times/>
		      <m:cn>2</m:cn>
		      <m:pi/>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:exp/>
		  <m:apply>
		    <m:minus/>
		    <m:apply>
		      <m:divide/>
		      <m:apply>
			<m:power/>
			<m:ci>y</m:ci>
			<m:cn>2</m:cn>
		      </m:apply>
		      <m:cn>2</m:cn>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>
	
	The corresponding cdfs are 
	
	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq26">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>F</m:mi>
		    <m:mi>X</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>x</m:ci>
	      </m:apply>
	      <m:apply>
		<m:int/>
		<m:bvar>
		  <m:ci>u</m:ci>
		</m:bvar>
		<m:lowlimit>
		  <m:apply>
		    <m:minus/>
		    <m:infinity/>
		  </m:apply>
		</m:lowlimit>
		<m:uplimit>
		  <m:ci>x</m:ci>
		</m:uplimit>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>f</m:mi>
		      <m:mi>X</m:mi>
		    </m:msub>
		  </m:ci>
		  <m:ci>u</m:ci>
		</m:apply>
	      </m:apply>
	      <m:piecewise>
		<m:piece>
		  <m:cn>0</m:cn>
		  <m:apply>
		    <m:lt/>
		    <m:ci>x</m:ci>
		    <m:cn>0</m:cn>
		  </m:apply>
		</m:piece>
		<m:piece>
		  <m:ci>x</m:ci>
		  <m:apply>
		    <m:leq/>
		    <m:cn>0</m:cn>
		    <m:ci>x</m:ci>
		    <m:cn>1</m:cn>
		  </m:apply>
		</m:piece>
		<m:piece>
		  <m:cn>1</m:cn>
		  <m:apply>
		    <m:gt/>
		    <m:ci>x</m:ci>
		    <m:cn>1</m:cn>
		  </m:apply>
		</m:piece>
	      </m:piecewise>
	    </m:apply>
	  </m:math>
	</equation>
	
	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq27">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>F</m:mi>
		    <m:mi>Y</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>y</m:ci>
	      </m:apply>
	      <m:apply>
		<m:int/>
		<m:bvar>
		  <m:ci>u</m:ci>
		</m:bvar>
		<m:lowlimit>
		  <m:apply>
		    <m:minus/>
		    <m:infinity/>
		  </m:apply>
		</m:lowlimit>
		<m:uplimit>
		  <m:ci>y</m:ci>
		</m:uplimit>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>f</m:mi>
		      <m:mi>Y</m:mi>
		    </m:msub>
		  </m:ci>
		  <m:ci>u</m:ci>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>
	
	From our previous analysis, if 
	<m:math>
	  <m:apply>
	    <m:leq/>
	    <m:cn>0</m:cn>
	    <m:apply>
	      <m:apply>
		<m:inverse/>
		<m:ci type="fn">g</m:ci>
	      </m:apply>
	      <m:ci>y</m:ci>
	    </m:apply>
	    <m:cn>1</m:cn>
	  </m:apply>
	</m:math>
	
	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq28">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>F</m:mi>
		    <m:mi>Y</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>y</m:ci>
	      </m:apply>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>F</m:mi>
		    <m:mi>X</m:mi>
		  </m:msub>
		</m:ci>
		<m:apply>
		  <m:apply>
		    <m:inverse/>
		    <m:ci type="fn">g</m:ci>
		  </m:apply>
		  <m:ci>y</m:ci>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:apply>
		  <m:inverse/>
		  <m:ci type="fn">g</m:ci>
		</m:apply>
		<m:ci>y</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>		
	
	So, 
	
	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq29">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:apply>
		  <m:inverse/>
		  <m:ci type="fn">g</m:ci>
		</m:apply>
		<m:ci>y</m:ci>
	      </m:apply>
	      <m:apply>
		<m:int/>
		<m:bvar>
		  <m:ci>u</m:ci>
		</m:bvar>
		<m:lowlimit>
		  <m:apply>
		    <m:minus/>
		    <m:infinity/>	
		  </m:apply>	
		</m:lowlimit>
		<m:uplimit>
		  <m:ci>y</m:ci>
		</m:uplimit>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>f</m:mi>
		      <m:mi>Y</m:mi>
		    </m:msub>
		  </m:ci>
		  <m:ci>u</m:ci>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>
	
	This integral has no analytic solution, so we cannot easily
	invert this result to get  
	<m:math>
	  <m:apply>
	    <m:ci type="fn">g</m:ci>
	    <m:ci>.</m:ci>
	  </m:apply>
	</m:math>. However a numerical (or graphical) solution is
	shown in <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" strength="7" target="figure2a"/>.
      </para>
      
      <figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" orient="vertical" id="figure2">
	<subfigure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="figure2a">
	  <media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="image/png" src="figure2a.png"/>
	</subfigure>
	<subfigure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="figure2b">
	  <media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="image/png" src="figure2b.png"/>
	</subfigure>
	<caption xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Conversion of uniform pdf to (a) a Gaussian pdf and
	(b) a Rayleigh pdf. A numerical solution for  
	  <m:math>
	    <m:apply>
	      <m:ci type="fn">g</m:ci>
	      <m:ci>X</m:ci>
	    </m:apply>
	  </m:math> was required for (a) in order to invert <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" strength="7" target="eq29"/>, whereas (b) uses the analytic
	  solution for  
	  <m:math>
	    <m:apply>
	      <m:ci type="fn">g</m:ci>
	      <m:ci>X</m:ci>
	    </m:apply>
	  </m:math>, given in <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" strength="7" target="eq32"/>.</caption>
      </figure>
      

      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec3para4">
	We can get an analytic solution to this problem as follows. If
	we generate a 2-D Gaussian from polar coordinates, we need to
	use two random variables to generate
	<m:math><m:ci>r</m:ci></m:math> and
	<m:math><m:ci>θ</m:ci></m:math> with the 
	correct distributions. In particular,
	<m:math><m:ci>r</m:ci></m:math> requires a Rayleigh
	distribution which can be 
	integrated analytically and hence gives a relatively simple
	analytic solution for 
	<m:math>
	  <m:apply>
	    <m:ci type="fn">g</m:ci>
	    <m:ci>.</m:ci>
	  </m:apply>
	</m:math>.
      </para>
      
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec3para5">
	Assuming we start with a uniform pdf from
	<m:math><m:cn>0</m:cn></m:math> to
	<m:math><m:cn>1</m:cn></m:math> as before, 
	generating <m:math><m:ci>θ</m:ci></m:math> is easy as we 
	just scale the variable by 
	<m:math>
	  <m:apply>
	    <m:times/>
	    <m:cn>2</m:cn>
	    <m:pi/>
	  </m:apply>
	</m:math> to get random phases uniformly distributed from
	<m:math><m:cn>0</m:cn></m:math> to  
	
	<m:math> 
	  <m:apply>
	    <m:times/>
	    <m:cn>2</m:cn>
	    <m:pi/>
	  </m:apply>
	</m:math>.
      </para>
      

      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec3para6">
	Once we have 
	<m:math>
	  <m:set>
	    <m:ci>r</m:ci>
	    <m:ci>θ</m:ci>
	  </m:set>
	</m:math>, we can convert to Cartesian components 
	
	<m:math>
	  <m:set>
	    <m:ci>
	      <m:msub>
		<m:mi>x</m:mi>
		<m:mn>1</m:mn>
	      </m:msub>
	    </m:ci>
	    <m:ci>
	      <m:msub>
		<m:mi>x</m:mi>
		<m:mn>2</m:mn>
	      </m:msub>
	    </m:ci>
	  </m:set>
	</m:math> to obtain two variables with Gaussian pdfs.
      </para>
   
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec3para7">
	To generate <m:math><m:ci>r</m:ci></m:math> correctly, we need
	a Rayleigh pdf  
	
	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq30">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>f</m:mi>
		    <m:mi>R</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>r</m:ci>
	      </m:apply>
	      <m:piecewise>
		<m:piece>
		  <m:apply>
		    <m:times/>
		    <m:ci>r</m:ci>
		    <m:apply>
		      <m:exp/>
		      <m:apply>
			<m:minus/>
			<m:apply>
			  <m:divide/>
			  <m:apply>
			    <m:power/>
			    <m:ci>r</m:ci>
			    <m:cn>2</m:cn>
			  </m:apply>
			  <m:cn>2</m:cn>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:geq/>
		    <m:ci>r</m:ci>
		    <m:cn>0</m:cn>
		  </m:apply>
		</m:piece>
		<m:otherwise>
		  <m:cn>0</m:cn>
		</m:otherwise>
	      </m:piecewise>
	    </m:apply>
	  </m:math>
	</equation>
	
	So, 
	
	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq31">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:apply>
		  <m:inverse/>
		  <m:ci type="fn">g</m:ci>
		</m:apply>
		<m:ci>y</m:ci>
	      </m:apply>
	      <m:apply>
		<m:int/>
		<m:bvar>
		  <m:ci>r</m:ci>
		</m:bvar>
		<m:lowlimit>
		  <m:apply>
		    <m:minus/>
		    <m:infinity/>
		  </m:apply>
		</m:lowlimit>
		<m:uplimit>
		  <m:ci>y</m:ci>
		</m:uplimit>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>f</m:mi>
		      <m:mi>R</m:mi>
		    </m:msub>
		  </m:ci>
		  <m:ci>r</m:ci>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:int/>
		<m:bvar>
		  <m:ci>r</m:ci>
		</m:bvar>
		<m:lowlimit>
		  <m:cn>0</m:cn>
		</m:lowlimit>
		<m:uplimit>
		  <m:ci>y</m:ci>
		</m:uplimit>
		<m:apply>
		  <m:times/>
		  <m:ci>r</m:ci>
		  <m:apply>
		    <m:exp/>
		    <m:apply>
		      <m:minus/>
		      <m:apply>
			<m:divide/>
			<m:apply>
			  <m:power/>
			  <m:ci>r</m:ci>
			  <m:cn>2</m:cn>
			</m:apply>
			<m:cn>2</m:cn>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:csymbol definitionURL="http://cnx.rice.edu/cd/cnxmath.ocd#evaluateat"/> 
		<m:lowlimit>
		  <m:cn>0</m:cn>
		</m:lowlimit>
		<m:uplimit>
		  <m:ci>y</m:ci>
		</m:uplimit>
		<m:apply>
		  <m:minus/>
		  <m:apply>
		    <m:exp/>
		    <m:apply>
		      <m:minus/>
		      <m:apply>
			<m:divide/>
			<m:apply>
			  <m:power/>
			  <m:ci>r</m:ci>
			  <m:cn>2</m:cn>
			</m:apply>
			<m:cn>2</m:cn>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:minus/>
		<m:cn>1</m:cn>
		<m:apply>
		  <m:exp/>
		  <m:apply>
		    <m:minus/>
		    <m:apply>
		      <m:divide/>
		      <m:apply>
			<m:power/>
			<m:ci>y</m:ci>
			<m:cn>2</m:cn>
		      </m:apply>
		      <m:cn>2</m:cn>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>
	
	To get 
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:ci>y</m:ci>
	    <m:apply>
	      <m:ci type="fn">g</m:ci>
	      <m:ci>x</m:ci>
	    </m:apply>
	  </m:apply>
	</m:math>, we just invert the formula for 

	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:ci>x</m:ci>
	    <m:apply>
	      <m:apply>
		<m:inverse/>
		<m:ci type="fn">g</m:ci>
	      </m:apply>
	      <m:ci>y</m:ci>
	    </m:apply>
	  </m:apply>
	</m:math>. Hence 
	
	<m:math display="block">
	  <m:apply>
	    <m:eq/>
	    <m:ci>x</m:ci>
	    <m:apply>
	      <m:minus/>
	      <m:cn>1</m:cn>
	      <m:apply>
		<m:exp/>
		<m:apply>
		  <m:minus/>
		  <m:apply>
		    <m:divide/>
		    <m:apply>
		      <m:power/>
		      <m:ci>y</m:ci>
		      <m:cn>2</m:cn>
		    </m:apply>
		    <m:cn>2</m:cn>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>
	
	<m:math display="block">
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:minus/>
	      <m:apply>
		<m:divide/>
		<m:apply>
		  <m:power/>
		  <m:ci>y</m:ci>
		  <m:cn>2</m:cn>
		</m:apply>
		<m:cn>2</m:cn>
	      </m:apply>
	    </m:apply>
	    <m:apply>
	      <m:ln/>
	      <m:apply>
		<m:minus/>
		<m:cn>1</m:cn>
		<m:ci>x</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>
	

	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq32">
	  <m:math>
	    <m:apply>
	      <m:forall/>
	      <m:bvar>
		<m:ci>x</m:ci>
	      </m:bvar>
	      <m:condition>
		<m:apply>
		  <m:lt/>
		  <m:apply>
		    <m:leq/>
		    <m:cn>0</m:cn>
		    <m:ci>x</m:ci>
		  </m:apply>
		  <m:cn>1</m:cn>
		</m:apply>
	      </m:condition>
	      <m:apply>
		<m:eq/>
		<m:ci>y</m:ci>
		<m:apply>
		  <m:ci type="fn">g</m:ci>
		  <m:ci>x</m:ci>
		</m:apply>
		<m:apply>
		  <m:root/>
		  <m:apply>
		    <m:times/>
		    <m:cn>-2</m:cn>
		    <m:apply>
		      <m:ln/>
		      <m:apply>
			<m:minus/>
			<m:cn>1</m:cn>
			<m:ci>x</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>
	
	This conversion is illustrated in <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" strength="7" target="figure2b"/>.
      </para> 
      
      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec3para8">
	Summarizing the complete algorithm:
	
	<list xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="list1" type="enumerated">
	  <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	    Generate a 2-D random vector 
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:ci type="vector">x</m:ci>
		<m:apply>
		  <m:transpose/>
		  <m:matrix>
		    <m:matrixrow>
		      <m:ci>
			<m:msub>
			  <m:mi>x</m:mi>
			  <m:mn>1</m:mn>
			</m:msub>
		      </m:ci>
		      <m:ci>
			<m:msub>
			  <m:mi>x</m:mi>
			  <m:mn>2</m:mn>
			</m:msub>
		      </m:ci>
		    </m:matrixrow>
		  </m:matrix>
		</m:apply>
	      </m:apply>
	    </m:math> with uniform pdfs from 
	
	    <m:math>
	      <m:apply>
		<m:transpose/>
		<m:matrix>
		  <m:matrixrow>
		    <m:cn>0</m:cn>
		    <m:cn>0</m:cn>
		  </m:matrixrow>
		</m:matrix>
	      </m:apply>
	    </m:math> to 
	    
	    <m:math>
	      <m:apply>
		<m:transpose/>
		<m:matrix>
		  <m:matrixrow>
		    <m:cn>1</m:cn>
		    <m:cn>1</m:cn>
		  </m:matrixrow>
		</m:matrix>
	      </m:apply>
	    </m:math>, by two calls to a standard random number generator function (e.g. rand() in Matlab; although this whole procedure is unnecessary in Matlab as there is already a Gaussian random generator, randn()).
	  </item>
	  
	  <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	    Convert 
	    <m:math>
	      <m:ci>
		<m:msub>
		  <m:mi>x</m:mi>
		  <m:mn>1</m:mn>
		</m:msub>
	      </m:ci>
	    </m:math> into <m:math><m:ci>r</m:ci></m:math> with
	    Rayleigh pdf using  
	    
	    <equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq33">
	      <m:math>
		<m:apply>
		  <m:eq/>
		  <m:ci>r</m:ci>
		  <m:apply>
		    <m:ci type="fn">g</m:ci>
		    <m:ci>
		      <m:msub>
			<m:mi>x</m:mi>
			<m:mn>1</m:mn>
		      </m:msub>
		    </m:ci>
		  </m:apply>
		  <m:apply>
		    <m:root/>
		    <m:apply>
		      <m:times/>
		      <m:cn>-2</m:cn>
		      <m:apply>
			<m:ln/>
			<m:apply>
			  <m:minus/>
			  <m:cn>1</m:cn>
			  <m:ci>
			    <m:msub>
			      <m:mi>x</m:mi>
			      <m:mn>1</m:mn>
			    </m:msub>
			  </m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:math>
	    </equation>
	  </item>

	  <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	    Convert 
	    <m:math>
	      <m:ci>
		<m:msub>
		  <m:mi>x</m:mi>
		  <m:mn>2</m:mn>
		</m:msub>
	      </m:ci>
	    </m:math> into <m:math><m:ci>θ</m:ci></m:math> with
	    uniform pdf from <m:math><m:cn>0</m:cn></m:math> to
	    <m:math> 
	      <m:apply>
		<m:times/>
		<m:cn>2</m:cn>
		<m:pi/>
	      </m:apply>
	    </m:math> using 
	    

	    <equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq34">
	      <m:math>
		<m:apply>
		  <m:eq/>
		  <m:ci>θ</m:ci>
		  <m:apply>
		    <m:times/>
		    <m:cn>2</m:cn>
		    <m:pi/>
		    <m:ci>
		      <m:msub>
			<m:mi>x</m:mi>
			<m:mn>2</m:mn>
		      </m:msub>
		    </m:ci>
		  </m:apply>
		</m:apply>
	      </m:math>
	    </equation>
	  </item>
	  
	  <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	    Generate two independent random variables with Gaussian
	    pdfs of unit variance and zero mean using  
	    <m:math display="block">
	      <m:apply>
		<m:eq/>
		<m:ci>
		  <m:msub>
		    <m:mi>y</m:mi>
		    <m:mn>1</m:mn>
		  </m:msub>
		</m:ci>
		<m:apply>
		  <m:times/>
		  <m:ci>r</m:ci>
		  <m:apply>
		    <m:cos/>
		    <m:ci>θ</m:ci>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	    and 
	    <m:math display="block">
	      <m:apply>
		<m:eq/>
		<m:ci>
		  <m:msub>
		    <m:mi>y</m:mi>
		    <m:mn>2</m:mn>
		  </m:msub>
		</m:ci>
		<m:apply>
		  <m:times/>
		  <m:ci>r</m:ci>
		  <m:apply>
		    <m:sin/>
		    <m:ci>θ</m:ci>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </item>
	  
	  <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	    Repeat steps 1 to 4 for each new pair of variables required.	
	  </item>
	</list>
	
	<note xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="note">
	  <m:math>
	    <m:ci>
	      <m:msub>
		<m:mi>y</m:mi>
		<m:mn>1</m:mn>
	      </m:msub>
	    </m:ci>
	  </m:math> and 
	  <m:math>
	    <m:ci>
	      <m:msub>
		<m:mi>y</m:mi>
		<m:mn>2</m:mn>
	      </m:msub>
	    </m:ci>
	  </m:math> may be scaled by
	  <m:math><m:ci>σ</m:ci></m:math> to adjust their
	  variance, and an offset may be added in order to produce a
	  non-zero mean.</note> 
      </para>
    </section>
  </content>
</document>
