<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Tony Tsai</title>
    <link>http://blog.tonytsai.name/</link>
    <description>Recent content on Tony Tsai</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 14 Feb 2021 00:00:00 +0000</lastBuildDate><atom:link href="http://blog.tonytsai.name/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Single Page</title>
      <link>http://blog.tonytsai.name/about/</link>
      <pubDate>Sun, 14 Feb 2021 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/about/</guid>
      <description>This is a single page. To create a page similar to this:
Create a new markdown file in contents/page/about.md. Alternatively, create a page bundle contents/page/about/index.md. In the frontmatter of the page, set the value of url to your desired relative path. E.g., for this page we have url = &amp;quot;/about/&amp;quot;. Now you can access the website at baseurl/about and you can link to it from the main menu or sidebar using the relative path.</description>
    </item>
    
    <item>
      <title>Setting PATH Variable for gs Command in RStudio</title>
      <link>http://blog.tonytsai.name/blog/2018-05-07-setting-path-variable-for-gs-command-in-rstudio/</link>
      <pubDate>Mon, 07 May 2018 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2018-05-07-setting-path-variable-for-gs-command-in-rstudio/</guid>
      <description>Update on 2018-07-05
From the discussion with Yihui Xie, if Ghostscript was installed via brew, Homebrew should automatically make symlinks to /usr/local/bin/gs which is already under the PATH. Hence there is no need to set PATH variable for gs. However, the following approach is useful for other commands that are not under the PATH.
These days I am using ImageMagick to convert multiple pdfs (or pngs) into an animation gif to demonstrate the algorithm that I proposed for estimating epidemic onset.</description>
    </item>
    
    <item>
      <title>《流感下的北京中年》与细菌耐药性</title>
      <link>http://blog.tonytsai.name/blog/2018-02-13-%E6%B5%81%E6%84%9F%E4%B8%8B%E7%9A%84%E5%8C%97%E4%BA%AC%E4%B8%AD%E5%B9%B4%E4%B8%8E%E7%BB%86%E8%8F%8C%E8%80%90%E8%8D%AF%E6%80%A7/</link>
      <pubDate>Tue, 13 Feb 2018 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2018-02-13-%E6%B5%81%E6%84%9F%E4%B8%8B%E7%9A%84%E5%8C%97%E4%BA%AC%E4%B8%AD%E5%B9%B4%E4%B8%8E%E7%BB%86%E8%8F%8C%E8%80%90%E8%8D%AF%E6%80%A7/</guid>
      <description>今天春节前2月12日朋友圈被 《流感下的北京中年》刷屏，自己读完，一直在思考为什么一开始的感冒症状最终却走向了阴阳两隔？~~同时因自己的研究课</description>
    </item>
    
    <item>
      <title>Tips for Sharing Data When Collaborating with Other Researchers</title>
      <link>http://blog.tonytsai.name/blog/2017-12-21-tips-for-sharing-data-when-collaborating-with-other-researchers/</link>
      <pubDate>Thu, 21 Dec 2017 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2017-12-21-tips-for-sharing-data-when-collaborating-with-other-researchers/</guid>
      <description>Recently I have been collaborating with others on several research projects. In the process of collaboration, data exchanging is inevitable; however, for collaborators lack of rich experience in data analysis and computer skills, the way that they are sharing the data results in inefficient collaboration. Therefore, I summarize following tips for sharing data when collorating with other researchers.
First of all, please include a README file describing the data, including file contents, variable names, value formats, units etc.</description>
    </item>
    
    <item>
      <title>Detecting Non-breaking Space in R</title>
      <link>http://blog.tonytsai.name/blog/2017-12-04-detecting-non-breaking-space-in-r/</link>
      <pubDate>Mon, 04 Dec 2017 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2017-12-04-detecting-non-breaking-space-in-r/</guid>
      <description>Last night while I was cleaning data in R, I encountered such a weird behavior of unique() function that I once suspected that there had been something wrong with the newly updated R 3.4.3. The following is a reproducible example of my problem.
