<?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>Nathan VanHoudnos &#187; rstats</title>
	<atom:link href="http://www.stat.cmu.edu/~nmv/category/rstats/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stat.cmu.edu/~nmv</link>
	<description>Statistics and Public Policy Ph.D. Student</description>
	<lastBuildDate>Thu, 07 Feb 2013 20:43:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Getting R2WinBUGS to talk to WinBUGS 1.4 on Ubuntu 12.04 LTS</title>
		<link>http://www.stat.cmu.edu/~nmv/2012/05/04/getting-r2winbugs-to-talk-to-winbugs-1-4-on-ubuntu-12-04-lts/</link>
		<comments>http://www.stat.cmu.edu/~nmv/2012/05/04/getting-r2winbugs-to-talk-to-winbugs-1-4-on-ubuntu-12-04-lts/#comments</comments>
		<pubDate>Fri, 04 May 2012 17:17:08 +0000</pubDate>
		<dc:creator>nmv</dc:creator>
				<category><![CDATA[rstats]]></category>

		<guid isPermaLink="false">http://nathanvan.wordpress.com/?p=252</guid>
		<description><![CDATA[Disclaimer 1: WinBUGS is old and not maintained. There are other packages to use, if you would like to take advantage of more modern developments in MCMC such as: PyMC which transparently implements adaptive Metropolis-Hastings proposals (among other great features), or the LaplacesDemon R package, which &#8230; <a href="http://www.stat.cmu.edu/~nmv/2012/05/04/getting-r2winbugs-to-talk-to-winbugs-1-4-on-ubuntu-12-04-lts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Disclaimer 1: </strong><a href="http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/contents.shtml">WinBUGS</a> is old and not maintained. There are other packages to use, if you would like to take advantage of more modern developments in MCMC such as:</p>
<ul>
<li><a href="http://code.google.com/p/pymc/">PyMC</a> which transparently implements adaptive Metropolis-Hastings proposals (among other great features), or</li>
<li>the <a href="http://cran.r-project.org/web/packages/LaplacesDemon/">LaplacesDemon</a> R package, which dispenses guidance on whether or not your chain converged, or</li>
<li>the as of yet released <a href="http://code.google.com/p/stan/">STAN</a>, which will use an <a href="http://arxiv.org/abs/1111.4246">automatically tuned Hamiltonian Monte Carlo</a> sampler when it can and (presumably) a WinBUGS like Gibbs sampler when it can&#8217;t.</li>
</ul>
<p><strong>Disclaimer 2:</strong> There are also WinBUGS alternatives, like <a href="http://mcmc-jags.sourceforge.net/">JAGS</a> and <a href="http://www.openbugs.info/w/">OpenBUGS</a>, that are both currently maintained and cross platform (Windows, Mac, and linux). They are worth checking out if you want to maintain some legacy BUGS code.</p>
<p>If you are set on using WinBUGS, the installation is remarkably easy on Ubuntu (easier than Windows 7, in fact).The steps are as follows:</p>
<p>1. <a href="http://cran.r-project.org/bin/linux/ubuntu/README">Install R.</a> (R 2.14.2)<br />
2. <a href="http://www.winehq.org/download/ubuntu">Install wine.</a>  (wine-1.4)<br />
3. <a href="http://cddesjardins.wordpress.com/2010/07/27/winbugs-on-ubuntu-and-r2winbugs-with-wine/">Install WinBUGS via wine and setup R2WinBugs</a>. That guide was written for Ubuntu 10.04. Some modifications for Ubuntu 12.04: </p>
<ul>
<li>Ignore the bits about wine 1.0. Wine 1.4 works great.</li>
<li>The R2WinBUGS example won&#8217;t work. When you run this:
<pre class="brush: r; title: ; notranslate">
&amp;gt; schools.sim &amp;lt;- bugs( data, inits, parameters, model.file, n.chains=3, n.iter=5000)
</pre>
<p>WinBUGS will pop-up, but it will get stuck at its license screen. If you close the license screen, nothing happens. If you close the WinBUGS window, you get:</p>
<pre class="brush: r; title: ; notranslate">
schools.sim p11-kit: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: cannot open shared object file: No such file or directory
err:ole:CoGetClassObject class {0003000a-0000-0000-c000-000000000046} not registered
err:ole:CoGetClassObject class {0003000a-0000-0000-c000-000000000046} not registered
err:ole:CoGetClassObject no class object {0003000a-0000-0000-c000-000000000046} could be created for context 0x3&amp;amp;lt;/code&amp;amp;gt;

Error in bugs.run(n.burnin, bugs.directory, WINE = WINE, useWINE = useWINE, : Look at the log file and try again with 'debug=TRUE' to figure out what went wrong within Bugs.
</pre>
<p>Which isn&#8217;t a particularly helpful error message.</li>
<li>The error is that the intermediate files that R2WinBUGS produces are not getting shared with WinBUGS, so WinBUGS thinks it doesn&#8217;t have to do anything. As mentioned by &#8216;zcronix&#8217; in the comment thread for the instructions, it is a two step fix: (1) create a temporary directory to store those files and (2) tell R2WinBugs about it with the working.directory and clearWD options.  </br><br />
In your shell:</p>
<pre class="brush: bash; title: ; notranslate">
nathanvan@nathanvan-N61Jq:~$ cd .wine/drive_c/
nathanvan@nathanvan-N61Jq:~/.wine/drive_c$ mkdir temp
nathanvan@nathanvan-N61Jq:~/.wine/drive_c$ cd temp
nathanvan@nathanvan-N61Jq:~/.wine/drive_c/temp$ mkdir Rtmp
</pre>
<p>In R: </p>
<pre class="brush: r; title: ; notranslate">
&amp;gt; schools.sim &amp;lt;- bugs( data, inits, parameters, model.file, n.chains=3, n.iter=5000, working.directory='~/.wine/drive_c/temp/Rtmp/', clearWD=TRUE)
</pre>
</li>
</ul>
<p>Hopefully that will work for you too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stat.cmu.edu/~nmv/2012/05/04/getting-r2winbugs-to-talk-to-winbugs-1-4-on-ubuntu-12-04-lts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>R is not C</title>
		<link>http://www.stat.cmu.edu/~nmv/2011/12/07/r-is-not-c/</link>
		<comments>http://www.stat.cmu.edu/~nmv/2011/12/07/r-is-not-c/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 14:14:52 +0000</pubDate>
		<dc:creator>nmv</dc:creator>
				<category><![CDATA[rstats]]></category>

		<guid isPermaLink="false">http://nathanvan.wordpress.com/?p=215</guid>
		<description><![CDATA[I keep trying to write R code like it was C code. It is a habit I&#8217;m trying to break myself of. For example, the other day I need to construct a model matrix of 1&#8242;s and 0&#8242;s in the &#8230; <a href="http://www.stat.cmu.edu/~nmv/2011/12/07/r-is-not-c/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I keep trying to write R code like it was C code. It is a habit I&#8217;m trying to break myself of. </p>
<p>For example, the other day I need to construct a model matrix of 1&#8242;s and 0&#8242;s in the standard, counting in binary, pattern. My solution was:<br />
<code>
<pre>
n &lt;- 8
powers &lt;- 2^(0:(n-1))
NN &lt;- (max(powers)*2)
designMatrix &lt;- matrix( NA, nrow=NN, ncol=n)
for( ii in 0:(NN-1) ) {
     leftOver &lt;- ii
     for ( jj in 1:n ) {
          largest &lt;- rev(powers)[jj]
          if ( leftOver != 0 &amp;&amp; largest &lt;= leftOver ) {
               designMatrix[ii+1,jj] &lt;- 1	
               leftOver &lt;- leftOver - largest
          } else {
               designMatrix[ii+1,jj] &lt;- 0
          }
     }	
} 
print(designMatrix)
</pre>
<p></code></p>
<p>The code works, but it is a low-level re-implementation of something that already exists in base R. R is not C, because base R has pieces that implement statistical ideas for you. Consider:<br />
<code>
<pre>
expand.grid                package:base                R Documentation

Create a Data Frame from All Combinations of Factors

Description:

     Create a data frame from all combinations of the supplied vectors
     or factors.  See the description of the return value for precise
     details of the way this is done.
</pre>
<p></code></p>
<p>So then instead of writing (and debugging!) a function to make a binary model matrix, I could have simply used a one-liner:<br />
<code>
<pre>
# Note that c(0,1) is encased in list() so that
# rep(..., n) will repeat the object c(0,1) n 
# times instead of its default behavior of 
# concatenating the c(0,1) objects. 
designMatrix_R &lt;- as.matrix( expand.grid( rep( list(c(0,1) ), n) ) )
</pre>
<p></code></p>
<p>I like it. It is both shorter and easier to debug. Now I just need to figure out how to <em>find</em> these base R functions before I throw up my hands and re-implement them in C. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.stat.cmu.edu/~nmv/2011/12/07/r-is-not-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Revolution R with Eclipse Helios</title>
		<link>http://www.stat.cmu.edu/~nmv/2011/01/10/revolution-r-with-eclipse-helios/</link>
		<comments>http://www.stat.cmu.edu/~nmv/2011/01/10/revolution-r-with-eclipse-helios/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 17:07:24 +0000</pubDate>
		<dc:creator>nmv</dc:creator>
				<category><![CDATA[rstats]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nathanvan.wordpress.com/?p=92</guid>
		<description><![CDATA[One of the reasons that I don&#8217;t often take advantage of the cool features in Revolution R is that I absolutely can&#8217;t stand their Visual Studio interface. Previously, if I wanted to run something in RevoR, I fired up the &#8230; <a href="http://www.stat.cmu.edu/~nmv/2011/01/10/revolution-r-with-eclipse-helios/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the reasons that I don&#8217;t often take advantage of the cool features in <a href="http://www.revolutionanalytics.com/">Revolution R</a> is that I absolutely can&#8217;t stand their Visual Studio interface. Previously, if I wanted to run something in RevoR, I fired up the RGui.exe that comes buried in their distribution and used R&#8217;s built in script editor. My normal workflow is to use StatEt inside of Eclipse, so dealing with R&#8217;s meager editor was always painful. (Although less painful than the bloated VS-standalone alternative.) </p>
<p>Over the break, I ran across Luke Miller&#8217;s excellent post on getting Eclipse setup with StatEt <a href="http://lukemiller.org/index.php/2010/12/r-2-12-0-and-eclipse-with-statet-installation/">the right way</a>. I was able to follow his tutorial to get <a href="http://lib.stat.cmu.edu/R/CRAN/">vanilla 64-bit R</a> setup on a new installation of <a href="http://www.eclipse.org/downloads/">64-bit Eclipse Helios</a>. Once that was working, I changed two things to add a second shortcut for Revo R. </p>
<p>First, I followed his directions to install <code>rJava</code> in RevoR:<br />
<code><br />
C:Usersnathanvan&gt;cd C:RevolutionRevo-4.0RevoEnt64R-2.11.1bin<br />
C:RevolutionRevo-4.0RevoEnt64R-2.11.1bin&gt;R.exe</p>
<p>R version 2.11.1 (2010-05-31)<br />
Copyright (C) 2010 The R Foundation for Statistical Computing<br />
ISBN 3-900051-07-0<br />
...<br />
Type 'revo()' to visit www.revolutionanalytics.com for the latest<br />
Revolution R news, 'forum()' for the community forum, or 'readme()'<br />
for release notes.</p>
<p>&gt; install.packages("rJava")<br />
...<br />
package 'rJava' successfully unpacked and MD5 sums checked</p>
<p>The downloaded packages are in<br />
        C:UsersnathanvanAppDataLocalTempRtmpG3tMzbdownloaded_packages<br />
</code></p>
<p>And then installed <code>rj</code> in RevoR, once again using his directions.<br />
<code><br />
C:RevolutionRevo-4.0RevoEnt64R-2.11.1bin&gt;R CMD INSTALL --no-test-load "C:UsersnathanvanDownloadsrj_0.5.2-1.tar.gz"<br />
...<br />
* DONE (rj)<br />
</code> </p>
<p>And finally setup Eclipse with a second Run Configuration which I named Revo-R-x64-2.11.1. Now I can run the 64bit version of RevoR without having to deal with the VisualStudio interface. If I get around to it, I&#8217;ll post some performance numbers. (The last time I used the VS interface, it was noticeably slower than calling RGui.exe directly.) </p>
]]></content:encoded>
			<wfw:commentRss>http://www.stat.cmu.edu/~nmv/2011/01/10/revolution-r-with-eclipse-helios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Messing with R packages</title>
		<link>http://www.stat.cmu.edu/~nmv/2010/06/17/messing-with-r-packages/</link>
		<comments>http://www.stat.cmu.edu/~nmv/2010/06/17/messing-with-r-packages/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 18:06:30 +0000</pubDate>
		<dc:creator>nmv</dc:creator>
				<category><![CDATA[rstats]]></category>
		<category><![CDATA[shell scripts]]></category>

		<guid isPermaLink="false">http://nathanvan.wordpress.com/?p=50</guid>
		<description><![CDATA[This was really frustrating. I&#8217;m trying to modify a package from Matt Johnson and although I could get the package he sent me to install flawlessly, I couldn&#8217;t un-tar it, make a change, re-tar it, and then R CMD INSTALL &#8230; <a href="http://www.stat.cmu.edu/~nmv/2010/06/17/messing-with-r-packages/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This was really frustrating. I&#8217;m trying to modify a package from <a href="http://www.tc.edu/faculty/index.htm?facid=msj2119">Matt Johnson</a> and although I could get the package he sent me to install flawlessly, I couldn&#8217;t un-tar it, make a change, re-tar it, and then R CMD INSTALL it. I was about to pull out my hair. The error I got was:<br />
<code>ERROR: cannot extract package from ‘hrm-rev9.tar.gz’</code></p>
<p>The secret: you have to have the <strong>name</strong> correct.<br />
<code>R CMD INSTALL hrm-rev9.tar.gz</code><br />
barfs. But<br />
<code>R CMD INSTALL hrm_0.1-9.tar.gz</code><br />
works fine. I&#8217;m sure it&#8217;s somewhere in the docs. I just couldn&#8217;t find it. </p>
<p>As always, I made a script to do it for me: (Updated 6/17/2010 15:41)<br />
<code><br />
#!/bin/bash<br />
# Quick script to tar &amp; gzip the package, remove the old one, and install the new one<br />
# I'll add options automatically tag and release it later. </p>
<p>#Set the library that I'm using<br />
LIB="/home/vanhoudn/R/i486-pc-linux-gnu-library/2.10/"</p>
<p>#Commit<br />
svn commit -m "Build commit" </p>
<p>#get the revision number from svn<br />
REV=`svn info -R | grep Revision | cut -d: -f 2 | sort -g -r | head -n 1 | sed 's/ //g'`</p>
<p>#Build the filename<br />
FILENAME="hrm_0.1-$REV.tar.gz"</p>
<p># I need to tar up the pkg so I can install it.<br />
# Jump to the parent directory and work from there.<br />
cd ..<br />
# Exclude any hidden files under the directories (svn has a bunch)<br />
# and add the named files<br />
tar czf $FILENAME --exclude '.*' hrm/DESCRIPTION hrm/NAMESPACE hrm/src hrm/R </p>
<p># Remove the old version of the package<br />
R CMD REMOVE -l $LIB hrm</p>
<p># Install the new package<br />
R CMD INSTALL $FILENAME</p>
<p># Clean up<br />
rm $FILENAME</p>
<p># Go back to our previous directory<br />
cd hrm<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stat.cmu.edu/~nmv/2010/06/17/messing-with-r-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>StatEt in Ubuntu 10.04</title>
		<link>http://www.stat.cmu.edu/~nmv/2010/06/14/statet-in-ubuntu-10-04/</link>
		<comments>http://www.stat.cmu.edu/~nmv/2010/06/14/statet-in-ubuntu-10-04/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 16:44:16 +0000</pubDate>
		<dc:creator>nmv</dc:creator>
				<category><![CDATA[rstats]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nathanvan.wordpress.com/?p=44</guid>
		<description><![CDATA[I wanted a &#8220;lightweight&#8221; version of Eclipse to run R from Ubuntu. (I installed eclipse-pde using apt-get. It worked fine.) Once it was running, I installed StatEt via the &#8220;Install new software&#8221; feature from http://download.walware.de/eclipse-3.5. While it was downloading, I &#8230; <a href="http://www.stat.cmu.edu/~nmv/2010/06/14/statet-in-ubuntu-10-04/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I wanted a &#8220;lightweight&#8221; version of Eclipse to run R from Ubuntu. (I installed eclipse-pde using apt-get. It worked fine.) Once it was running, I installed <a href="http://www.walware.de/?page=/it/statet/installation.html">StatEt</a> via the &#8220;Install new software&#8221; feature from <code>http://download.walware.de/eclipse-3.5</code>. While it was downloading, I opened up an R console and ran <code>install.packages("rJava")</code>. When the installation of both StatEt and rJava finished I restarted Eclipse. This is when things stopped working and I couldn&#8217;t really find any step-by step directions on how to proceed. Here is what I did:</p>
<ol>
<li>Run -&gt; Run Configurations</li>
<li>Click on R-Console in the left pane. This will create a new run configuration. Change the name to &#8220;R 2.10&#8243;</li>
<li>Click on the &#8220;R_Config&#8221; tab. Choose &#8220;Selected Configuration:&#8221; and then hit the &#8220;Configure&#8230;&#8221; button. </li>
<li>Click &#8220;Add&#8221;. Change &#8220;Location (R_Home):&#8221; to &#8220;/usr/lib/R&#8221; and click &#8220;Detect Default Properties/Settings&#8221; Click &#8220;Ok&#8221; until you are back to the &#8220;Run Configurations&#8221; window</li>
<li>This is the important step. Without it you will get<br />
<code><br />
Launching the R Console was cancelled, because it seems starting the Java process/R engine failed.<br />
Please make sure that R package 'rJava' with JRI is installed and look into the Troubleshooting section on the homepage.<br />
</code><br />
         Click on the JRE tab. In the &#8220;VM Arguments&#8221; box add<br />
<code>-Drjava.path=/home/&lt;username&gt;/R/i486-pc-linux-gnu-library/2.10/rJava</code></p>
<p>        Where &lt;username&gt; is your username. (You are providing the path to rJava, for some reason, even though Eclipse will detect it during the setup in the &#8220;R_Config&#8221; step, it doesn&#8217;t seem to share that information with the JRE.) </li>
<li>Click Run. It should work.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.stat.cmu.edu/~nmv/2010/06/14/statet-in-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Pegging your multicore CPU in Revolution R, Good and Bad</title>
		<link>http://www.stat.cmu.edu/~nmv/2010/06/09/pegging-your-multicore-cpu-in-revolution-r-good-and-bad/</link>
		<comments>http://www.stat.cmu.edu/~nmv/2010/06/09/pegging-your-multicore-cpu-in-revolution-r-good-and-bad/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 20:05:12 +0000</pubDate>
		<dc:creator>nmv</dc:creator>
				<category><![CDATA[rstats]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nathanvan.wordpress.com/?p=29</guid>
		<description><![CDATA[I take an almost unhealthy pleasure in pushing my computer to its limits. This has become easier with Revolution R and its free license for academic use. One of its best features is debugger that allows you to step through &#8230; <a href="http://www.stat.cmu.edu/~nmv/2010/06/09/pegging-your-multicore-cpu-in-revolution-r-good-and-bad/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.stat.cmu.edu/~nmv/wp-content/uploads/2010/06/cpu.png"><img src="http://www.stat.cmu.edu/~nmv/wp-content/uploads/2010/06/cpu.png?w=300" alt="Seven of eight cores at maximum usage" title="Pegged " width="300" height="73" class="aligncenter size-medium wp-image-30" /></a></p>
<p>I take an almost unhealthy pleasure in pushing my computer to its limits. This has become easier with <a href="http://www.revolutionanalytics.com/downloads/free-academic.php">Revolution R</a> and its free license for academic use. One of its best features is debugger that allows you to step through R code interactively like you can with python on <a href="http://pydev.org/">PyDev</a>. The other useful thing it packages is a simple way to run embarrassingly parallel jobs on a multicore box with the doSMP package. </p>
<p><code><br />
library(doSMP)</p>
<p># This declares how many processors to use.<br />
# Since I still wanted to use my laptop, during the simulation I chose cores-1.<br />
workers &lt;- startWorkers(7)<br />
registerDoSMP(workers)</p>
<p># Make Revolution R not try to go multi-core since we're already explicitly running in parallel<br />
# Tip from: http://blog.revolutionanalytics.com/2010/06/performance-benefits-of-multithreaded-r.html<br />
 setMKLthreads(1)</p>
<p>chunkSize &lt;- ceiling(runs / getDoParWorkers())<br />
smpopts &lt;- list(chunkSize=chunkSize)</p>
<p>#This just let&#039;s me see how long the simulation ran<br />
beginTime &lt;- Sys.time()</p>
<p>#This is the crucial piece. It parallelizes a for loop among the workers and aggregates their results<br />
#with cbind. Since my function returns c(result1, result2, result3), r becomes a matrix with 3 rows and<br />
# &quot;runs&quot; columns.<br />
r &lt;- foreach(icount(runs), .combine=cbind, .options.smp=smpopts) %dopar% {<br />
       # repeatExperiment is just a wrapper function that returns a c(result1, result2, result3)<br />
	tmp &lt;- repeatExperiment(N,ratingsPerQuestion, minRatings, trials, cutoff, studentScores)<br />
}</p>
<p>runTime &lt;- Sys.time() - beginTime</p>
<p>#So now I can do something like this:<br />
boxplot(r[1,], r[2,], r[3,],<br />
		main=paste(&quot;Distribution of Percent of rmse below &quot;, cutoff,<br />
			&quot;n Runs=&quot;, runs, &quot; Trials=&quot;,trials, &quot; Time=&quot;,round(runTime,2),&quot; minsn&quot;,<br />
			&quot;scale: &quot;,scaleLow,&quot;-&quot;,scaleHigh,<br />
			sep=&quot;&quot;),<br />
		names=c(&quot;Ave3&quot;,&quot;Ave5&quot;,&quot;Ave7&quot;))<br />
</code></p>
<p>If you are intersested in finding out more of about this, their docs are <a href="http://www.revolutionanalytics.com/subscriptions/docs/REvoR3.2/parRmanLite.pdf">pretty good</a>.</p>
<p />
The only drawback is that <a href="http://www.revolutionanalytics.com/downloads/free-academic.php">Revolution R</a> is a bit rough around the edges and crashes much more than it should. Worse, for me at least the <a href="http://forums.revolutionanalytics.com/">support forum</a> doesn&#8217;t show any posts when I&#8217;m logged in and I can&#8217;t post anything. Although I&#8217;ve filled out (what I think is) the appropriate web-form no one has gotten back to me about fixing my account. I&#8217;m going to try twitter in a bit. Your mileage may vary. </p>
<h4>Update: 6/9/2010 22:03 EST</h4>
<p>Revolution Analytics responded to my support request after I mentioned it on twitter. Apparently, they had done something to the forums which corrupted my account. Creating a new account fixed the problem, so now I can report the bugs that I<br />
find and get some help. </p>
<h4>Update: 6/11/2010 16:03 EST</h4>
<p>It turns out that you get a small speed improvement by setting <code>setMKLthreads(1)</code>. Apparently, the libraries Revolution R links against attempt to use multiple cores by default. If you are explicitly parrallel programing, this means that your code is competing with itself for resources. <a href="http://blog.revolutionanalytics.com/2010/06/performance-benefits-of-multithreaded-r.html">Thanks for the tip!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stat.cmu.edu/~nmv/2010/06/09/pegging-your-multicore-cpu-in-revolution-r-good-and-bad/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>