<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Mike Love's blog</title>
	<atom:link href="http://mikelove.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mikelove.wordpress.com</link>
	<description></description>
	<lastBuildDate>Fri, 20 Jan 2012 14:43:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mikelove.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Mike Love's blog</title>
		<link>http://mikelove.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mikelove.wordpress.com/osd.xml" title="Mike Love&#039;s blog" />
	<atom:link rel='hub' href='http://mikelove.wordpress.com/?pushpress=hub'/>
		<item>
		<title>duplicated() in R</title>
		<link>http://mikelove.wordpress.com/2012/01/20/duplicated-in-r/</link>
		<comments>http://mikelove.wordpress.com/2012/01/20/duplicated-in-r/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 14:43:35 +0000</pubDate>
		<dc:creator>mikelove</dc:creator>
				<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://mikelove.wordpress.com/?p=924</guid>
		<description><![CDATA[I have three vectors, and I want to use duplicated() to find the indices which are duplicates in all three vectors. The help warns that the function is potentially slow for lists. The first two vectors are integers, less than 1e9 and less than 1e4, and the last one is a factor with three levels. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mikelove.wordpress.com&amp;blog=371662&amp;post=924&amp;subd=mikelove&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have three vectors, and I want to use <a href="http://stat.ethz.ch/R-manual/R-devel/library/base/html/duplicated.html">duplicated()</a> to find the indices which are duplicates in all three vectors.  The help warns that the function is potentially slow for lists.</p>
<p>The first two vectors are integers, less than 1e9 and less than 1e4, and the last one is a factor with three levels.</p>
<p><code><br />
&gt; system.time({duplicated(cbind(pos,width,strand))})<br />
   user  system elapsed<br />
 37.034   0.000  37.042<br />
&gt; system.time({duplicated(data.frame(pos,width,strand))})<br />
   user  system elapsed<br />
  5.142   0.001   5.145<br />
&gt; system.time({duplicated(paste(pos,width,strand,collapse=":"))})<br />
   user  system elapsed<br />
  3.297   0.000   3.297<br />
&gt; system.time({duplicated(pos + width/1e5 + as.numeric(strand)/10)})<br />
   user  system elapsed<br />
  0.276   0.002   0.278<br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mikelove.wordpress.com/924/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mikelove.wordpress.com/924/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mikelove.wordpress.com/924/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mikelove.wordpress.com/924/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mikelove.wordpress.com/924/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mikelove.wordpress.com/924/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mikelove.wordpress.com/924/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mikelove.wordpress.com/924/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mikelove.wordpress.com/924/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mikelove.wordpress.com/924/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mikelove.wordpress.com/924/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mikelove.wordpress.com/924/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mikelove.wordpress.com/924/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mikelove.wordpress.com/924/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mikelove.wordpress.com&amp;blog=371662&amp;post=924&amp;subd=mikelove&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mikelove.wordpress.com/2012/01/20/duplicated-in-r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e92ac569643b505ef24bf6de3f533954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mikelove</media:title>
		</media:content>
	</item>
		<item>
		<title>The Anatomy of Influence</title>
		<link>http://mikelove.wordpress.com/2012/01/13/the-anatomy-of-influence/</link>
		<comments>http://mikelove.wordpress.com/2012/01/13/the-anatomy-of-influence/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 13:20:28 +0000</pubDate>
		<dc:creator>mikelove</dc:creator>
				<category><![CDATA[influence]]></category>

		<guid isPermaLink="false">http://mikelove.wordpress.com/?p=917</guid>
		<description><![CDATA[From the NYTimes book review of The Anatomy of Influence: Literature as a Way of Life by Harold Bloom: &#8220;The critic’s role in all this was to map the secret genealogy, uncovering the true ancestor of the belated poet, difficult to do because strong poets ingeniously masked or concealed their actual influences.&#8221; see also: Bloom&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mikelove.wordpress.com&amp;blog=371662&amp;post=917&amp;subd=mikelove&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>From the <a href="http://www.nytimes.com/2011/05/22/books/review/book-review-the-anatomy-of-influence-by-harold-bloom.html?pagewanted=all">NYTimes book review</a> of <em>The Anatomy of Influence: Literature as a Way of Life</em> by Harold Bloom:</p>
<p>&#8220;The critic’s role in all this was to map the secret genealogy, uncovering the true ancestor of the belated poet, difficult to do because strong poets ingeniously masked or concealed their actual influences.&#8221;</p>
<p>see also:</p>
<p>Bloom&#8217;s <a href="http://en.wikipedia.org/wiki/The_Anxiety_of_Influence">The Anxiety of Influence</a><br />
<a href="http://mike-love.net/genealogy/">Genealogy of Influence</a><br />
Jonathan Lethem&#8217;s <a href="http://harpers.org/archive/2007/02/0081387">Ecstasy of Influence: A Plagiarism</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mikelove.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mikelove.wordpress.com/917/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mikelove.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mikelove.wordpress.com/917/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mikelove.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mikelove.wordpress.com/917/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mikelove.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mikelove.wordpress.com/917/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mikelove.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mikelove.wordpress.com/917/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mikelove.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mikelove.wordpress.com/917/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mikelove.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mikelove.wordpress.com/917/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mikelove.wordpress.com&amp;blog=371662&amp;post=917&amp;subd=mikelove&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mikelove.wordpress.com/2012/01/13/the-anatomy-of-influence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e92ac569643b505ef24bf6de3f533954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mikelove</media:title>
		</media:content>
	</item>
		<item>
		<title>R: table to HTML with dimension names</title>
		<link>http://mikelove.wordpress.com/2011/12/16/r-table-to-html-with-dimension-names/</link>
		<comments>http://mikelove.wordpress.com/2011/12/16/r-table-to-html-with-dimension-names/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 16:43:28 +0000</pubDate>
		<dc:creator>mikelove</dc:creator>
				<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://mikelove.wordpress.com/?p=904</guid>
		<description><![CDATA[The contingency tables printed by R nicely include the dimension names above the factor levels in the first row and first column. Here I have to replace spaces with dots to show how it is printed in the console. shape=factor(c("round","round","round","spiky")) color=factor(c("blue","red","blue","red")) table(shape,color) .......color shape...blue.red ..round....2...1 ..spiky....0...1 But if you try to print this with the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mikelove.wordpress.com&amp;blog=371662&amp;post=904&amp;subd=mikelove&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The contingency tables printed by R nicely include the dimension names above the factor levels in the first row and first column.  Here I have to replace spaces with dots to show how it is printed in the console.  </p>
<p><code><br />
shape=factor(c("round","round","round","spiky"))<br />
color=factor(c("blue","red","blue","red"))<br />
table(shape,color)<br />
<br />
.......color<br />
shape...blue.red<br />
..round....2...1<br />
..spiky....0...1<br />
</code></p>
<p>But if you try to print this with the xtable library, you lose the dimension names.  This was mentioned also in <a href="https://stat.ethz.ch/pipermail/r-help/2011-August/286979.html">this thread</a>.</p>
<p><code><br />
library(xtable)<br />
print(xtable(table(shape,color)),"html")<br />
</code></p>
<p><TABLE border="1"><br />
<TR> <TH>  </TH> <TH> blue </TH> <TH> red </TH>  </TR><br />
  <TR> <TD align="right"> round </TD> <TD align="right">   2 </TD> <TD align="right">   1 </TD> </TR><br />
  <TR> <TD align="right"> spiky </TD> <TD align="right">   0 </TD> <TD align="right">   1 </TD> </TR><br />
   </TABLE></p>
<p>I wrote a hack to force these dimension names into the resulting table.  It&#8217;s ugly but it appears to work.</p>
<p><code><br />
crazytable &lt;- function(x,y,prop=0) {<br />
  if (prop == 0) {<br />
    xt &lt;- as.data.frame(xtable(table(x,y)))<br />
  } else {<br />
    xt &lt;- as.data.frame(xtable(prop.table(table(x,y),prop)))<br />
  }<br />
  cn &lt;- colnames(xt)<br />
  rn &lt;- rownames(xt)<br />
  t.out &lt;- as.matrix(cbind(c(&quot;&quot;,&quot;&quot;,rn),rbind(rep(&quot;&quot;,ncol(xt)),cn,xt)))<br />
  colnames(t.out) &lt;- 1:ncol(t.out)<br />
  rownames(t.out) &lt;- 1:nrow(t.out)<br />
  t.out[2,1] &lt;- deparse(substitute(x))<br />
  t.out[1,2] &lt;- deparse(substitute(y))<br />
  t.out<br />
}</p>
<p>print(xtable(crazytable(shape,color)),&quot;html&quot;,include.r=FALSE,include.c=FALSE)<br />
</code></p>
<p><TABLE border="1"><br />
  <TR> <TD>  </TD> <TD> color </TD> <TD>  </TD> </TR><br />
  <TR> <TD> shape </TD> <TD> blue </TD> <TD> red </TD> </TR><br />
  <TR> <TD> round </TD> <TD> 2 </TD> <TD> 1 </TD> </TR><br />
  <TR> <TD> spiky </TD> <TD> 0 </TD> <TD> 1 </TD> </TR><br />
   </TABLE></p>
<p>Here prop allows for proportion tables along rows (1) or columns (2).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mikelove.wordpress.com/904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mikelove.wordpress.com/904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mikelove.wordpress.com/904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mikelove.wordpress.com/904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mikelove.wordpress.com/904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mikelove.wordpress.com/904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mikelove.wordpress.com/904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mikelove.wordpress.com/904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mikelove.wordpress.com/904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mikelove.wordpress.com/904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mikelove.wordpress.com/904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mikelove.wordpress.com/904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mikelove.wordpress.com/904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mikelove.wordpress.com/904/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mikelove.wordpress.com&amp;blog=371662&amp;post=904&amp;subd=mikelove&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mikelove.wordpress.com/2011/12/16/r-table-to-html-with-dimension-names/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e92ac569643b505ef24bf6de3f533954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mikelove</media:title>
		</media:content>
	</item>
		<item>
		<title>2-mers</title>
		<link>http://mikelove.wordpress.com/2011/12/02/2-mers/</link>
		<comments>http://mikelove.wordpress.com/2011/12/02/2-mers/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 13:41:41 +0000</pubDate>
		<dc:creator>mikelove</dc:creator>
				<category><![CDATA[genetics]]></category>

		<guid isPermaLink="false">http://mikelove.wordpress.com/?p=895</guid>
		<description><![CDATA[Here are the frequencies of 2-mers in the human genome (hg19). (obtained using the count-words program of RSAT) One line stands out due to a historic accumulation of certain mutations, called CG suppression. seq identifier observed_freq occ aa aa 0.0977693510124 279490734 ac ac 0.0503391220503 143903156 ag ag 0.0699208325000 199880889 at at 0.0772705679279 220891389 ca ca [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mikelove.wordpress.com&amp;blog=371662&amp;post=895&amp;subd=mikelove&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here are the frequencies of 2-mers in the human genome (hg19).</p>
<p>(obtained using the count-words program of RSAT)</p>
<p>One line stands out due to a historic accumulation of certain mutations, called <a href="http://en.wikipedia.org/wiki/CG_suppression">CG suppression</a>.</p>
<p><code>seq    identifier      observed_freq   occ<br />
aa      aa      0.0977693510124 279490734<br />
ac      ac      0.0503391220503 143903156<br />
ag      ag      0.0699208325000 199880889<br />
at      at      0.0772705679279 220891389<br />
ca      ca      0.0725344058342 207352244<br />
cc      cc      0.0520831825569 148888857<br />
<strong>cg      cg      0.0098517609035 28162976</strong><br />
ct      ct      0.0699588753085 199989641<br />
ga      ga      0.0593289285247 169602085<br />
gc      gc      0.0426523912572 121929296<br />
gg      gg      0.0521099551064 148965391<br />
gt      gt      0.0504530230976 144228762<br />
ta      ta      0.0656671783246 187721077<br />
tc      tc      0.0593535812105 169672559<br />
tg      tg      0.0726616984034 207716132<br />
tt      tt      0.0980451459821 280279142</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mikelove.wordpress.com/895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mikelove.wordpress.com/895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mikelove.wordpress.com/895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mikelove.wordpress.com/895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mikelove.wordpress.com/895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mikelove.wordpress.com/895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mikelove.wordpress.com/895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mikelove.wordpress.com/895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mikelove.wordpress.com/895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mikelove.wordpress.com/895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mikelove.wordpress.com/895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mikelove.wordpress.com/895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mikelove.wordpress.com/895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mikelove.wordpress.com/895/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mikelove.wordpress.com&amp;blog=371662&amp;post=895&amp;subd=mikelove&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mikelove.wordpress.com/2011/12/02/2-mers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e92ac569643b505ef24bf6de3f533954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mikelove</media:title>
		</media:content>
	</item>
		<item>
		<title>Standard deviation</title>
		<link>http://mikelove.wordpress.com/2011/11/01/standard-deviation/</link>
		<comments>http://mikelove.wordpress.com/2011/11/01/standard-deviation/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 12:54:01 +0000</pubDate>
		<dc:creator>mikelove</dc:creator>
				<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://mikelove.wordpress.com/?p=884</guid>
		<description><![CDATA[I should really memorize this to baffle someone in the future: unbiased estimation of standard deviation<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mikelove.wordpress.com&amp;blog=371662&amp;post=884&amp;subd=mikelove&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I should really memorize this to baffle someone in the future:</p>
<p><img src='http://s0.wp.com/latex.php?latex=E%28s%5E2%29+%3D+%5Csigma%5E2+&amp;bg=fff&amp;fg=222&amp;s=0' alt='E(s^2) = &#92;sigma^2 ' title='E(s^2) = &#92;sigma^2 ' class='latex' /><br />
<img src='http://s0.wp.com/latex.php?latex=E%28s%29+%3D++%5Csigma+%5B+1+-+%5Cfrac%7B1%7D%7B4n%7D+-+%5Cfrac%7B7%7D%7B32n%5E2%7D+-+%5Cfrac%7B19%7D%7B128n%5E3%7D+%2B+O%28n%5E%7B-4%7D%29+%5D+&amp;bg=fff&amp;fg=222&amp;s=0' alt='E(s) =  &#92;sigma [ 1 - &#92;frac{1}{4n} - &#92;frac{7}{32n^2} - &#92;frac{19}{128n^3} + O(n^{-4}) ] ' title='E(s) =  &#92;sigma [ 1 - &#92;frac{1}{4n} - &#92;frac{7}{32n^2} - &#92;frac{19}{128n^3} + O(n^{-4}) ] ' class='latex' /></p>
<p><a href="http://en.wikipedia.org/wiki/Unbiased_estimation_of_standard_deviation#Bias_correction">unbiased estimation of standard deviation</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mikelove.wordpress.com/884/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mikelove.wordpress.com/884/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mikelove.wordpress.com/884/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mikelove.wordpress.com/884/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mikelove.wordpress.com/884/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mikelove.wordpress.com/884/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mikelove.wordpress.com/884/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mikelove.wordpress.com/884/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mikelove.wordpress.com/884/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mikelove.wordpress.com/884/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mikelove.wordpress.com/884/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mikelove.wordpress.com/884/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mikelove.wordpress.com/884/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mikelove.wordpress.com/884/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mikelove.wordpress.com&amp;blog=371662&amp;post=884&amp;subd=mikelove&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mikelove.wordpress.com/2011/11/01/standard-deviation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e92ac569643b505ef24bf6de3f533954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mikelove</media:title>
		</media:content>
	</item>
		<item>
		<title>Log probabilities trick</title>
		<link>http://mikelove.wordpress.com/2011/06/06/log-probabilities-trick/</link>
		<comments>http://mikelove.wordpress.com/2011/06/06/log-probabilities-trick/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 12:35:02 +0000</pubDate>
		<dc:creator>mikelove</dc:creator>
				<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://mikelove.wordpress.com/?p=870</guid>
		<description><![CDATA[It is often the case in calculating likelihoods, that the probabilities can be too small for computational stability. Then it makes sense to work with the log of probabilities. However here one will immediately encounter another problem: how to get log(p + q) from log(p) and log(q)? Richard Durbin et al. explain a trick for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mikelove.wordpress.com&amp;blog=371662&amp;post=870&amp;subd=mikelove&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It is often the case in calculating likelihoods, that the probabilities can be too small for computational stability.  Then it makes sense to work with the log of probabilities.  However here one will immediately encounter another problem: how to get log(p + q) from log(p) and log(q)?</p>
<p>Richard Durbin et al. explain a trick for this in <em>Biological sequence analysis: Probabilistic models of proteins and nucleic acids (1998)</em>, section 3.6.</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Clog%28p+%2B+q%29+%3D+%5Clog%28p+%28+1+%2B+%5Cfrac%7Bq%7D%7Bp%7D%29%29+&amp;bg=fff&amp;fg=222&amp;s=0' alt='&#92;log(p + q) = &#92;log(p ( 1 + &#92;frac{q}{p})) ' title='&#92;log(p + q) = &#92;log(p ( 1 + &#92;frac{q}{p})) ' class='latex' /><br />
<img src='http://s0.wp.com/latex.php?latex=%3D+%5Clog%28p%29+%2B+%5Clog%281+%2B+%5Cexp%28%5Clog%28%5Cfrac%7Bq%7D%7Bp%7D%29%29%29+&amp;bg=fff&amp;fg=222&amp;s=0' alt='= &#92;log(p) + &#92;log(1 + &#92;exp(&#92;log(&#92;frac{q}{p}))) ' title='= &#92;log(p) + &#92;log(1 + &#92;exp(&#92;log(&#92;frac{q}{p}))) ' class='latex' /><br />
<img src='http://s0.wp.com/latex.php?latex=%3D+%5Clog%28p%29+%2B+%5Clog%281+%2B+%5Cexp%28%5Clog%28q%29+-+%5Clog%28p%29%29%29&amp;bg=fff&amp;fg=222&amp;s=0' alt='= &#92;log(p) + &#92;log(1 + &#92;exp(&#92;log(q) - &#92;log(p)))' title='= &#92;log(p) + &#92;log(1 + &#92;exp(&#92;log(q) - &#92;log(p)))' class='latex' /></p>
<p>Then if p is chosen as the larger of p and q, Durbin et al. argue that using a table of interpolations for calculating log(1 + exp(x)) gives very close estimates for log(p + q).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mikelove.wordpress.com/870/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mikelove.wordpress.com/870/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mikelove.wordpress.com/870/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mikelove.wordpress.com/870/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mikelove.wordpress.com/870/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mikelove.wordpress.com/870/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mikelove.wordpress.com/870/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mikelove.wordpress.com/870/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mikelove.wordpress.com/870/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mikelove.wordpress.com/870/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mikelove.wordpress.com/870/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mikelove.wordpress.com/870/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mikelove.wordpress.com/870/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mikelove.wordpress.com/870/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mikelove.wordpress.com&amp;blog=371662&amp;post=870&amp;subd=mikelove&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mikelove.wordpress.com/2011/06/06/log-probabilities-trick/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e92ac569643b505ef24bf6de3f533954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mikelove</media:title>
		</media:content>
	</item>
		<item>
		<title>R one liner: Correlation matrices</title>
		<link>http://mikelove.wordpress.com/2011/03/31/correlation-matrices/</link>
		<comments>http://mikelove.wordpress.com/2011/03/31/correlation-matrices/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 09:31:21 +0000</pubDate>
		<dc:creator>mikelove</dc:creator>
				<category><![CDATA[statistics]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://mikelove.wordpress.com/?p=862</guid>
		<description><![CDATA[I have seen many plots of correlation matricies using rainbow or heat colors and therefore not indicating the zero crossing. E.g. Instead I would like to see this: library(fields) cormat = cor(X) image.plot(cormat,zlim=c(-1,1),col=colorRampPalette(c("red","white","green"))(49))<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mikelove.wordpress.com&amp;blog=371662&amp;post=862&amp;subd=mikelove&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have seen many plots of correlation matricies using rainbow or heat colors and therefore not indicating the zero crossing.  E.g.</p>
<p><img src="http://mikelove.files.wordpress.com/2011/03/rainbowcorr.jpeg?w=720" alt="" title="rainbowcorr"   class="alignnone size-full wp-image-868" /></p>
<p>Instead I would like to see this:</p>
<p><code>library(fields)<br />
cormat = cor(X)<br />
image.plot(cormat,zlim=c(-1,1),col=colorRampPalette(c("red","white","green"))(49))</code></p>
<p><img src="http://mikelove.files.wordpress.com/2011/03/cormatrix1.png?w=720" alt="" title="cormatrix"   class="alignnone size-full wp-image-882" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mikelove.wordpress.com/862/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mikelove.wordpress.com/862/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mikelove.wordpress.com/862/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mikelove.wordpress.com/862/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mikelove.wordpress.com/862/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mikelove.wordpress.com/862/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mikelove.wordpress.com/862/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mikelove.wordpress.com/862/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mikelove.wordpress.com/862/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mikelove.wordpress.com/862/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mikelove.wordpress.com/862/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mikelove.wordpress.com/862/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mikelove.wordpress.com/862/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mikelove.wordpress.com/862/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mikelove.wordpress.com&amp;blog=371662&amp;post=862&amp;subd=mikelove&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mikelove.wordpress.com/2011/03/31/correlation-matrices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e92ac569643b505ef24bf6de3f533954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mikelove</media:title>
		</media:content>

		<media:content url="http://mikelove.files.wordpress.com/2011/03/rainbowcorr.jpeg" medium="image">
			<media:title type="html">rainbowcorr</media:title>
		</media:content>

		<media:content url="http://mikelove.files.wordpress.com/2011/03/cormatrix1.png" medium="image">
			<media:title type="html">cormatrix</media:title>
		</media:content>
	</item>
	</channel>
</rss>
