Nov 272012
 

Two common mistakes when writing statistics software

最近在写一个软件,发现两个常见的错误:

1. 缺失 数据的处理

对于缺失数据,表示上可以是NA, “.”, -9,应该先保证软件读入的数字是正确的。

之后,在模型中,是应该丢掉数据,还是impute数据?是impute到均值还是用随机数值?

在写软件的时候必须要清楚。

 

2. 数值运算的维数

在统计中,常常有大量的数值运算,比如矩阵相乘。

在文章中这类运算往往会忽略维数,比如矩阵的行数和列数。

这时候软件中应加入更多的边界检查,这样就能避免程序崩溃。

 

 

Nov 262012
 

一些思考方法
Some way of thinking

一直以来,导师和一些优秀的同学都有不同寻常的有趣的思考方式、交流方式。通过和他们的接触,我总结了一些思考方法。

1. STAR

与别人交流学术往往在于交流方法,交流思考的方式。而人由于所处环境,学习过程的影响,往往有不同的知识结构。比如学习空间统计的人,往往把问题往空间统计模型上靠。这时,有效的交流不是两个人在各自的领域发表见解,而应该是了解对方的思想。
在这种场合,可以使用STAR方法。

STAR方法通常在找工作时回答Behavior Question时使用。它指的是(wiki):

The STAR (Situation, Task, Action, Result) format is a job interview technique used by interviewers to gather all the relevant information about a specific capability that the job requires. This interview format is said[by whom?] to have a higher degree of predictability of future on-the-job performance than the traditional interview.

  • Situation: The interviewer wants you to present a recent challenge and situation in which you found yourself.
  • Task: What did you have to achieve? The interviewer will be looking to see what you were trying to achieve from the situation.
  • Action: What did you do? The interviewer will be looking for information on what you did, why you did it and what were the alternatives.
  • Results: What was the outcome of your actions? What did you achieve through your actions and did you meet your objectives. What did you learn from this experience and have you used this learning since?

The STAR technique is similar to the SOARA technique.

当我们讨论一个学术问题时,在提出解决方案之前,应该在问题的Situation上首先取得共识。在Task方面,我们应该确定行动的目的,或者解决问题的程度,并了解自己的局限(比如时间精力)。之后在Action上了解自己应该怎么做,具体分步骤怎么做。最后在Result部分,可以可以思考完成整个流程自己学了什么,有哪些经验可以为其他工作所用,向导师汇报,与同学交流等等。

STAR方法在交流学术问题,阐述自己的能力上很有用。它本质上希望能站到对方的角度看问题,从对方的处境,思维方式,行为方式来思考。因此它是提高交流能力的方法。

STAR方法还可以稍作扩展用在写作上,这形成一种写作的结构 (Organize information in terms of problem-solution Hoey 1983):

  1. Description of a situation
  2. Identification of a problem
  3. Description of a solution
  4. Evaluation of the solution

这种方法在科技论文写作中很有用。

2. 五问法

五问法,或者称“五个为什么”,“5 Whys” 是丰田创造的应用于制造业的管理方法。先举两个例子:

