Jekyll2023-04-24T08:10:48+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>
\[\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]\]
\[\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]\]
<p>where $\sigma^2_a$ is the total genetic variance, \(\lambda=\sigma^2_e/\sigma^2_a\) <br />
\(\mathbf{u}\;\sim\;N(\mathbf{0},\mathbf{G}\sigma^2_a)\)</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>
\[\mathbf{y=1\mu + Mg + e}\]
<p>where<br />
\(\mathbf{g}\;\sim\;N(\mathbf{0},\mathbf{I}\sigma^2_g)\) <br />
\(\mathbf{e}\;\sim\;N(\mathbf{0},\mathbf{D}\sigma^2_e)\)</p>
<p>where<br />
\(d_{ii} = 1/\omega_i\) <br />
\(\omega_i = EDC_i/\lambda\)</p>
<p><strong>MME</strong></p>
\[\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]\]
\[\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]\]
<p>where <br />
\(\sigma^2_g\) is the SNP variance for each SNP<br />
\(\lambda=\sigma^2_e/\sigma^2_g\) <br />
\(\sigma^2_a=2\sum_{i=1}^mp_iq_i\sigma^2_g\)</p>
<p>The DGV</p>
\[\mathbf{\hat{a} = 1\hat{\mu} + M\hat{g}}\]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.My first post2015-05-27T00:00:00+00:002015-05-27T00:00:00+00:00http://hongdinggao.github.io/jekyll/2015/05/27/welcome-to-jekyll<p>This is my personal blog based on Jekyll</p>
<p>Jekyll also offers powerful support for code snippets:</p>
<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="k">def</span> <span class="nf">print_hi</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
<span class="nb">puts</span> <span class="s2">"Hi, </span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="s2">"</span>
<span class="k">end</span>
<span class="n">print_hi</span><span class="p">(</span><span class="s1">'Tom'</span><span class="p">)</span>
<span class="c1">#=> prints 'Hi, Tom' to STDOUT.</span></code></pre></figure>
<p>Check out the <a href="http://jekyllrb.com">Jekyll docs</a> for more info on how to get the most out of Jekyll. File all bugs/feature requests at <a href="https://github.com/jekyll/jekyll">Jekyll’s GitHub repo</a>. If you have questions, you can ask them on <a href="https://github.com/jekyll/jekyll-help">Jekyll’s dedicated Help repository</a>.</p>Hongding GaoThis is my personal blog based on Jekyll Jekyll also offers powerful support for code snippets: def print_hi(name) puts "Hi, #{name}" end print_hi('Tom') #=> prints 'Hi, Tom' to STDOUT. Check out the Jekyll docs for more info on how to get the most out of Jekyll. File all bugs/feature requests at Jekyll’s GitHub repo. If you have questions, you can ask them on Jekyll’s dedicated Help repository.