I read in a vector variable x from csv file, and printed it on R console.
x ## [1] &amp;#34;non-breaking space&amp;#34; &amp;#34;non-breaking space&amp;#34; Apparently, x contained two &amp;ldquo;identtical&amp;rdquo; elements and it should have only one unique value.</description>
    </item>
    
    <item>
      <title>pip for Different Versions of Python on macOS Sierra</title>
      <link>http://blog.tonytsai.name/blog/2017-09-07-pip-for-different-versions-of-python-on-macos-sierra/</link>
      <pubDate>Thu, 07 Sep 2017 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2017-09-07-pip-for-different-versions-of-python-on-macos-sierra/</guid>
      <description>Three versions of Python exist on my macOS Sierra. The first one is the original Python come with macOS. The other two are Python 2 and Python 3 installed by brew.
To load the raw Python 2 interpreter inside the terminal, type
$ python Python 2.7.10 (default, Feb 7 2017, 00:08:15) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin Type &amp;#34;help&amp;#34;, &amp;#34;copyright&amp;#34;, &amp;#34;credits&amp;#34; or &amp;#34;license&amp;#34; for more information. &amp;gt;&amp;gt;&amp;gt; To load the brew-installed Python 2 interpreter inside the terminal, type</description>
    </item>
    
    <item>
      <title>Narrative Outline of My Talk at the 10th China R Conference</title>
      <link>http://blog.tonytsai.name/blog/2017-05-23-narrative-outline-of-my-talk-at-the-10th-china-r-conference/</link>
      <pubDate>Tue, 23 May 2017 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2017-05-23-narrative-outline-of-my-talk-at-the-10th-china-r-conference/</guid>
      <description>The 10th China R Conference was held in Tsinghua University during May 19 - 21. I initialized the session of R in Public Health. Though it was my first time to organize a session, to invite speakers, and to host it, the session was successful. The number of audiences was more than 55 persons and beyond my expectation, and the discussions were enthusiastic. I believe that via my talk more Chinese have known the R Epidemics Consortium (RECON) and they may try to use RECON packages to facilitate their epidemics research.</description>
    </item>
    
    <item>
      <title>Derivation of Number of Infected Individuals I(a)</title>
      <link>http://blog.tonytsai.name/blog/2017-04-22-derivation-of-number-of-infected-individuals-ia/</link>
      <pubDate>Sat, 22 Apr 2017 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2017-04-22-derivation-of-number-of-infected-individuals-ia/</guid>
      <description>( Hens et al. 2012, 63:41) gives the formula for the total number of infective individuals \(I(a)\):
$$ \begin{equation} I(a) = \frac{\lambda}{\lambda - \nu}N(0)l(a)\left[e^{-\nu a} - e^{-\lambda a}\right], \tag{1} \end{equation} $$
which is obtained by integrating following differential equation with respect to age \(a\):
$$ \begin{equation} \frac{dI(a)}{da}=\lambda S(a) - (\nu + \mu)I(a). \tag{2} \end{equation} $$
This is also equation (4.11) in ( Anderson and May 1992, 67). Here I will present the details of integration.</description>
    </item>
    
    <item>
      <title>Display Multi-line Equations and Matrix Correctly in Hugo</title>
      <link>http://blog.tonytsai.name/blog/2017-01-05-display-multi-line-equations-and-matrix-correctly-in-hugo/</link>
      <pubDate>Thu, 05 Jan 2017 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2017-01-05-display-multi-line-equations-and-matrix-correctly-in-hugo/</guid>
      <description>The first test case is to create a matrix consisting of following elements $$ \begin{matrix} 1 &amp;amp; x &amp;amp; x^2 \ 1 &amp;amp; y &amp;amp; y^2 \ 1 &amp;amp; z &amp;amp; z^2 \ \end{matrix} $$