(1)(http://www.iceo.com.cn/guanli/110/2012/0807/254654.shtml)

一、工厂的地板上有一摊油,为什么?

答:因为机器漏油。

二、为什么机器会漏油?

答:因为油箱破了。

三、为什么油箱会破?

答:因为我们所采购的油箱材质较差。

四、为什么我们所采购的油箱材质较差?

答:因为价格低。

五、为什么我们要采购价格低但质量差的油箱?

答:对采购员的奖励是视短期节省的开支而定,而不是看长期的绩效表现。

(2)(http://zh.wikipedia.org/wiki/%E4%BA%94%E4%B8%AA%E4%B8%BA%E4%BB%80%E4%B9%88)

  • 我的汽车无法启动。(问题)
  1. 为什么?电池电量耗尽。(第一个为什么)
  2. 为什么?交流发电机不能正常工作。(第二个为什么)
  3. 为什么?:交流发电机皮带断裂。(第三个为什么)
  4. 为什么?:交流发电机皮带远远超出了其使用寿命,从未更换过。(第四个为什么)
  5. 为什么?:我一直没有按照厂家推荐的保养计划对汽车进行过保养和维护。(第五个为什么,根本原因

在实际应用当中,有可能将这种提问进一步扩展到六问、七问,甚至是更多的“为什么”。

从这两个例子可以看出,五问法是一种破茧抽丝,追根究底,找出问题根源的思考方法。在软件开发中,在面对一个bug时,我们如何修正错误呢?就地修改自然是“最省时间”,但是这解决问题了么?如果软件本身架构蹩脚,图方便的就地修改可能会带来长期的隐患。

从研究上讲,最重要的就是弄清问题。先用五问法对一个研究问题彻底搞清楚,才有利于下一步的印证或者仿真。值得注意的是,每一次新的发文,都要在核实、查证上一个为什么的答案是不是禁得起推敲。不然五次发问都是表面功夫。这就丧失了五问法的意义。

 

3. 六顶思考帽

六顶思考帽是一个拓展思维广度,协助决策分析的思维工具。它把思维的类型用六种颜色的帽子来表示。

http://www.mindtools.com/pages/article/newTED_07.htm

  • White Hat:
    With this thinking hat you focus on the data available. Look at the information you have, and see what you can learn from it. Look for gaps in your knowledge, and either try to fill them or take account of them. This is where you analyze past trends, and try to extrapolate from historical data.
  • Red Hat:
    ‘Wearing’ the red hat, you look at problems using intuition, gut reaction, and emotion. Also try to think how other people will react emotionally. Try to understand the responses of people who do not fully know your reasoning.
  • Black Hat:
    Using black hat thinking, look at all the bad points of the decision. Look at it cautiously and defensively. Try to see why it might not work. This is important because it highlights the weak points in a plan. It allows you to eliminate them, alter them, or prepare contingency plans to counter them. Black Hat thinking helps to make your plans ‘tougher’ and more resilient. It can also help you to spot fatal flaws and risks before you embark on a course of action. Black Hat thinking is one of the real benefits of this technique, as many successful people get so used to thinking positively that often they cannot see problems in advance. This leaves them under-prepared for difficulties.
  • Yellow Hat:
    The yellow hat helps you to think positively. It is the optimistic viewpoint that helps you to see all the benefits of the decision and the value in it. Yellow Hat thinking helps you to keep going when everything looks gloomy and difficult.
  • Green Hat:
    The Green Hat stands for creativity. This is where you can develop creative solutions to a problem. It is a freewheeling way of thinking, in which there is little criticism of ideas. A whole range of creativity tools can help you here.
  • Blue Hat:
    The Blue Hat stands for process control. This is the hat worn by people chairing meetings. When running into difficulties because ideas are running dry, they may direct activity into Green Hat thinking. When contingency plans are needed, they will ask for Black Hat thinking, etc.

简单来说,白色注重事实;红色注重直觉和感觉;黑色是悲观角度;黄色是乐观角度;绿色要求创新;蓝色要求对思考进行思考。

通过交替使用不同的思维,来扩展对问题多种角度的考量。

个人认为这个思考方法在于转换自己的思维方式,增加思维的广度。

 

 

Nov 142012
 

制作Scientific Poster
How to make scientific poster

做一个好的poster需要用Illustrator,简单的来讲,Poster中任何非文字的部分都应该采取矢量图(公式、图示、表格),而文字部分应该在Illustrator里完成。

如果想我一样从没用过Illustrator,应该看这个youtube教学视频,这个视频专门针对Scientific Poster分八讲讲解Illustrator中各个细节。

下面一些链接都很有用:
UMichigan library link

Illustrator Creating Text

Scientific Poster Design

A good pattern of color