Wednesday, September 19, 2012

[Repaste]How to input Latex formulas in you blogspot


Repaste: http://tex.stackexchange.com/questions/13865/how-to-use-latex-on-blogspot
Use MathJax. It's a AJAX engine for LaTeX syntax that now is distributed by a CDN so you don't have to upload a single file to your blogspot account.
Add HTML/JavaScript tool in blogspot and 
To enable MathJax, just drop in
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js">
MathJax.Hub.Config({
 extensions: ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js"],
 jax: ["input/TeX", "output/HTML-CSS"],
 tex2jax: {
     inlineMath: [ ['$','$'], ["\\(","\\)"] ],
     displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
 },
 "HTML-CSS": { availableFonts: ["TeX"] }
});
</script>
Save.
See the MathJax pages for more information about configuring and using it.

PS: It seems that read from RSS will see the source code of Latex.  Still don't know how to solve this problem.

Tuesday, September 18, 2012

James-stain's Shrinkage Estimator

Everything begins with the same old story: Once there is a variable vector named $\underline{x}$(ps: In Canada, underline represents vector) obey normal distribution, elements of $\underline{x}$ is not correlated. assume $\sigma$ is known, that is :
$\underline{x}\sim N(\underline{\theta},\sigma^{2}I)$, $\underline{X} \in \mathbf{R}$
so the Maximum Likelihood Estimation of $\underline{\theta}$ will be :
$\underline{\widehat{\theta}} = \underline{\overline{x}}$
The MLE is the best estimation according to the Gauss-Markov theorem:
Among all linear unbiased estimators of $\underline{\theta}$, the above $\underline{\widehat{\theta}}$ has the smallest variance.
To any estimation, square loss is defined as:
$L(\theta,\widehat{\theta}) = E||\theta - \widehat{\theta}||^{2}$
since estimator
 $\underline{\widehat{\theta}} = E(\underline{\theta})+\underline{bias}$
$L(\theta,\widehat{\theta}) = E||\underline{\theta}-E(\underline{\theta})-\underline(bias)||^2$
$=E||\underline{\theta}-E(\underline{\theta})||^2 + E||\underline{bias}||^2 - 2E||\underline{bias^{T}}(\underline{\theta}-E(\underline{\theta}))||^2$  
for
$E||\underline{bias^{T}}(\underline{\theta}-E(\underline{\theta}))|| = 0$
so
$L(\theta,\widehat{\theta}) = Var(\underline{\widehat{\theta}}) + bias^{2}(\underline{\widehat{\theta}})$
So the loss is composed of bias and variance. As to MLE, the bias is 0, loss is only contributed by variance. Will it be possible that loss some on bias and gain more on variance and make L smaller than $L_{MLE}$?

The main idea of James-stain's shrinkage estimator is when the dimension of  variables p is bigger than 2,  introduce a little bias can gain more on variance and the total loss will be smaller than  $L_{MLE}$. That is
$\underline{\widehat{\theta}} = \underline{\overline{x}}+c(\underline{x}-\underline{\overline{x}})$
in which, c is a shrinkage factor.  The essential process in stain's method is the "shrinking" of all individual averages toward the grand average.  The actual value is determined by the collection of all the observed averages. Even though there is no correlation between elements in $\underline{x}$. So you can estimate totally irrelevant variables together such as baseball score and rates of imported cars to get a better result than estimating them separately.  Both theoretically and practically, it's been proved can provide better estimation than MLE. In the example given in "Stain's paradox in statistics"(B. Efron and C. Morris, 1977, American Scientific). When estimating a player's score together with other 45 players', c is about 0.2, that is about 20%'s shrinkage.

A equivalent form of stain's estimator is
$\underline{\widehat{\theta}} = (1-\frac{(p-2)\sigma^2}{||\underline{x}||^2})\underline{x}$ 
when $p>2$, you can prove
 $L_{JS}<L_{MLE}$.
Next: shrinkage in regression
To be continued....

Reference
W. James and Charles Stain. Estimation with quadratic loss. 1961.
B. Efron and C. Morris. Stein's paradox in statistics. 1977.

PS: Writing in English is so hard.....:)

Monday, September 17, 2012

Mistakes in English Writing

估计这个外国审稿人实在是看不下去这么多中国式英语了,所以专门针对中国人撰写科技论文常犯的错误写了一篇文章《Mistakes in English Writing》。大概要注意的几点:
  1. "a, an"指不明确的名词,"the"指明确的名词。
  2. 避免太长的句子,一个句子表达两个以内的主题(一个主句和一个从句)。当有枚举变量取值的时候,使用列表的形式可更容易阅读。
  3. 将要表达的中心观点放在最前面,将原因,时间,地点等放在其后。
  4. "Which, what"要区分, "Which"一般在指向不确定的情况下使用。
  5. "Respectively"要在放到句子的最后面,用作指向之前的枚举。
  6. 不要使用两次以上的"In this paper", "In this study",这一般出现在文章开头的介绍和文章结尾的总结,可使用"In this research/work"代替。"In this study"指这项研究工作,在介绍研究的实验方法时可以用,而"In this paper"指读者所拿到的这篇文章,在介绍实验方法时不能使用。
  7. 在一句话的开头不能出现阿拉伯数字以及英文缩写。
  8. 数字一般用于表示实验数据,一般性的介绍时尽量避免使用阿拉伯数字,使用英文单词代替。
  9. 全文使用统一风格的缩写,比如全文使用"Figure"或"Fig."等,而不要混合使用。
  10. 在句子中避免直接使用方程,可尽量使用语言描述方程所表达的意思。比如使用"Biger than" 替代">"。
  11. 对不同含义的英文单词及字母以斜体表示,比如变量名。
  12. 段落首行缩进且空行。
  13. "such as"用于句中表示示例不完全枚举(等于"for example"),"etc."用于句尾,表示 "and so on", 同“等等”。
  14. 部分名词单复同形:equipment,stuff(全体员工)),faculty(全体教员),literature。
  15. 避免用词含义冗余,比如使用"research"或work代替"research work"。还有Limit condition,Knowledge memory,Sketch map,Layout scheme,Arrangement plan,Output performance,Simulation results,Knowledge information,Calculation results,Application results。
  16. 使用"by doing this","using this method"替代"by this way"。
  17. 不要在句首使用"How to..."。
  18. 避免使用"Obviously"。