Jekyll2020-05-12T23:28:17+00:00http://hongdinggao.github.io/feed.xmlHongding GaoMindless thoughts about quantitative genetics and genomic prediction etc. | All opinions here are my own
GBLUP and SNP BLUP2017-07-07T00:00:00+00:002017-07-07T00:00:00+00:00http://hongdinggao.github.io/genomics/2017/07/07/GBLUP-and-SNP-BLUP<p>Here are just some simple notes about these 2 equivalent models</p>
<h4 id="mme-for-gblup">MME for GBLUP</h4>
<p>You can understand <strong>GBLUP</strong> is a “improved” version of
traditional <strong>PBLUP</strong></p>
<script type="math/tex; mode=display">% <![CDATA[
\left[
\begin{array}{cc}
\mathbf{X'R}^{-1}\mathbf{X} & \mathbf{X'R}^{-1}\mathbf{Z}\\
\mathbf{Z'R}^{-1}\mathbf{X} & \mathbf{Z'R}^{-1}\mathbf{Z}+(\mathbf{G}\sigma^2_a)^{-1}
\end{array}\right]
\left[
\begin{array}{c}
\hat{\mathbf{b}}\\
\hat{\mathbf{u}}
\end{array}\right]
=
\left[
\begin{array}{c}
\mathbf{X'R}^{-1}\mathbf{y}\\
\mathbf{Z'R}^{-1}\mathbf{y}
\end{array}\right] %]]></script>
<script type="math/tex; mode=display">% <![CDATA[
\left[
\begin{array}{cc}
\mathbf{X'}\mathbf{X} & \mathbf{X'}\mathbf{Z}\\
\mathbf{Z'}\mathbf{X} & \mathbf{Z'}\mathbf{Z}+\mathbf{G}^{-1}\lambda
\end{array}\right]
\left[
\begin{array}{c}
\hat{\mathbf{b}}\\
\hat{\mathbf{u}}
\end{array}\right]
=
\left[
\begin{array}{c}
\mathbf{X'}\mathbf{y}\\
\mathbf{Z'}\mathbf{y}
\end{array}\right] %]]></script>
<p>where $\sigma^2_a$ is the total genetic variance, <script type="math/tex">\lambda=\sigma^2_e/\sigma^2_a</script> <br />
<script type="math/tex">\mathbf{u}\;\sim\;N(\mathbf{0},\mathbf{G}\sigma^2_a)</script></p>
<h4 id="model-for-snp-blup">Model for SNP-BLUP</h4>
<p>The marker effects $\mathbf{g}_i$ were
assumed to be identically and independently distributed</p>
<script type="math/tex; mode=display">\mathbf{y=1\mu + Mg + e}</script>
<p>where<br />
<script type="math/tex">\mathbf{g}\;\sim\;N(\mathbf{0},\mathbf{I}\sigma^2_g)</script> <br />
<script type="math/tex">\mathbf{e}\;\sim\;N(\mathbf{0},\mathbf{D}\sigma^2_e)</script></p>
<p>where<br />
<script type="math/tex">d_{ii} = 1/\omega_i</script> <br />
<script type="math/tex">\omega_i = EDC_i/\lambda</script></p>
<p><strong>MME</strong></p>
<script type="math/tex; mode=display">% <![CDATA[
\left[
\begin{array}{cc}
\mathbf{X'R}^{-1}\mathbf{X} & \mathbf{X'R}^{-1}\mathbf{Z}\\
\mathbf{Z'R}^{-1}\mathbf{X} & \mathbf{Z'R}^{-1}\mathbf{Z}+(\mathbf{I}\sigma^2_g)^{-1}
\end{array}\right]
\left[
\begin{array}{c}
\hat{\mathbf{b}}\\
\hat{\mathbf{a}}
\end{array}\right]
=
\left[
\begin{array}{c}
\mathbf{X'R}^{-1}\mathbf{y}\\
\mathbf{Z'R}^{-1}\mathbf{y}
\end{array}\right] %]]></script>
<script type="math/tex; mode=display">% <![CDATA[
\left[
\begin{array}{cc}
\mathbf{X'}\mathbf{X} & \mathbf{X'}\mathbf{Z}\\
\mathbf{Z'}\mathbf{X} & \mathbf{Z'}\mathbf{Z}+\mathbf{I}\lambda
\end{array}\right]
\left[
\begin{array}{c}
\hat{\mathbf{b}}\\
\hat{\mathbf{a}}
\end{array}\right]
=
\left[
\begin{array}{c}
\mathbf{X'}\mathbf{y}\\
\mathbf{Z'}\mathbf{y}
\end{array}\right] %]]></script>
<p>where <br />
<script type="math/tex">\sigma^2_g</script> is the SNP variance for each SNP<br />
<script type="math/tex">\lambda=\sigma^2_e/\sigma^2_g</script> <br />
<script type="math/tex">\sigma^2_a=2\sum_{i=1}^mp_iq_i\sigma^2_g</script></p>
<p>The DGV</p>
<script type="math/tex; mode=display">\mathbf{\hat{a} = 1\hat{\mu} + M\hat{g}}</script>Hongding GaoHere are just some simple notes about these 2 equivalent modelsMAP2017-06-18T00:00:00+00:002017-06-18T00:00:00+00:00http://hongdinggao.github.io/programming/2017/06/18/MAP<p>I am sure every people uses map in their daily life. Map helps people find their target location,
generally speaking, map links people from one lacation to another.</p>
<p>In programming, especially in my field, map is more than crucial. I guess most of the popular languages have map class,
such as C++ and Java. Thanks to map, it helped me a lot in my projects, I use it mostly for all the housekeeping coding
in my program, so I dicide to mark a little bit here.</p>
<p>The map class in C++ is very handy, it avoids writing hash table by myself which is a headache stuff I think.<br />
Some languages use dictionary to achieve the same functionality such as Python, Julia, .Net. In Javascript, PHP and AWK, its name
is associative array. To my knowledge, they are almost mean the same thing.</p>Hongding GaoI am sure every people uses map in their daily life. Map helps people find their target location, generally speaking, map links people from one lacation to another.Back to game2017-06-08T00:00:00+00:002017-06-08T00:00:00+00:00http://hongdinggao.github.io/life/2017/06/08/back-to-game<p><img src="/pics/with_GG.JPG" alt="With Gordon" /></p>
<p>It’s been exactly 2 years since the last update of this website, the main reason is due to my laziness.
Anyway, I decide to be back to the game and push myself to record something randomly and continually.
During the last couple of years, 2 main things happen in my life</p>
<ul>
<li>My son: Gordon has arrived and he is close to 3 month now</li>
<li>My 3 years industrial postdoc project was finished, it was my 1st research funding</li>
</ul>
<p>Life is not that bad for me and I appreciate every morning. At the moment, I spend all my spare
time with my family especially with my son. He is an pretty active guy and seems like super happy
everyday, I hope he would have a wonderful childhood.</p>Hongding GaoIt’s been exactly 2 years since the last update of this website, the main reason is due to my laziness. Anyway, I decide to be back to the game and push myself to record something randomly and continually. During the last couple of years, 2 main things happen in my life My son: Gordon has arrived and he is close to 3 month now My 3 years industrial postdoc project was finished, it was my 1st research funding Life is not that bad for me and I appreciate every morning. At the moment, I spend all my spare time with my family especially with my son. He is an pretty active guy and seems like super happy everyday, I hope he would have a wonderful childhood.Play around with Julia2015-06-09T00:00:00+00:002015-06-09T00:00:00+00:00http://hongdinggao.github.io/julia/2015/06/09/play-around-julia<p>Lately, I start playing with Julia which is a high-level, high-performance dynamic programming language for technical computing.</p>
<p>Meanwhile, I found <a href="http://www.evanmiller.org/why-im-betting-on-julia.html">the nice blog</a>, it clearly illustrates the basic ideas of scientific computing.</p>
<p>The basic workflow for scientific computing should be:</p>
<ol>
<li>Make it work</li>
<li>Make it fast</li>
</ol>
<p>As mentioned in that blog, I have the similar habit for my daily work:</p>
<blockquote>
<p>Normally I use one language to make something work, and a second language to make it fast, and a third
language to make it scream.</p>
</blockquote>
<p>Personlly, I like using <strong>R</strong> to test my algorithm, once the code works, I recode it using <strong>Fortran</strong> or <strong>C</strong>. Sometimes, it’s a bit time-consuming to travelling back and forth between different programming languages. Luckly, here comes the <strong>Julia</strong>, I think it is a promising language and it deserves to be learned.</p>Hongding GaoLately, I start playing with Julia which is a high-level, high-performance dynamic programming language for technical computing. Meanwhile, I found the nice blog, it clearly illustrates the basic ideas of scientific computing. The basic workflow for scientific computing should be: Make it work Make it fast As mentioned in that blog, I have the similar habit for my daily work: Normally I use one language to make something work, and a second language to make it fast, and a third language to make it scream. Personlly, I like using R to test my algorithm, once the code works, I recode it using Fortran or C. Sometimes, it’s a bit time-consuming to travelling back and forth between different programming languages. Luckly, here comes the Julia, I think it is a promising language and it deserves to be learned.