Satyanarayan Rao/2018-04-15T00:00:00+02:00Linear Models2018-04-15T00:00:00+02:002018-04-15T00:00:00+02:00Satyatag:None,2018-04-15:/linear-models.html<h1>Linear model?</h1> <p>Again referring the chapter #1 of Bishop's books, where he describes some fundamental concepts about linearity. </p> <h2>Two apsects</h2> <p>Will be updated soon!</p><h1>Linear model?</h1> <p>Again referring the chapter #1 of Bishop's books, where he describes some fundamental concepts about linearity. </p> <h2>Two apsects</h2> <p>Will be updated soon!</p>Just for fun2018-04-03T00:00:00+02:002018-04-03T00:00:00+02:00Satyatag:None,2018-04-03:/just-for-fun.html<h1>Random thoughts</h1> <p>Its nice to see the following: </p> <div class="math">$$9.1\times{9.1} + 9.1 = 91.91$$</div> <p>I pondered a bit more and it turns out be of the following pattern </p> <div class="math">$$99.1\times{99.1} + 99.1 = 9919.91$$</div> <div class="math">$$999.1\times{999.1} + 999.1 = 999199.91$$</div> <div class="math">$$9999 …</div><h1>Random thoughts</h1> <p>Its nice to see the following: </p> <div class="math">$$9.1\times{9.1} + 9.1 = 91.91$$</div> <p>I pondered a bit more and it turns out be of the following pattern </p> <div class="math">$$99.1\times{99.1} + 99.1 = 9919.91$$</div> <div class="math">$$999.1\times{999.1} + 999.1 = 999199.91$$</div> <div class="math">$$9999.1\times{9999.1} + 9999.1 = 99991999.91$$</div> <p>The pattern in result (RHS) emerges out to be you repeat the number in LHS (<code>9.1</code>) twice without decimals and put the decimal 2<sup>nd</sup> from the right. </p> <p>Still trying to find a mathematical proof that explains why the whole process only has only two digits (<code>9</code> and <code>1</code>)</p> <p>Explanation: </p> <div class="math">$$9.1\times{9.1} + 9.1 = 9.1\times{(9.1 + 1)} = 9.1\times{10.1} = 9.1\times{(10 + 0.1)}$$</div> <div class="math">$$ = 91 + 0.91 = 91.91$$</div> <p>True for others also: the reason behind no having any other digit is because only <code>10</code> and <code>0.1</code> are being used in multiplication.</p> <h1>Orders: not so obvious</h1> <p>Could you guess the next number: </p> <div class="math">$$1, 2, 720, ?</div> <p>Credits: Joe Blitzstein (Harvard Stats 110), will post the youtube link once I find it</p> <script type="text/javascript">if (!document.getElementById('mathjaxscript_pelican_#%@#@#')) { var align = "center", indent = "0em", linebreak = "false"; if (false) { align = (screen.width < 768) ? "left" : align; indent = (screen.width < 768) ? "0em" : indent; linebreak = (screen.width < 768) ? 'true' : linebreak; } var mathjaxscript = document.createElement('script'); mathjaxscript.id = 'mathjaxscript_pelican_#%@#@#'; mathjaxscript.type = 'text/javascript'; mathjaxscript.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML'; mathjaxscript[(window.opera ? "innerHTML" : "text")] = "MathJax.Hub.Config({" + " config: ['MMLorHTML.js']," + " TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'AMS' } }," + " jax: ['input/TeX','input/MathML','output/HTML-CSS']," + " extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']," + " displayAlign: '"+ align +"'," + " displayIndent: '"+ indent +"'," + " showMathMenu: true," + " messageStyle: 'normal'," + " tex2jax: { " + " inlineMath: [ ['\\\$$','\\\$$'] ], " + " displayMath: [ ['','$$'] ]," + " processEscapes: true," + " preview: 'TeX'," + " }, " + " 'HTML-CSS': { " + " styles: { '.MathJax_Display, .MathJax .mo, .MathJax .mi, .MathJax .mn': {color: 'inherit ! important'} }," + " linebreaks: { automatic: "+ linebreak +", width: '90% container' }," + " }, " + "}); " + "if ('default' !== 'default') {" + "MathJax.Hub.Register.StartupHook('HTML-CSS Jax Ready',function () {" + "var VARIANT = MathJax.OutputJax['HTML-CSS'].FONTDATA.VARIANT;" + "VARIANT['normal'].fonts.unshift('MathJax_default');" + "VARIANT['bold'].fonts.unshift('MathJax_default-bold');" + "VARIANT['italic'].fonts.unshift('MathJax_default-italic');" + "VARIANT['-tex-mathit'].fonts.unshift('MathJax_default-italic');" + "});" + "MathJax.Hub.Register.StartupHook('SVG Jax Ready',function () {" + "var VARIANT = MathJax.OutputJax.SVG.FONTDATA.VARIANT;" + "VARIANT['normal'].fonts.unshift('MathJax_default');" + "VARIANT['bold'].fonts.unshift('MathJax_default-bold');" + "VARIANT['italic'].fonts.unshift('MathJax_default-italic');" + "VARIANT['-tex-mathit'].fonts.unshift('MathJax_default-italic');" + "});" + "}"; (document.body || document.getElementsByTagName('head')).appendChild(mathjaxscript); } </script>High-resolution-figures with seaborn and matplotlib2018-03-31T00:00:00+02:002018-03-31T00:00:00+02:00Satyatag:None,2018-03-31:/high-resolution-figures-with-seaborn-and-matplotlib.html<p>Often we run into issues of generating high-resolution figures for publication, and, it is a bit of pain. Let me explain a couple of points which made me write this post.</p> <ul> <li><code>Seaborn (sns)</code> is an awesome tool to do the plotting </li> <li><code>Matplotlib</code> is needed to do nitty-gritty changes in Seaborn …</li></ul><p>Often we run into issues of generating high-resolution figures for publication, and, it is a bit of pain. Let me explain a couple of points which made me write this post.</p> <ul> <li><code>Seaborn (sns)</code> is an awesome tool to do the plotting </li> <li><code>Matplotlib</code> is needed to do nitty-gritty changes in Seaborn plots</li> <li>But saving <code>sns</code> figures (directly in <code>.png</code> format) with matplotlib changes does a poor job of rendering </li> </ul> <p>However, if we take some extra steps then it is possible to get all of we need: </p> <ul> <li>First save the figure in <code>pdf</code> format</li> <li>Try to use third-party tools (<code>ImageMagik</code>) to convert <code>pdf</code> to <code>png</code> </li> </ul> <p>Please see the implementation <a href="https://nbviewer.jupyter.org/github/satyausc/Hail-Python/blob/master/high-resolution-figures/Data_analyzer.ipynb">here</a></p> <p>A figure with detailed use of matplotlib in searborn plots can been viewed <a href="http://media.springernature.com/full/springer-static/image/art%3A10.1186%2Fs13072-018-0174-4/MediaObjects/13072_2018_174_Fig6_HTML.gif">here</a>. All panels except <code>a</code> is generated using seaborn customized with matplotlib. Codes are available <a href="https://zenodo.org/record/1117976#.WsUcv1QrK91">here</a>; see <code>HT_data_analyses</code> and <code>Shape_analyses</code> directories.</p> <p><strong>Credits</strong>: <a href="https://github.com/saketkc">Saket Choudhary</a></p>Bayesian inference to L2-regularized MLR2018-03-09T00:00:00+01:002018-03-09T00:00:00+01:00Satyatag:None,2018-03-09:/bayesian-inference-to-l2-regularized-mlr.html<p>I was really happy to read the chapter 1 of Bishop's Pattern Recognition book and realize the relationship between L2-regularized MLR and Bayesian perspective. On <code>page 30</code>, he shows that if weights follow a gaussian distribution conditioned on selected hyper-parameter, then the maximum likelihood would take the following form: </p> <div class="math">$$ \frac …</div><p>I was really happy to read the chapter 1 of Bishop's Pattern Recognition book and realize the relationship between L2-regularized MLR and Bayesian perspective. On <code>page 30</code>, he shows that if weights follow a gaussian distribution conditioned on selected hyper-parameter, then the maximum likelihood would take the following form: </p> <div class="math">$$\frac{\beta}{2}\sum\limits_{n = 1}^{N} \{y(x_{n}, \mathbf{w}) - t_{n}\}^2 + \frac{\alpha}{2}\mathbf{w}^T\mathbf{w}$$</div> <p>Which is similar to L2-regularized MLR with: </p> <div class="math">$$\lambda = \frac{\alpha}{\beta}$$</div> <p>NOTE: This finding was a result of healthy discussion with <a href="https://github.com/TsuPeiChiu">Tsu-Pei</a>.</p> <p>A good question asked in this context was:</p> <ul> <li>Why do I need to bother about the distribution in cases where the length of weight vector <span class="math">$$\mathbf{w}$$</span> very small, for example, 5 or less than 10. </li> </ul> <p>And my response to this questions was: </p> <ul> <li>Well, probably there may not be any need of regularization in these type of cases. Ideally, we use regularization when we have considerable number of features. </li> </ul> <script type="text/javascript">if (!document.getElementById('mathjaxscript_pelican_#%@#@#')) { var align = "center", indent = "0em", linebreak = "false"; if (false) { align = (screen.width < 768) ? "left" : align; indent = (screen.width < 768) ? "0em" : indent; linebreak = (screen.width < 768) ? 'true' : linebreak; } var mathjaxscript = document.createElement('script'); mathjaxscript.id = 'mathjaxscript_pelican_#%@#@#'; mathjaxscript.type = 'text/javascript'; mathjaxscript.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML'; mathjaxscript[(window.opera ? "innerHTML" : "text")] = "MathJax.Hub.Config({" + " config: ['MMLorHTML.js']," + " TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'AMS' } }," + " jax: ['input/TeX','input/MathML','output/HTML-CSS']," + " extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']," + " displayAlign: '"+ align +"'," + " displayIndent: '"+ indent +"'," + " showMathMenu: true," + " messageStyle: 'normal'," + " tex2jax: { " + " inlineMath: [ ['\\\$$','\\\$$'] ], " + " displayMath: [ ['$$','$$'] ]," + " processEscapes: true," + " preview: 'TeX'," + " }, " + " 'HTML-CSS': { " + " styles: { '.MathJax_Display, .MathJax .mo, .MathJax .mi, .MathJax .mn': {color: 'inherit ! important'} }," + " linebreaks: { automatic: "+ linebreak +", width: '90% container' }," + " }, " + "}); " + "if ('default' !== 'default') {" + "MathJax.Hub.Register.StartupHook('HTML-CSS Jax Ready',function () {" + "var VARIANT = MathJax.OutputJax['HTML-CSS'].FONTDATA.VARIANT;" + "VARIANT['normal'].fonts.unshift('MathJax_default');" + "VARIANT['bold'].fonts.unshift('MathJax_default-bold');" + "VARIANT['italic'].fonts.unshift('MathJax_default-italic');" + "VARIANT['-tex-mathit'].fonts.unshift('MathJax_default-italic');" + "});" + "MathJax.Hub.Register.StartupHook('SVG Jax Ready',function () {" + "var VARIANT = MathJax.OutputJax.SVG.FONTDATA.VARIANT;" + "VARIANT['normal'].fonts.unshift('MathJax_default');" + "VARIANT['bold'].fonts.unshift('MathJax_default-bold');" + "VARIANT['italic'].fonts.unshift('MathJax_default-italic');" + "VARIANT['-tex-mathit'].fonts.unshift('MathJax_default-italic');" + "});" + "}"; (document.body || document.getElementsByTagName('head')).appendChild(mathjaxscript); } </script>CpG/DNA methylation2018-03-09T00:00:00+01:002018-03-09T00:00:00+01:00Satyatag:None,2018-03-09:/cpgdna-methylation.html<h1>CpG methylation</h1> <p>CpG methylation is an epigenetic modification on DNA. At the molecular level, CpG methylation involves the addition of a methyl (CH<sub>3</sub>) group on the C5 atom of cytosine, yeilding 5-methylcytosine (5mC). Although the change is very small, but cumulative effect is profound, for example X-chromosome inactivation. Recent …</p><h1>CpG methylation</h1> <p>CpG methylation is an epigenetic modification on DNA. At the molecular level, CpG methylation involves the addition of a methyl (CH<sub>3</sub>) group on the C5 atom of cytosine, yeilding 5-methylcytosine (5mC). Although the change is very small, but cumulative effect is profound, for example X-chromosome inactivation. Recent work have suggested impact of methylation on protein My research work has revealed insights into the methyl-induced structural deformations and its applications protein-DNA interactions. </p> <h1>My little contribution</h1> <p>In my PhD work, I attempted to explain the effect of CpG methylation on shape-readout, one of the binding recognition mode, utilized by Transription Factors (TFs). The details can be found <a href="https://doi.org/10.1186/s13072-018-0174-4">here</a>. </p>not-academics2018-02-07T00:00:00+01:002018-02-07T00:00:00+01:00Satyatag:None,2018-02-07:/not-academics.html<h1>Photography</h1> <p>I like doing photography. Here are some stills</p> <p><img alt="" src="photos/gallery/selected/dsc_0059a.jpg"></p><h1>Photography</h1> <p>I like doing photography. Here are some stills</p> <p><img alt="" src="photos/gallery/selected/dsc_0059a.jpg"></p>