but all elemments of the matrix are displayed in one line. Fortunately, this can be solved by wraping the math expression inside a &amp;lt;div&amp;gt; &amp;lt;/div&amp;gt; block, which is hinted by the hugo documents of MathJax Support.</description>
    </item>
    
    <item>
      <title>Optimization of Disk Usage for animint</title>
      <link>http://blog.tonytsai.name/blog/2015-08-09-optimization-of-disk-usage-for-animint/</link>
      <pubDate>Sun, 09 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2015-08-09-optimization-of-disk-usage-for-animint/</guid>
      <description>Problem The easy test for becoming a potential student of animint project for GSoC 2015 is to use animint to visualize some data from your domain of expertise, and upload your visualization to the web using animint2gist. I used animint to visualize the data from the CDC&amp;rsquo;s State-level FluView, which is a main data source of my Ph.D. influenza research. The script for generating the FluView viz can be found in AnimintTest repository.</description>
    </item>
    
    <item>
      <title>Operator for Extracting Named List Elements to Variables</title>
      <link>http://blog.tonytsai.name/blog/2015-05-21-operator-for-extracting-named-list-elements-to-variables/</link>
      <pubDate>Thu, 21 May 2015 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2015-05-21-operator-for-extracting-named-list-elements-to-variables/</guid>
      <description>In routine data analysis, I often need to convert list elements into variables. For exampple, when I create a function returning multiple values and I would like to use those values as variables separately, as only one object can be returned by the function, the common way to accomplish this task is that multiple values are combined as a list returned by the function, elements of interest are then extracted and assigned to variables.</description>
    </item>
    
    <item>
      <title>Resources for Influenza Research</title>
      <link>http://blog.tonytsai.name/blog/2015-05-10-resources-for-influenza-research/</link>
      <pubDate>Sun, 10 May 2015 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2015-05-10-resources-for-influenza-research/</guid>
      <description>Today I made a list of resources for influenza research. I will keep updating this list as my influenza research goes further. The up-to-date version can be found on my github.
Contents Infectious Diseases Epidemiology Modeling Infectious Diseases Topics and Keywords Ecology and Evolution of Influenza Seasonality of Influenza Dynamics of Influenza Influenza Transmission Influenza Forecasting Digital Detection of Influenza Databases for Influenza Research Workshops and Conferences MOOCs Contributing Topics and Keywords Influenza | Flu Pandemic (Antigenic Shift) vs.</description>
    </item>
    
    <item>
      <title>Why Does the Jackknife Estimate of Standard Error Have the Factor (n-1)/n?</title>
      <link>http://blog.tonytsai.name/blog/2015-04-23-why-does-the-jackknife-estimate-of-standard-error-have-the-factor-n-1/n/</link>
      <pubDate>Thu, 23 Apr 2015 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2015-04-23-why-does-the-jackknife-estimate-of-standard-error-have-the-factor-n-1/n/</guid>
      <description>Today I read 7.2 The Jackknife in Stastical Computing with R and found the explanation for why the jackknife estimate of standard error have the factor $(n-1)/n$ is unclear. I refered to An Introduction to the Bootstrap by Bradley Efron and R. J. Tibshirani, and the slides of jackknife by Rozenn Dahyot to figure out the reason. Here is my understanding for the existence of factor $(n-1)/n$.
The jackknife samples are computed by leaving out one observation $x_i$ from a sample $\mathbf{x} = (x_1, x_2, \cdots, x_n)$ at a time: $$ \mathbf{x}_{(i)} = (x_1, x_2, \cdots, x_{i-1}, x_{i+1}, \cdots, x_n) $$ for $i = 1, 2, \cdots, n$.</description>
    </item>
    
    <item>
      <title>Stratified Importance Sampling</title>
      <link>http://blog.tonytsai.name/blog/2015-04-20-stratified-importance-sampling/</link>
      <pubDate>Mon, 20 Apr 2015 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2015-04-20-stratified-importance-sampling/</guid>
      <description>The following R codes implement the Example 5.13 in Statistical Computing with R, and compare the estimate \(\hat{\theta}\) and \(\hat{\sigma}\) from stratified importance sampling to the results from importance sampling. The example illustrates that stratification can reduce the varinace of importance sampling estimator.
