Saturday, August 25, 2012

Mean-independence implies zero covariance


Intuitively: a (population) regression of u on x is the linear approximation to E (u|x). The regression would yield a slope coefficient of Cov (u, x) /V (x). If E (u|x) = E (u), the conditional expectation function is a constant. Therefore, a linear approximation to it would yield a slope of zero, which implies that Cov(u, x) =0.

Formally,
E (u|x) = E(ux|x)/x and therefore E (ux|x) = xE (u|x).

But the law of iterated expectations implies that E (ux) =E [E (ux|x)] . Therefore,
E (ux) = E [E (ux|x)] = E [xE (u|x)]

If E (u|x) = E (u), we have that E (ux) = E [xE (u|x)] = E [xE (u)] = E (x)E (u)

Because Cov (u, x) = E (ux) − E (x)E (u), we have shown that E (u|x) = E (u) implies that
Cov (u, x) = 0.

Vim Directories


The present working directory can be displayed in Vim with:

:pwd

To change to the directory of the currently open file (this sets the current directory for all windows in Vim):

:cd %:p:h

You can also change the directory only for the current window (each window has a local current directory that can be different from Vim's global current directory):

:lcd %:p:h

In these commands, % gives the name of the current file, %:p gives its full path, and %:p:h gives its directory (the "head" of the full path).

Automatically change the current directory

Sometimes it is helpful if your working directory is always the same as the file you are editing. To achieve this, put the following in your vimrc:

set autochdir

That's it! Unfortunately, when this option is set some plugins may not work correctly if they make assumptions about the current directory. Sometimes, as an alternative to setting autochdir, the following command gives better results:

autocmd BufEnter * silent! lcd %:p:h

This autocmd changes the window-local current directory to be the same as the directory of the current file. It fails silently to prevent error messages when you edit files via ftp or new files. It works better in some cases because the autocmd is not nested, and will therefore not fire when switching buffers via another autocmd. It will also work in older versions of Vim or versions compiled without the 'autochdir' option. Note, however, that there is no easy way to test for this autocmd in a script like there is for the 'autochdir' option.

Either of these methods will "cd" to the directory of the file in the current window, each time you switch to that window.

Wednesday, August 22, 2012

vim auto correction


You can just type :source /path/to/the/autocorrect.vim to load up the corrections. 

Tuesday, August 21, 2012

Folding of Vim for Beamer

http://sourceforge.net/projects/latex-beamer/forums/forum/319189/topic/1163579
- Create a file ~/.vim/after/syntax/tex.vim with the following content:
-----------------------------
syn region Frame start="\\begin{frame}" end="\\end{frame}" keepend transparent fold
function FoldText()
let line = getline(v:foldstart+1)
let sub = substitute(line, '\\frametitle', '', 'g')
let num = v:foldend - v:foldstart + 1
return " - [" . num . "]" . sub
endfunction
set foldtext=FoldText()
-----------------------------
- Then add to ~/.vimrc :
-----------------------------
set foldmethod=syntax
-----------------------------

The importance of stupidity in scientific research bt Martin A. Schwartz


recently saw an old friend for the first time in many years. We had been Ph.D. students at the same time, both studying science, although in different areas. She later dropped out of graduate school, went to Harvard Law School and is now a senior lawyer for a major environmental organization. At some point, the conversation turned to why she had left graduate school. To my utter astonishment, she said it was because it made her feel stupid. After a couple of years of feeling stupid every day, she was ready to do something else.
I had thought of her as one of the brightest people I knew and her subsequent career supports that view. What she said bothered me. I kept thinking about it; sometime the next day, it hit me. Science makes me feel stupid too. It's just that I've gotten used to it. So used to it, in fact, that I actively seek out new opportunities to feel stupid. I wouldn't know what to do without that feeling. I even think it's supposed to be this way. Let me explain.
For almost all of us, one of the reasons that we liked science in high school and college is that we were good at it. That can't be the only reason – fascination with understanding the physical world and an emotional need to discover new things has to enter into it too. But high-school and college science means taking courses, and doing well in courses means getting the right answers on tests. If you know those answers, you do well and get to feel smart.
A Ph.D., in which you have to do a research project, is a whole different thing. For me, it was a daunting task. How could I possibly frame the questions that would lead to significant discoveries; design and interpret an experiment so that the conclusions were absolutely convincing; foresee difficulties and see ways around them, or, failing that, solve them when they occurred? My Ph.D. project was somewhat interdisciplinary and, for a while, whenever I ran into a problem, I pestered the faculty in my department who were experts in the various disciplines that I needed. I remember the day when Henry Taube (who won the Nobel Prize two years later) told me he didn't know how to solve the problem I was having in his area. I was a third-year graduate student and I figured that Taube knew about 1000 times more than I did (conservative estimate). If he didn't have the answer, nobody did.
That's when it hit me: nobody did. That's why it was a research problem. And being my research problem, it was up to me to solve. Once I faced that fact, I solved the problem in a couple of days. (It wasn't really very hard; I just had to try a few things.) The crucial lesson was that the scope of things I didn't know wasn't merely vast; it was, for all practical purposes, infinite. That realization, instead of being discouraging, was liberating. If our ignorance is infinite, the only possible course of action is to muddle through as best we can.
I'd like to suggest that our Ph.D. programs often do students a disservice in two ways. First, I don't think students are made to understand how hard it is to do research. And how very, very hard it is to do important research. It's a lot harder than taking even very demanding courses. What makes it difficult is that research is immersion in the unknown. We just don't know what we're doing. We can't be sure whether we're asking the right question or doing the right experiment until we get the answer or the result. Admittedly, science is made harder by competition for grants and space in top journals. But apart from all of that, doing significant research is intrinsically hard and changing departmental, institutional or national policies will not succeed in lessening its intrinsic difficulty.
Second, we don't do a good enough job of teaching our students how to be productively stupid – that is, if we don't feel stupid it means we're not really trying. I'm not talking about `relative stupidity', in which the other students in the class actually read the material, think about it and ace the exam, whereas you don't. I'm also not talking about bright people who might be working in areas that don't match their talents. Science involves confronting our `absolute stupidity'. That kind of stupidity is an existential fact, inherent in our efforts to push our way into the unknown. Preliminary and thesis exams have the right idea when the faculty committee pushes until the student starts getting the answers wrong or gives up and says, `I don't know'. The point of the exam isn't to see if the student gets all the answers right. If they do, it's the faculty who failed the exam. The point is to identify the student's weaknesses, partly to see where they need to invest some effort and partly to see whether the student's knowledge fails at a sufficiently high level that they are ready to take on a research project.
Productive stupidity means being ignorant by choice. Focusing on important questions puts us in the awkward position of being ignorant. One of the beautiful things about science is that it allows us to bumble along, getting it wrong time after time, and feel perfectly fine as long as we learn something each time. No doubt, this can be difficult for students who are accustomed to getting the answers right. No doubt, reasonable levels of confidence and emotional resilience help, but I think scientific education might do more to ease what is a very big transition: from learning what other people once discovered to making your own discoveries. The more comfortable we become with being stupid, the deeper we will wade into the unknown and the more likely we are to make big discoveries.

Monday, August 20, 2012

Writing Research Paper

http://anthropology.ua.edu/bindon/ant570/pap_rule.htm

In a research report (dissertation/thesis/article) when you are talking about what you did you use the past tense. In fact, most of the paper should be in the past tense.  “In this study, Thai people’s eating habits were (or “have been”) investigated.  It was found that Thai people like to eat.”  Notice “investigation” is in the past since it is over at the point where you are writing the dissertation, but “like to eat” is kept in the present because it expresses a reality that is still true in your opinion.  Here it would sound strange to me to say, “It was found that Thai people liked to eat,” even though some authors would insist in both verbs being in the past in order to retain order through parallelism.

As a writer, you have to decide what you want to communicate, and then choose the verb/tense form that makes the most sense in the context.  It is a good idea to use language that is as standard as possible so you do not draw the reader’s attention away from the ideas you are trying to communicate and toward the language itself. However, if you try to follow the “rules” of form too strictly, that too can create situations where you find yourself saying things that border on the absurd, like “Thai people liked to eat.”
The main point is choose the tense, and other matters, according to how you want the reader to perceive the “event.”

http://eflwriting4life.wordpress.com/2011/03/06/tense-use-for-research-papers/

Present tense is used for relating what other authors say and for discussing the literature, theoretical concepts, methods, etc. In addition, use the present tense when you present your observations on the literature.

Past tense is used for recounting events, results found, etc.

Verb tense consistency


1.  Use present tense when writing essays about
  • your own ideas 
  • factual topics
  • the action in a specific movie, play, or book

2. Use past tense when writing about
  • past events
  • completed studies or findings,  arguments presented in scientific literature

3. Use future tense when writing about
  • an event that will occur in the future.

Saturday, August 18, 2012

Friday, August 17, 2012

Social Interactions vs. Economic Interactions


Can we make an analogy between market prices and social norms? Both of them are coordinating mechanism for economic or social interactions. Prices signal relative scarcity of corresponding resources. Norms signals relative popularity of corresponding actions. 

Tuesday, August 14, 2012

Ostrom 2000 Collective Action and the Evolution of Social Norms

Results from experimental evidence and from the field has shown that there are multiple types of individuals with different attitude towards reciprocity and cooperation. Besides rational egoist, which are the type that economist usually assume, two type of norm-using players -- conditional cooperators and willing punishers --  play an important role in the formation and maintenance of social norms.

Evolutionary theories can help explain the emergence and survival of multiple types of players, i.e. how different types of preferences evolve or adapt. Indirect evolutionary model assumes that players receive objective payoffs, but make decisions based on the transformation of these material rewards into intrinsic preferences. In this model, individuals have different predispositions and act accordingly. Those preferences can also adapt given the objective payoffs received and their intrinsic preferences.

The assumption of multiple types is vital in explaining social norms, In particular, when a player's type is common knowledge, rational egoists would not survive. In situations where a noisy signal about a player's type is available that is at least more informative than random, trustworthy types will survive as a substantial proportion of the population.


Saturday, August 11, 2012

Literature Review: Synthesizing Multiple Sources


Do not think of synthesis as separate parts lined up next to one another. Think of synthesis as “smoothed” integration of the parts. It is integration of support from more than one source for one idea/argument and identification of how sources are related. Just as fruit is blended together to make a smoothie so should you blend your sources together.

People synthesize information naturally to help other see the connections between things they learn. Synthesis is related to but not the same as classification, division, or comparison and contrast.  Instead of attending to categories or finding similarities and differences, synthesizing sources is a matter of pulling them together into some kind of harmony.  Synthesis searches for links between materials for the purpose of constructing a thesis or theory. It requires that you bring  together background information on a topic and organize it by topic rather than by source, to present the information that is out there in a helpful and logical way.

Key Features of a Synthesis
(1)  It accurately reports information from the sources using different phrases and sentences;
(2)  It is organized in such a way that readers can immediately see where the information from the sources overlap;.
(3)  It makes sense of the sources and helps the reader understand them in greater depth


 In writing the literature review, your purpose is to convey to your reader what knowledge and ideas have been established on a topic, and what their strengths and weaknesses are. As a piece of writing, the literature review must be defined by a guiding concept (e.g., your research objective, the problem or issue you are discussing, or your argumentative thesis). It is not just a descriptive list of the material available, or a set of summaries
Besides enlarging your knowledge about the topic, writing a literature review lets you gain and demonstrate skills in two areas
  1. information seeking: the ability to scan the literature efficiently, using manual or computerized methods, to identify a set of useful articles and books
  2. critical appraisal: the ability to apply principles of analysis to identify unbiased and valid studies.
A literature review must do these things
  1. be organized around and related directly to the thesis or research question you are developing
  2. synthesize results into a summary of what is and is not known
  3. identify areas of controversy in the literature
  4. formulate questions that need further research

Ask yourself questions like these:

  1. What is the specific thesis, problem, or research question that my literature review helps to define?
  2. What type of literature review am I conducting? Am I looking at issues of theory? methodology? policy? quantitative research (e.g. on the effectiveness of a new procedure)? qualitative research (e.g., studies )?
  3. What is the scope of my literature review? What types of publications am I using (e.g., journals, books, government documents, popular media)? What discipline am I working in (e.g., nursing psychology, sociology, medicine)?
  4. How good was my information seeking? Has my search been wide enough to ensure I've found all the relevant material? Has it been narrow enough to exclude irrelevant material? Is the number of sources I've used appropriate for the length of my paper?
  5. Have I critically analysed the literature I use? Do I follow through a set of concepts and questions, comparing items to each other in the ways they deal with them? Instead of just listing and summarizing items, do I assess them, discussing strengths and weaknesses?
  6. Have I cited and discussed studies contrary to my perspective?
  7. Will the reader find my literature review relevant, appropriate, and useful?

Ask yourself questions like these about each book or article you include:

  1. Has the author formulated a problem/issue?
  2. Is it clearly defined? Is its significance (scope, severity, relevance) clearly established?
  3. Could the problem have been approached more effectively from another perspective?
  4. What is the author's research orientation (e.g., interpretive, critical science, combination)?
  5. What is the author's theoretical framework (e.g., psychological, developmental, feminist)?
  6. What is the relationship between the theoretical and research perspectives?
  7. Has the author evaluated the literature relevant to the problem/issue? Does the author include literature taking positions she or he does not agree with?
  8. In a research study, how good are the basic components of the study design (e.g., population, intervention, outcome)? How accurate and valid are the measurements? Is the analysis of the data accurate and relevant to the research question? Are the conclusions validly based upon the data and analysis?
  9. In material written for a popular readership, does the author use appeals to emotion, one-sided examples, or rhetorically-charged language and tone? Is there an objective basis to the reasoning, or is the author merely "proving" what he or she already believes?
  10. How does the author structure the argument? Can you "deconstruct" the flow of the argument to see whether or where it breaks down logically (e.g., in establishing cause-effect relationships)?
  11. In what ways does this book or article contribute to our understanding of the problem under study, and in what ways is it useful for practice? What are the strengths and limitations?
  12. How does this book or article relate to the specific thesis or question I am developing?

Final Notes:

A literature review is a piece of discursive prose, not a list describing or summarizing one piece of literature after another. It's usually a bad sign to see every paragraph beginning with the name of a researcher. Instead, organize the literature review into sections that present themes or identify trends, including relevant theory. You are not trying to list all the material published, but to synthesize and evaluate it according to the guiding concept of your thesis or research question
If you are writing an annotated bibliography, you may need to summarize each item briefly, but should still follow through themes and concepts and do some critical assessment of material. Use an overall introduction and conclusion to state the scope of your coverage and to formulate the question, problem, or concept your chosen material illuminates. Usually you will have the option of grouping items into sections—this helps you indicate comparisons and relationships. You may be able to write a paragraph or so to introduce the focus of each section

Wednesday, August 1, 2012

Manski JEP 2000 Economic Analysis of Social Interactions


Charles F. Manski Journal of Economic Perspectives 2000

Empirical research on social interactions is in a weak state.
Nonmarket interactions

General competitive equilibrium-- economic agents interact only through market prices. nonmarket interactions are not phenomena of intrinsic interest. They are problems of incomplete markets that may prevent the economy from achieving a social optimum. Welfare economics prescribed that the externalities created by nonmarket interactions should, if possible, be eliminated by setting property rights that would permit trade to take place.

non-cooperative game theory: encourages economists to see all interactions as games, with markets as special cases. รจ phenomena as far from traditional economic concerns as social norms

Labor economics has developed from a field that studies wages of workers to the decision of families and households. Much of the research has considered family or household as one utility-maximizing entity and thus abstract from the interactions among the members of the entity.  It is useful to consider members have different objectives.

The action of an agent can affect the actions of other agents through three channels: constraints, expectations and preferences.
Constraints: congestion analysis. The decisions of agents to engage in some activities collectively determine their costs, which in turn determine the activity bundles that are feasible for agents to choose.
Expectations: An agent can acquire information from the actions of other people and sometimes with information on corresponding outcomes as well.  The information help the agent form expectations and hence make decisions. What are the outcomes of certain actions. Information cascade serves as an example of interaction through expectations.
Observational learning generates expectations interactions.

Preference: conformity.
(Becker 2000) use the average of a decision variable in a society as a proxy for social norms which deviation causes a decrease in utility.
In noncooperative game theory , agents interact through preferences, because the utility that each agent receives depends on the actions chosen by other agents.
On which side to drive… is an example