<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Aptech &#187; Answers for "Simulating from a t distribution"</title>
	<atom:link href="http://www.aptech.com/questions/simulating-from-a-t-distribution/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aptech.com</link>
	<description></description>
	<lastBuildDate>Fri, 08 Feb 2013 19:12:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>By: BarbaraSadaba</title>
		<link>http://www.aptech.com/questions/simulating-from-a-t-distribution/#answer-1797</link>
		<comments>http://www.aptech.com/questions/simulating-from-a-t-distribution/#answer-1797#comments</comments>
		<pubDate>Sun, 30 Sep 2012 14:45:27 +0000</pubDate>
		<dc:creator>BarbaraSadaba</dc:creator>
		
		<guid isPermaLink="false">http://www.aptech.com/questions/simulating-from-a-t-distribution/#answer-1797</guid>
		<description><![CDATA[Sorry, my mistake, this is a function you are creating yourself. Please, disregard my last answer. Best Barbara]]></description>
			<content:encoded><![CDATA[<p>Sorry, my mistake, this is a function you are creating yourself. Please, disregard my last answer.</p>
<p>Best</p>
<p>Barbara</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aptech.com/questions/simulating-from-a-t-distribution/#answer-1797/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>By: BarbaraSadaba</title>
		<link>http://www.aptech.com/questions/simulating-from-a-t-distribution/#answer-1796</link>
		<comments>http://www.aptech.com/questions/simulating-from-a-t-distribution/#answer-1796#comments</comments>
		<pubDate>Sun, 30 Sep 2012 14:42:41 +0000</pubDate>
		<dc:creator>BarbaraSadaba</dc:creator>
		
		<guid isPermaLink="false">http://www.aptech.com/questions/simulating-from-a-t-distribution/#answer-1796</guid>
		<description><![CDATA[Thanks a lot. Basically my problem started because if you search in the help for this command that you showed me now &#8220;rndT&#8221;, is non existent. It would be good to include it I believe. Best Barbara]]></description>
			<content:encoded><![CDATA[<p>Thanks a lot. Basically my problem started because if you search in the help for this command that you showed me now &#8220;rndT&#8221;, is non existent.</p>
<p>It would be good to include it I believe.</p>
<p>Best</p>
<p>Barbara</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aptech.com/questions/simulating-from-a-t-distribution/#answer-1796/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>By: aptech</title>
		<link>http://www.aptech.com/questions/simulating-from-a-t-distribution/#answer-1793</link>
		<comments>http://www.aptech.com/questions/simulating-from-a-t-distribution/#answer-1793#comments</comments>
		<pubDate>Sun, 30 Sep 2012 14:36:15 +0000</pubDate>
		<dc:creator>aptech</dc:creator>
		
		<guid isPermaLink="false">http://www.aptech.com/questions/simulating-from-a-t-distribution/#answer-1793</guid>
		<description><![CDATA[The simplest way to accomplish this is by using the student-t inverse cdf to transform random uniform numbers like this: proc (1) = rndT(rw, cl, df); retp(cdftci(rndu(rw, cl), df)); endp; You can test that the distribution of your numbers is &#8230; <a href="http://www.aptech.com/questions/simulating-from-a-t-distribution/#answer-1793">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The simplest way to accomplish this is by using the student-t inverse cdf to transform random uniform numbers like this:</p>
<pre style="padding-left: 30px;">proc (1) = rndT(rw, cl, df);
	retp(cdftci(rndu(rw, cl), df));
endp;</pre>
<p>You can test that the distribution of your numbers is correct by checking to see what percentage of your numbers are less than a certain value and then comparing that with the T-CDF function:</p>
<pre style="padding-left: 30px;">rw = 1e5;
cl = 1;
df = 5;
r = rndT(rw, cl, df);
checkVal = 0.37;

comp = cdftc( checkVal, df);

<span style="color: #008000;">//Since cdftc returns the compliment subtract 1</span>
print (1 - comp);
print (sumc(r .&lt;= checkVal))/rw;

proc (1) = rndT(rw, cl, df);
    retp(cdftci(rndu(rw, cl), df));
endp;</pre>
<p>You can copy and paste the code snippet above to check. With a &#8216;checkVal&#8217; of 0.37 both print statements should be about 0.636. You can change &#8216;checkVal&#8217; to test other points.</p>
<p>I think there may be a faster method to make the random deviates in terms of the function rndGamma. But, I don&#8217;t know it off the top of my head.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aptech.com/questions/simulating-from-a-t-distribution/#answer-1793/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: www.aptech.com @ 2013-02-09 01:45:33 --