M &amp;lt;- 100000 # number of replicates g &amp;lt;- function(x) { exp(-x - log(1 + x^2)) * (x &amp;gt; 0) * (x &amp;lt; 1) } # importance sampling u &amp;lt;- runif(M) # f3, inverse transform method x &amp;lt;- -log(1 - u * (1 - exp(-1))) fg &amp;lt;- g(x) / (exp(-x) / (1 - exp(-1))) (theta.</description>
    </item>
    
    <item>
      <title>SIRS Model with Time Dependent Transmission Rate</title>
      <link>http://blog.tonytsai.name/blog/2014-12-04-sirs-model-with-time-dependent-transmission-rate/</link>
      <pubDate>Thu, 04 Dec 2014 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2014-12-04-sirs-model-with-time-dependent-transmission-rate/</guid>
      <description>1 SIRS Model The SIRS model is simply an extension of the SIR model as it allows members of the recovered class to rejoin the susceptible class at a defined rate, which integrates the impact of waning immunity following antigenic drift. Similar to the SIR model, a fixed population without births and deaths is considered in the SIRS model. The standard form of SIRS model is described as $$ \begin{equation} \begin{aligned} &amp;amp; \frac{dS}{dt} = fR - \frac{\beta SI}{N} \\ &amp;amp; \frac{dI}{dt} = \frac{\beta SI}{N} - \gamma I \\ &amp;amp; \frac{dR}{dt} = \gamma I - fR \end{aligned} \label{eq1} \end{equation} $$ where \(f\) is the average loss of immunity rate of recovered indiviuals, and the other notations are the same as the SIR model.</description>
    </item>
    
    <item>
      <title>Gains from Paper Reading</title>
      <link>http://blog.tonytsai.name/blog/2014-12-03-gains-from-paper-reading/</link>
      <pubDate>Wed, 03 Dec 2014 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2014-12-03-gains-from-paper-reading/</guid>
      <description>因探究流感传染能力、存活能力与湿度的关系，今天自己将两年前读过的一篇论文（ Shaman.Kohn-PNAS-2009）又翻出来重新读了一遍，</description>
    </item>
    
    <item>
      <title>Precision Difference of ode45 between R and MATLAB</title>
      <link>http://blog.tonytsai.name/blog/2014-11-24-precision-difference-of-ode45-between-r-and-matlab/</link>
      <pubDate>Mon, 24 Nov 2014 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2014-11-24-precision-difference-of-ode45-between-r-and-matlab/</guid>
      <description>ode45 solvers from both R and MATLAB are used to run simulations of the spread of Hong Kong flu in New York city with different initial susceptible individuals \(S\_0 =\) 790, 7900, 79000, 790000, and 7900000. The maximum infected people \(I_{max}\) under each condition is recorded for comparison. The following codes draw a figure showing the precision difference of ode45 solvers between R and MATLAB.
Imax &amp;lt;- data.frame(S0 = 79 * 10 ^ (1:5), R = c(57.</description>
    </item>
    
    <item>
      <title>RK4 Method for Solving SIR Model</title>
      <link>http://blog.tonytsai.name/blog/2014-11-24-rk4-method-for-solving-sir-model/</link>
      <pubDate>Mon, 24 Nov 2014 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2014-11-24-rk4-method-for-solving-sir-model/</guid>
      <description>My object is to rewrite the 4th order Runge-Kutta (abbreviated for RK4) method for solving the absolute humidity-driven SIRS model developed by Yang et al. (2014) in R language. The details of the SIRS model are provided in the paper.
1 RK4 1.1 Preliminary RK4 is one of the classic methods for numerical integration of ODE models. A brief introduction of RK4 refers to Wikipedia.
Consider the following initial value problem of ODE $$ \begin{equation} \begin{aligned} &amp;amp; \frac{dy}{dt} = f(t, y) \\ &amp;amp; y(t_0) = y_0 \end{aligned} \label{eq1-rk4} \end{equation} $$ where \(y(t)\) is the unknown function (scalar or vector) which I would like to approximate.</description>
    </item>
    
    <item>
      <title>Problems with adduser on Ubuntu and Solutions</title>
      <link>http://blog.tonytsai.name/blog/2014-09-30-problems-with-adduser-on-ubuntu-and-solutions/</link>
      <pubDate>Tue, 30 Sep 2014 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2014-09-30-problems-with-adduser-on-ubuntu-and-solutions/</guid>
      <description>最近想为Ubuntu服务器增加一个用户，然后ssh远程登录使用。折腾了好久总算搞定，现将过程中遇到的问题记录下来，以便将来参考。 1. 创建新用户</description>
    </item>
    
    <item>
      <title>Commonly Used ArcGIS Tools by Myself</title>
      <link>http://blog.tonytsai.name/blog/2014-09-21-commonly-used-arcgis-tools-by-myself/</link>
      <pubDate>Sun, 21 Sep 2014 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2014-09-21-commonly-used-arcgis-tools-by-myself/</guid>
      <description>ArcGIS toolbox提供了丰富的工具，但只有一些是在平常的空间数据处理过程中自己会用到。即使如此，每次自己进行一个处理操作时都要再去google</description>
    </item>
    
    <item>
      <title>Host Is Down Using curl/wget While Page Loads in Browser</title>
      <link>http://blog.tonytsai.name/blog/2014-08-23-host-is-down-using-curl/wget-while-page-loads-in-browser/</link>
      <pubDate>Sat, 23 Aug 2014 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2014-08-23-host-is-down-using-curl/wget-while-page-loads-in-browser/</guid>
      <description>问题描述 最近想更新自己开发的 geoChina，发现在Mac上运行以下代码 library(geoChina) geocode(&amp;#39;Tsinghua University&amp;#39;, api = &amp;#39;google&amp;#39;, ocs = &amp;#39;GCJ-02&amp;#39;, messaging = T) 出错，返回 1 2 3 4 5 6 calling http://maps.googleapis.com/maps/api/geocode/json?address=Tsinghua%20University&amp;amp;sensor=false ... Warning message: In readLines(connect, warn = FALSE) :</description>
    </item>
    
    <item>
      <title>Introduction to git and GitHub</title>
      <link>http://blog.tonytsai.name/blog/2014-07-13-introduction-to-git-and-github/</link>
      <pubDate>Sun, 13 Jul 2014 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2014-07-13-introduction-to-git-and-github/</guid>
      <description>git安装 推荐 Homebrew用于管理常用开源软件包在Mac OS X上的安装和升级。Homebrew用Ruby语言开发，支持千余种开源软件在 Mac OS</description>
    </item>
    
    <item>
      <title>A Chinese Beamer for Ecophilosophy Class Presentation</title>
      <link>http://blog.tonytsai.name/blog/2013-12-04-a-chinese-beamer-for-ecophilosophy-class-presentation/</link>
      <pubDate>Wed, 04 Dec 2013 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2013-12-04-a-chinese-beamer-for-ecophilosophy-class-presentation/</guid>
      <description>用Beamer做英文 slides已经尝试过了，做中文slides一直没有尝试过。借着研究生最后一门课程——生态哲学——课堂展示的机会，做了一</description>
    </item>
    
    <item>
      <title>Use IPv6 in an ISATAP Way</title>
      <link>http://blog.tonytsai.name/blog/2013-06-10-use-ipv6-in-an-isatap-way/</link>
      <pubDate>Mon, 10 Jun 2013 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2013-06-10-use-ipv6-in-an-isatap-way/</guid>
      <description>地学前沿最后一次课是和宫老师一起吃饭聊天（主要是听宫老师讲），期间宫老师提到了他写的一篇文章 How to find an academic job，挂在了他在berkely的个人</description>
    </item>
    
    <item>
      <title>How to Connect to VMware Machine (CentOS 6.4) via SSH</title>
      <link>http://blog.tonytsai.name/blog/2013-06-08-how-to-connect-to-vmware-machine-centos-6.4-via-ssh/</link>
      <pubDate>Sat, 08 Jun 2013 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2013-06-08-how-to-connect-to-vmware-machine-centos-6.4-via-ssh/</guid>
      <description>之前使用CentOS虚拟机都是在GUI里操作，四年前配置的笔记本实在吃不消，非常的卡，都没有了工作的欲望。最近在做《高性能计算导论》课程作业</description>
    </item>
    
    <item>
      <title>A Beamer for Doctoral English Class Final Presentation</title>
      <link>http://blog.tonytsai.name/blog/2013-06-07-a-beamer-for-doctoral-english-class-final-presentation/</link>
      <pubDate>Fri, 07 Jun 2013 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2013-06-07-a-beamer-for-doctoral-english-class-final-presentation/</guid>
      <description>用 Beamer做博士英语课程presentation的 slides，觉得不错的朋友可以下载 tex源文件研究，欢迎交流。</description>
    </item>
    
    <item>
      <title>Create Your Blog with Jekyll</title>
      <link>http://blog.tonytsai.name/blog/2013-04-28-create-your-blog-with-jekyll/</link>
      <pubDate>Sun, 28 Apr 2013 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/blog/2013-04-28-create-your-blog-with-jekyll/</guid>
      <description>在使用Jekyll搭建个人blog之前，确认你的PC安装有Jekyll。最简单的安装Jekyll方法是通过RubyGems，RubyGems</description>
    </item>
    
    <item>
      <title>Archive page</title>
      <link>http://blog.tonytsai.name/archive/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/archive/</guid>
      <description>Blog archive</description>
    </item>
    
    <item>
      <title>Douban</title>
      <link>http://blog.tonytsai.name/douban/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>http://blog.tonytsai.name/douban/</guid>
      <description></description>
    </item>
    
  </channel>
</rss>
