Friday, 13 August 2010

Calculating the standard error of marginal effects using the delta method, in R

Here's a little piece of code I used to calculate marginal effects on probabilities in a non-linear (bivariate probit) model, using the Delta Method.

Warning: I am not a proper statistician. Use at your own risk!

# to create the model:
library(VGAM)
mbvp.1 <- vglm(cbind(decision_matrices.1-1, decision_matrices.6-1) ~ defect_other, binom2.rho, data=ds, trace=TRUE)

# needed to compute the gradient of my function numerically
library(numDeriv)
# needed for a multivariate normal distribution
library(mvtnorm)
# bv is a vector of betas
# this calculates the change in predicted probabilities
f <- function (bv) {
    rho <- rhobit(bv[3], inverse=T)
    p <- array(dim=c(2,2,2))
    for (c1 in 0:1) {
        for (c2 in 0:1) {
            for (d_o in 0:1) {
                sgn1 <- 2*c1 - 1
                sgn2 <- 2*c2 - 1
                ############################################
                # the probability of making choice (c1,c2) 
                # when the independent variable
                # defect_other=d_o:
                ############################################
                p[c1+1,c2+1,d_o+1] <- pmvnorm(upper=c(sgn1*(bv[1]+bv[4]*d_o),sgn2*(bv[2]+bv[5]*d_o)), corr=matrix(c(1,sgn1*sgn2*rho,sgn1*sgn2*rho,1), nrow=2))
            }
        }
    }
    # I use the global firstdec so that the function conforms to what grad() expects
    # the total probability of choosing 1 for either the first
    # or the second decision:
    if (firstdec) p[2,2,2]+p[2,1,2]-p[2,2,1]-p[2,1,1] else p[2,2,2]+p[1,2,2]-p[2,2,1]-p[1,2,1]
}


firstdec <- TRUE
pred[1] <- f(coef(mbvp.1))
gradient <- grad(f, coef(mbvp.1))
# ===== this is the delta method ====
predse[1] <- sqrt(gradient %*% vcov(mbvp.1) %*% gradient)

firstdec <- FALSE
pred[2] <- f(coef(mbvp.1))
gradient <- grad(f, coef(mbvp.1))
predse[2] <- sqrt(gradient %*% vcov(mbvp.1) %*% gradient)

margprobs <- cbind(pred, se=predse, Z=pred/predse, p=2*pnorm(-abs(pred/predse)))
print(margprobs, digits=3)

Saturday, 31 July 2010

Very interesting discussion about academia

... over at The Atlantic.

My tuppenorth:

  • at least half the added value of university for undergraduates is the other undergraduates. If you hang around with clever, interesting people, that expands your brain - and most 18 year olds pay more attention to other 18 year olds than their professors, for some reason - plus, if your friends go on to be important and influential, then you have a network.
  • this means that for universities, nothing succeeds like success. (Economic term: multiple equilibria.) No matter how good a community college's teaching, it will be less attractive than Harvard because Harvard has Harvard students.
  • This gives famous universities the chance to extract rents: they can charge a lot more than they actually provide by way of teaching etc. You are paying for the name and the networking.
  • These rents go into research. 
  • The authors are damn right that a lot of research is useless. The problem is, research is like advertising: half of the money spent on it is wasted, but nobody knows which half.

Friday, 23 July 2010

A few tidbits from the pilot experiment

Subjects were divided into three groups. Each played a prisoner's dilemma against another subject from a different group (the "prisoner's dilemma partner" or "PD partner"). Then, each of them made a set of allocations between themselves and other subjects - who were identified by group and player number, but who were not the same as their PD partner.

We call the group of each subject's prisoner's dilemma partner the MET group;  the third group is the OTHER group.

When the PD partner defected, subjects made more allocations that harmed the other player. This difference was larger when making allocations against others from the MET group:
The effect is clearer for subjects who had themselves cooperated in the prisoner's dilemma:
For some decisions, being nasty to the other player actually cost the subject money. Not surprisingly there were fewer of those allocations, but the same pattern is observed:
and again the pattern is even stronger for PD cooperators.
Of course this is just the pilot, and I haven't yet done any rigorous statistical significance tests.

Saturday, 17 July 2010

Why don't evolutionary economists believe in equilibrium?

This is a provocative question for Arianna and others of her persuasion. Much of it goes over similar ground to Paul Samuelson's address to a conference of evolutionary economists a couple of years ago.

Evolutionary economics takes its cue from biology and sees the economy as an ecosystem, with an endless variety of different "species" (firm strategies) competing, right? And as a result EEers reject the rationalistic concept of equilibrium, whether market or game-theoretic. The world is always moving forward, never at rest, and behaviour is never perfectly adjusted between different actors.

I find these claims pretty plausible, and ironically more plausible in my field -- political economy, where straight Nash Equilibrium is completely dominant -- than in the study of markets.

But.

1. Biologists use equilibrium concepts all the time, and these concepts were adapted from game theory by John Maynard Smith. Indeed, instead of being looser than "rational" game theory, evolutionary game theory concepts actually make tighter predictions: an Evolutionarily Stable Strategy is always a Nash Equilibrium, but not the other way round.

2. Equilibrium has been tested in the lab, and holds up pretty well -- e.g. in auction markets. I am not claiming we can naively generalize from the lab to real markets. But if it works well in the lab, doesn't that support the underlying theory?

3. One major use of equilibrium predictions is to generate comparative statics (ie predictions that if parameter X varies, outcome variable Y will vary with it in some specific way). Even if economies never reach equilibrium, the forces pushing them towards equilibrium may still generate the same comparative statics. For example, although the voting behaviour that we observe is not compatible with the main equilibrium voting models -- people vote too much -- still, they vote less when the election is less competitive, as the models predict.

4. Social science is all about the search for surprising insights. Equilibrium concepts -- more fundamentally, the idea that people react to incentives -- are a good way to generate these insights. (One random example: smoking bans in pubs might increase child cancer, because more people stay at home and smoke there.)

So, what's wrong with equilibrium?

Monday, 12 July 2010

New paper

There's a new work-in-progress on my website. It's with Ro'i Zultan and is called "Brothers in Arms: Cooperation in Defence". A poster is here.

We started this paper to try and resolve a puzzle in social science and biology. Often, unrelated individuals help each other when they face an external attacker. For example, an estimated 200,000 people were active members of the French Resistance in World War II. In the laboratory, we can observe a similar phenomenon under controlled conditions: cooperation increases in the presence of an external threat. Non-humans do it too. For instance, musk oxen band together to drive off wolves.

This is a puzzle because, economically, helping others seems to have costs but no benefits. Or, biologically speaking, this behaviour should decrease the fitness of the animals who display it.

We explain this cooperation by invoking signalling theory. Some groups are  prepared to cooperate, for example because they are kin, or because they are in long-term cooperative relationships. Other groups consist of self-interested individuals. Attackers are strategic: they prefer to attack groups who will not help each other. (Think of the bandits in the Magnificent Seven.) If they start to think they are attacking a very cooperative group, they will look for another target. Then, even self-interested individuals have an incentive to help each other during an attack, as this will deter further attacks.

So far you might get with common sense. However, economists and others may be asking "surely the group's reputation for cooperativeness is a public good, just like defence itself, and will be underprovided". Here, our theoretical model shows one possible answer: the series of repeated attacks gives this public good a "weakest-link technology". That is, if you are the first person not to help during an attack, then the attacker immediately recognises that previous helping was fraudulent and can no longer be deterred. This in turn gives a strong incentive to help when it's your turn.

The paper is here.

Saturday, 10 July 2010

At the demo

Arianna persuaded me to go to the anti-Nazi demo in Gera today. The local fascists were having a sort of annual picnic.

Gera is quite pretty, not like the stereotype of a run-down East German town. If I were an artist I'd buy myself 1000 sq m of old warehouse, cheap as chips.

We avoided the Black Bloc, who looked like teenagers out for a fight, and joined the main crowd on the bridge. Tons of police. Some Christians playing samba. A couple of guys doing capoeira. Soon th Nazis come across the bridge, under heavy police escort. They have to cross in single file, accompanied by our chants of "Nazis raus!" Most are big, tough, aggressive-looking guys. A few scrawny girls. They look as if they enjoy the hate, so is it really effective? Maybe the point is to make sure that people who don't enjoy the hate are put off.

We go and eat at the SĂ€chsische Bahnhof, a cool place in a beautiful old run-down building. When we get back, the demo is gone and the Nazis are listening to speeches. The world Volk appears a lot. We must not allow our Volk to be destroyed!

East Germany is really not a multicultural place: I don't know what they are afraid of. As it happens, I think there are some legitimate reasons to worry about immigration. But actual anti-immigration sentiment always seems to be irrational and driven by primal human fear of strangers.

If this is Europe's biggest Nazi-fest as the flyers said, we have little to fear. There were maybe 1000 people there. The event was a bit smaller than Wivenhoe village fĂȘte.

The demo was supported by Die Linke, Germany's Left populist party. I think they are a much bigger threat to European democracy than the neo-Nazis. But they play by democratic rules so they have to be tolerated. And the populist threat is not just from the Left. The French assembly is preparing to ban the Burqa. This is a direct assault on liberal freedoms. But some people misguidedly support it because of an ill-thought-out feminism. Have I quoted J S Mill before? Never mind: "His own good, whether physical or moral, is not a sufficient warrant."

Thursday, 8 July 2010

CAP

OMG listen to this vile political gitweasel!

"In looking at the EU budget, Lyon admitted that there would be downward pressure from member states facing their own economic crises but believed that the benefits from a robust CAP far outweighed any reason to reduce the cash in this particular part of the EU budget."

 Screw the CAP, man. It's just a prime example of a policy that benefits nobody. It's like a canker on the rotting corpse of European policy. What the hell are the benefits from it? There are zero Goddamn benefits, except for a few fat-arsed dole-blodging millionaire farmers.

Robust CAP? Gag me with a spoon.



I think it's time for breakfast.

Monday, 17 May 2010

Straight people having gay marriages

Very interesting article here. Interesting comments too. Re my previous blog post... does marriage-lite help or hinder commitment?

Saturday, 8 May 2010

What's good for the goose...

I'm a Thatcherite. I believe in the magic of competition. I just can't help it. When I see an overregulated industry with a few lazy, inefficient incumbents, I instinctively think "tear down the barriers to entry!"

That should apply to politics too. What Britain has had for 60 years is a two-party duopoly. People are now sick of both parties. It would be much healthier if they faced some bracing competition from smaller, nimbler players. We should tear down the main barrier to political entry, which is the First Past The Post electoral system. Demand a referendum on PR now!

Thursday, 6 May 2010

Money well spent?

"The immediate political liability for this lies with Mr. Brown and the Labour Party, which engaged in a spree of epic proportions after taking power in 1997, spending at a rate that has outstripped inflation by 41 percent. The current budget of about $1.1 trillion includes more than $150 billion on the state-run National Health Service, triple the amount when Labour came to power.

One in every four pounds the government spends is borrowed, a pattern that economists say will require the next government to make cuts on a scale not experienced since the Great Depression, as well as painful tax increases."

Wednesday, 5 May 2010

The dilemma

The Lib Dems are loons. Their policies are a mix of the interesting and the bloody silly. In the ordinary course of politics, sometimes the main parties nick their best ideas. I would not be thrilled to experience their worst ones. And Nick Clegg... well, to me he seems like a blank space on to which the electorate are projecting their hopes. Mr Not The Other Two.

But the Lib Dems are loons *because* of the two party system. If you want to go into government, you have to join the Tories or Labour. The Lib Dems get the leftovers. If they had more chance of getting into office, they would attract more talented politicians. Electoral reform would let that happen. And liberal ideas -- the deep underlying ones, not the wacko policy proposals -- are pretty decent ones. Liberalism is more alive as a set of ideas than anything Labour has got.

So, do you vote for the loons now, in the hope of getting something better later?

Saturday, 1 May 2010

Election thoughts 2

Dream: a Tory - Lib Dem alliance. Clegg forces electoral reform on to the agenda and we get a referendum between the status quo and some moderate form of PR like the Alternative Vote system. Vince Cable becomes chancellor instead of that little pink feller Osborne. Tory radicalism on education is tempered with a concern for equality. The Libs' dafter ideas are sidelined.

Nightmare: a Lib-Lab alliance. Labour have austerity for two years, then resume pouring money into the public sector. It doesn't work, of course, and public cynicism extends to include the Lib Dems. We gradually become more like a normal European economy - slow-growing, sclerotic and riven by the populism of an embittered majority.*

In between these I would obviously prefer Tory to Labour.

Quite a tough choice therefore - go for strengthening Clegg's hand or play it safe and vote Tory?... Anyway, I voted by post so now it's up to you lot.

* [purple passage]

Monday, 5 April 2010

Leaving the uk tomorrow

Been weird coming back here. The place feels like it's waking up with a hangover, from a party which turned really sour. Atmosphere of congealed greed and mistrust. (Not wanting to go overboard here. But.)

Wednesday, 31 March 2010

General election

I've been wavering between the Lib Dems and the Tories. (1997: Labour. 2005: Lib Dem.)

The Lib Dems:
+ have Vince Cable who made the right calls before and during the economic crisis. I wish he could be chancellor
+ want electoral reform, which may well be a good idea
- do not seem very coherent
+ have a strain of liberalism
- have a strain of social democracy
+ opposed the war

The Tories:
+ are broadly pro-market, which I think is in general a good thing, despite the financial crisis
- David Cameron has a character issue. I do not get the feeling he has much strength of will or very clear ideas
+ ... but I liked his conference speech, which made devolution of power the central theme
- have too many Old Etonians. Class privilege is bad
- ... in particular George Osborne, who does not seem to know his job
- ... and their response to the financial crisis was not impressive
+ want the Swedish schools reform. Education is the biggest issue for me
+ seem to have some smart people on their team (Hague, Willetts, Gove)

I now intend to vote Tory, after reading the Lib Dems' education policy. (It's incoherent. Their diagnosis is "too much central control", and their cure is "give power back to Local Education Authorities". Gove's plan is much better.)

Saturday, 6 February 2010

A million monkey puns.

Political scientists worry about democracy because voters are rationally ignorant. That is, since you are unlikely to decide any election on your own, it doesn't make sense to learn about political issues which you cannot affect. This theory is supported by a lot of evidence: most people really don't know very much about politics.  (Even hardworking political scientists.)

Democrats respond with an argument that goes back to the Marquis de Condorcet. Even if no individual voter knows much, they are still likely to make the right decision. For example, think of a jury deciding whether to convict someone. Even if every individual on the jury is only a little bit more likely to be right than wrong, when they all vote together, the majority is quite likely to come out on top. And if millions of people were on the jury, then the right decision would almost certainly be made. The famous political scientist Skip Lupia put it like this: unless voters are Dumber Than Chimps, they are likely to make the right decision in the aggregate.

So, by this Condorcet Jury Theorem, democracy should work quite well. It's a bit like one of those stories where a million monkeys (or chimps) bash away at typewriters and one of them eventually produces Hamlet. Voters may not know much, but on average, they'll get to the right decision. The Theorem works for more complicated decisions than simple guilty/innocent choices. Suppose we vote on how much to spend on hospitals. Different people have different views, some of them quite wacky, but on average, the median voter is just right. Half the people want to spend too little, and half want to spend too much. If so, then a proposal to spend exactly the right amount will beat any other proposal. (If the other proposal is lower, at least half the voters will prefer the higher amount; if it's higher, at least half will prefer the lower amount.) And a political candidate who promises to spend the right amount will make a monkey out of any other candidate.

However, I think the Jury Theorem is completely bananas.

First, it depends on the idea that people are right on average. But there is no reason to expect that. Remember, people are wrong because they are uninformed, because informing yourself would be costly. Bob Dylan's The Hurricane is a song about Rubin Carter, a black man wrongly accused of murder:

"To the white folks who watched he was a revolutionary bum
And to the black folks he was just a crazy nigger
Noone doubted that he pulled the trigger" 

Almost everybody thought that Carter was guilty. Of course, a little investigation would have uncovered serious flaws in the case against him. But in a big jury vote, nobody has the incentive to do the investigating - it was left up to a few public-spirited journalists and activists. Uninformed people will not, in general, be right on average.

The other gorilla in the room is that even if people's views are right on average, they may not choose the right policy on average. This is a little subtler, so if maths makes you go ape, you can skip the next bit. Suppose we are deciding how much to spend on defence, and we face a national rival. We aren't sure about this rival's political ideology: is it to the left of us like Soviet Russia? Or to the right like Nazi Germany? (Maybe it's modern China.) The farther it is from us, the more we ought to spend.

In fact, our rival has just the same ideology as us. We need to spend almost nothing. And "on average", people know this. But their views vary - some people think that our rival is leftist, some people think its rightist. So, if we vote on military spending, we would end up spending quite a hairy amount.  The voter with the middle estimate of the other country's ideology, who correctly thinks we should spend nothing, is right at the bottom in terms of the spending he wants.

Of course, if we voted on the facts of the matter, we would get them right. But in practice, most policy decisions depends on hundreds of facts, and there's no practical way we could vote on them all. So, even if people were miraculously right about all the facts - on average - they wouldn't necessarily choose the right candidate, or make the right policy decisions.

To sum up, if you put a million monkeys in a room, you might end up with Shakespeare. But you might just end up with a banana fight and a lot of faeces throwing.

Wednesday, 20 January 2010

Myths

Bryan Caplan surely had bad luck with the timing of his book "The Myth of the Rational Voter", which argues that voters are irrational because they don't think like economists, and that we should trust markets relatively more. (I am caricaturing.) It came out in April 2007. Two years later, economists' credibility has been battered, and the policy of trust in markets has got as much legs as a paraplegic snail. A shame, because he has some interesting points.

Tuesday, 5 January 2010

Thoughts

When I was younger, I assumed only poor people had children without getting married. Now I have reached the age where friends of mine are having children. Either I was mistaken, or my generation's behaviour is different. I know a lot of couples who have had children out of wedlock. The circumstances varied. Sometimes couples decided to have a child without getting married. Sometimes a girl got pregnant accidentally and decided to keep the baby. Then the man stayed with her but without marriage, or left.
Everybody has their own life to live. It is easy to moralize, but much harder to live up to your own moral standards, or other people's.
Still, I am worried about this change. It is better for a child to have two parents who are committed to each other. Because people's feelings are very variable, it is better to commit to each other with a public promise. If two people are not ready to make that public promise, then I do not think it is the right time for them to have a child.
This issue evokes strong feelings in me because of my own family history. Other people with different stories might have different feelings. All these emotions deserve respect, but they do not replace facts. The claims I have just made are in line with the social science evidence. Children from married parents have "better outcomes" than children living with two unmarried parents, or with single parents. That jargon term means that they are happier, do better in school and so forth. (I am not an expert in this area and the science is no more settled than in any other social science topic. Google Scholar has been my friend here.)
There are many reasons why people's choices about marriage have been changing. Two important ones may be culture and laws.
Up until the 1950s, sexual and family culture was not very free. There were a whole set of rules that applied to people. Sometimes these rules were enforced by formal institutions: for example, unmarried mothers might be forced to give up their children for adoption. But I believe that mostly they were enforced by social pressure. People who broke the rules could be shunned by their peers. Many of these rules were unjust. Different standards applied to men and women. Gay sex was seen as wrong and gay people were stigmatized. In some places even interracial marriage was disapproved of or banned. The rules were mainly justified by religion.
In the 1960s, more people started to reject these rules, for all sorts of reasons but partly
because they thought they were unfair. Since then, it has widely been thought wrong for us to judge other people's behaviour by any rules. Of course, many things are agreed to be bad (like murder and defrauding old ladies). But there used to be a big layer of behaviours classified as not illegal, but immoral. That layer, between the illegal and the totally OK, has got thinner.
One reason is a sort of liberalism. We feel that it is not our business to judge other people's lives. There is a quote in a letter by Henry James: "remember that every life is a special problem which is not yours but another’s and content yourself with the terrible algebra of your own."
Whatever the merits of this argument, it is not in the classical liberals. John Stuart Mill, for example, thought that only behaviour that harmed others should be legally banned. But it was fine for individuals and society to avoid and shun people for a much wider range of things. He may even have thought that these informal sanctions were essential ways for a free society to maintain itself. (I don't have On Liberty to hand.)

I believe that by refusing to make any moral judgments, beyond the really obvious ones on crimes, our society probably threw out the baby with the bathwater. It ought to be possible to have a system for making moral judgments that would not be (e.g.) sexist or homophobic, and would not be based in religious reasons that many people might reject. It would also be a good idea if that system were public -- not in that it was uniformly agreed upon by everyone with no differences, but in that it was publicly discussed and argued about, and not simply seen as an extension of our personal preferences.
I think that one of the informal rules ought to be: people should try to bring up children in monogamous couples. As marriage is a good way to show you are serious about being a monogamous couple, perhaps having children in marriage would be the right way to do it. And in particular, if you are a man and you get someone pregnant, you ought to marry that person.
That is what I meant by culture. I don't think anything I have said is very original, but I thought I should add my voice to the people saying it. As this blog post has got quite long, I will save laws for another time. In general, I am worried that more children are born outside marriage, and I am glad that most of my closest friends have got married before having children.

Wednesday, 23 December 2009

back in blighty

I'm back for Christmas, which for once might be white! The trains are packed but England doesn't seem quite as chaotic and rude as I remember it... is that just wishful thinking? Perhaps it's because I travelled first class for the first time in my life.

By the way, here's one thing I love about Germany. Sitting in the cafe idly scanning the supplement of Die Zeit. There's an interesting article about someone doing research on chimps - origins of human morality etc. It seems well-written. I wonder who the journalist is? Ah. JĂŒrgen Habermas.

Sunday, 13 December 2009

Climategate

At first I thought Climategate was a storm in a teacup. I thought about it some more when Bill Easterly jumped in. (See also his interesting comparison with growth econometrics.) So I got reading. Two enjoyable blogs on climate science provided my jumping-in point: realclimate.org (which is, roughly speaking, pro-global-warming) and climateaudit.org (which is roughly anti). I enjoyed finding out how you can inform yourself on this hottest of all topics, and the strengths and weaknesses of the different resources available (scientific papers, blogs and the mainstream media).

Thoughts so far.
  • I don't think the emails can be dismissed as scientists using robust language among themselves. For instance, some have said that the now-infamous phrase "trick to hide the decline" just means a technically clever piece of work. Climateaudit goes into the details, and on their analysis, the trick was not innocuous - it made the science look more settled than it was for the 3rd IPCC report. Similarly, it's wrong (and illegal?) to delete emails or files if you are afraid of a freedom of information request.
  • There seem to have been serious problems with the original "hockey stick" graph. Trying as best I could to read through the scientific papers on this, I thought that Mcintyre and McKittrick were fairly convincing.
  • The hockey stick controversy (which is the context for the most controversial UEA emails) doesn't seem to bear much on whether global warming is happening. We know it is because we have data from weather stations around the world for the past century. The debate is about whether there was a "medieval warm period" when the earth was hotter than today or if today's global warming is unique (since 1000AD). (See here and here for more details.)
  • Even if the medieval era was hotter than today, that wouldn't prove global warming doesn't matter. (The 13th century saw the Black Death, after all.)
  •  There seem to be plenty of other reasons to believe that global warming is real, and that CO2 contributes, and that this might cause severe problems for many parts of the world if we don't stop it. I haven't found anything that persuades me otherwise.
  • ... actually, I think Jon Stewart sums up better than I could.

Sunday, 22 November 2009

Seeking an entry point into the literature

So, can any political scientist/economist out there give me an academic reference about Parliament's oversight role? I know about the literature on Congressional oversight of bureaucracy - patrols and fire alarms, etc. - is there something similar for oversight of the executive and the Cabinet? It would be nice to know about any modelling work, but classics would also be interesting.

Saturday, 21 November 2009

Why is the EU seen as out of touch? Why oh why can that be?

"The [EU Human Rights] Charter is possibly the most wide-ranging human rights treaty in the world today. There are civil rights, political rights, social rights, ecological entitlements, rights for the arts, consumer rights."

Seriously. I'm trying to imagine what rights for the arts are.

Update

OK, read it. Mostly it's a combination of the innocuous and the innocuous-but-meaningless - lots of phrases like "in accordance with the national laws governing the exercise of this right." (I.e., the EU can't violate this right but national governments can carry on as they were before.)

The stuff on collective bargaining, however, is hilarious.

Article 28
Right of collective bargaining and action
Workers and employers, or their respective organisations, have, in accordance with Community law and national laws and practices, the right to negotiate and conclude collective agreements at the appropriate levels and, in cases of conflicts of interest, to take collective action to defend their interests, including strike action.

Article 29
Right of access to placement services
Everyone has the right of access to a free placement service.
Yes! At last, the natural demand of every human for a Jobcentre has been recognized! I think this right was first mentioned by Cicero in his classic treatise "de Jure Naturale Doleblodgiandi".

Link

Tuesday, 17 November 2009

lme false convergence

If you are using the R package lme4, and get error messages about "false convergence", then use the option verbose=TRUE in your call to lmer, and examine the output, which shows how the estimates of your betas change as the estimation proceeds. If you see any values for your betas are rather small, then divide that variable by 10 or 100 or 1000. This seems to help lmer to converge correctly.

Sunday, 18 October 2009

Charter cities


Paul Romer has put up a website with his suggestion for freeing people from lousy rulers: create new "charter cities" they can move to.

I am rather sympathetic. A lot of Europeans in the C19 escaped to America from their lousy rulers. And as the FAQ states, within America, increased mobility was liberating - for example, in the Great Migration, Blacks moved from the South to Northern cities like Chicago.

Also, I have a related paper.

On the other hand, there are issues. One is the effect of competition on the lousy rulers themselves (and all the people who will still be living under them). This need not always make them better, as explained by the sophisticated graph on the left. A bit of competition might make rulers invest more and try harder to keep their people happy - after all, the population provide the ruler's tax base. But if there is so much competition that there's no way the ruler can match it, he may just opt for the short-term strategy and steal everything.
Link

Tuesday, 13 October 2009

Happiness

Apparently, the UK has the lowest quality of life among 10* European countries, despite our higher income. Measures like this are important complements to the standard indicator of GDP. But as Nietzsche said, "Happiness is blessed, therefore it lies."

If a large part of our national income is invested in the future -- say, funding for social science research -- then some of our extra wealth compared to those happy-go-lucky Italians is being put into things that will benefit our children. The choice between GDP growth and quality-of-life is a choice between jam now and jam tomorrow. (In the eighteenth century, overworked English peasants probably had worse quality of life than the lucky inhabitants of Tahiti. Now the comparison is reversed, and we can go to Tahiti for our holidays.) Another way to put it: GDP levels are not very mean-reverting, so if we grow extra this year, we are likely to have that extra GDP for a long time.

That doesn't mean we are better off now. But it does mean that happiness indices and such should be taken with a pinch of salt... and we should be wary of replacing the Protestant work ethic with the ideals of those lotus-eating continentals.

* or is it 7? Great fact-checking, Grauniad.

Saturday, 12 September 2009

Costly signalling

I've just had a coffee at the fabulous Quirinus. They brought it to me in a little white cup with a green jug of milk and a glass of water and a biscuit. They could have brought it in a plastic beaker, it would have tasted the same. But man, what a difference it makes to how it feels!
Conclusion: costly signalling is pervasive, and good crockery matters.

Sunday, 12 July 2009

Modelling

(Apologies for the rhymes...)




Malaysia’s as black as a coalface;
So’s Iran; and our own democrats
Fly in victims to fill Bagram airbase.
I think my epsilons need hats.

I can’t turn the world with a letter
Or integrate beatings with bats,
Explain things till worser seems better:
But I can give my epsilons hats.

While I construct castles of sand art
From the stylized and hideous facts,
The world’s off to hell in a handcart.
Best give those epsilons some hats!

Monday, 6 July 2009

Work in progress

I've also just uploaded some early "work in progress" on political competition. This is much more mainstream political science, asking the question: how might increasing competition between states for footloose citizens affect democratic institutions within each state? We've got a very simple model and some initial empirics. Still, I'm pretty excited about the paper. Take a look here, but be warned, it's not very polished!

The anonymity paper

I thought I'd fulfil my promise to blog about the paper on anonymity, with David Reinstein, which we updated a few days back. It starts from a worry about the "costly signalling" theory of religion and ritual - the idea that people take part in collective activities, like rain dances and church fetes, so as to show their commitment to a particular group. Costly signalling theory comes out of game theory and has had a big impact in both social and biological sciences.

Fine... but if the penalties for not taking part are high, perhaps because the group excludes you, then there are big incentives to take part even if you aren't really committed. We propose that in some cases making the activity anonymous solves this problem. The example in the paper is "Secret Santa", which I saw for the first time at Essex. My fellow PhD students gathered together and drew names out of a hat, then each of us set off to spend £5 on a present for our name. Come Christmas, we all got our presents, but nobody knew who was the giver. The nice thing about Secret Santa is that when other people get you something thoughtful, it's truly anonymous: there's no selfish motive to show off. So you end up (hopefully) learning that your peers really are nice people.

This paper owes something to my undergraduate SPS degree, which included a year of anthropology. In fact, the original idea for the paper came from the Kula Ring institution, though we've dropped that example. But we include other examples from small-scale societies (which are especially likely to need collective solidarity): in particular, song and dance. The main interest of the paper, for me, is the insight it may offer into these very ancient forms of culture, and how they support human cooperation.

At a less exotic level, we think that the model offers some insight into why anonymous donations might be the norm in certain collective projects. When my mother's village raised money to turn the field in front of the church into a village green, they put up a sign with the amount raised so far, but they did not announce individual donations. That's not the sort of thing you do in Kingsland.

I and David Reinstein decided to test this in the lab: we ran some two-stage public goods games, in which small groups are asked to donate money to a common cause which benefits all group members. In one treatment, the first stage was anonymous so players didn't know who gave what. In the other, "revealed" treatment, amounts given were linked to player numbers. Both treatments allowed for certain players to be excluded by the others' choice.

Not surprisingly, in the revealed treatment, the lowest givers often got excluded, and as a result, stage one donations went up. But more surprisingly, stage two donations went down. Our theory explains it like this: in the anonymous treatment, players could observe stage one donations and figure out whether their fellow group members were likely to make big donations in stage two; if so, then they too would do that. (People are prepared to play nice so long as others play nice also - in the jargon, they are conditional cooperators.) In the revealed treatment, on the other hand, everybody was giving a lot in stage one just to avoid being excluded. But then nobody knew what to expect in stage two, and not wanting to be the sucker in a group full of meanies, they gave less.

Here's my favourite plot from the paper, showing stage one and stage two donations in each treatment. (Bubble size shows how many people made each combination of donations.) The anonymous treatment is on the left: you can see that guys who donated a lot in stage one did the same in stage two. On the right this is much less true: in fact many people gave 2 or even the maximum 4 in stage one, then nothing in stage two.




(The paper is on my website. My Secret Santa present was a rubber stamp, for marking students' essays, with the words "COMPLETE AND UTTER BULLSHIT". It was just what I needed. Thanks, guys.)

Wednesday, 1 July 2009

New working paper

I and David Reinstein have got a working paper out for our project on anonymity and cooperation. See here or download the paper directly here. I'll post more about it soon.

Thursday, 18 June 2009

Am I missing something?

So what's the actual evidence that the Iranian elections were fraudulent?

The National Post reports a poll that put Ahmadinejad ahead by 2 to 1. There's a statistical analysis here which basically gives no answer. (It looks for evidence of made-up poll numbers and finds none; it finds deviations in favour of Ahmanidejad compared to a model based on 2005 election results, and on growth in turnout, in certain areas. That could be for a hundred reasons (think about trying to estimate a model of the recent Euro elections, based on turnout and 2005 results).

I can't stand Ahmadinejad and I wouldn't be at all surprised if the election was rigged, but where is the evidence?

Tuesday, 16 June 2009

Pop quiz

Which brilliant young evolutionary economist said the following recently?

XXXXX: 13.30-15.00
Motion: Let it be resolved that this conference believes that the notion of prediction has high value as a criterion for research in social sciences.
[00:12:01] … i'll tell you who will win...
[00:12:29] David Hugh-Jones: go on
[00:12:53] XXXXX: ?
[00:13:01] David Hugh-Jones: who will win?
[00:13:13] XXXXX: well, that is the motion
[00:13:27] … the conference vote about it at the beginning
[00:13:44] … i'll vote against, of course

Saturday, 13 June 2009

Presentation

I put up the presentation that I gave at the M-BEES conference on my website. The first slides are a bit cryptic. In order:

  1. Title slide.
  2. Families watch striking miners return to work. Strikes are a good example of the need to cooperate outside of a contractual framework.
  3. Worshippers at a church in Virginia. Religion and rituals have been explained as costly signals of commitment to a particular group.
  4. Simeon Stylites, who spent 37 years on top of a pillar. Costly signalling can be very costly.
  5. Still from There Will Be Blood. But if it's not costly enough, it fails to deter selfish people from entering the community. (You'll know what I mean if you've seen the film.)
  6. Examples of anonymous rituals: marching and uniforms.
  7. Examples of anonymous rituals: music. Gertrude Bell has a fabulous quote on this which is in the powerpoint notes.
  8. More examples: church donations, Secret Santa, anonymous voting.
  9. ... and applause. (Spot the Stalin connection.)
After that it gets more ordinary.

Friday, 12 June 2009

The guardian's data blog is quite fun



I did this as a break from the actual real empirics I'm doing. Needless to say, you'd be crazy to take this seriously. I was hoping to see the opposite: Mum's a strong UKIP supporter and I figured they would be substitutes. Maybe in the individual voting calculus they are (the data points are constituencies).

Monday, 25 May 2009

Life imitates Facebook

I've been given a piece of yeast in order to make a cake. After I bake it I have to hand on the yeast to 3 other people. The process takes five days, and you're not allowed to do it more than once. So if 4^16 = 4 billion roughly, in about 3 months everybody in the world will have had this yeast.

It says it's from the Vatican and will bring me luck and fulfilment. I suppose I will be filled full of cake so that is a kind of fulfilment. Anyway I am obeying its instructions, only wooden spoons, no fridge.

My conclusions are thus:

1. Surely it's highly hypocritical that Church leaders criticize the greed of hard-working business executives. And yet here they are endorsing a cake-based Ponzi scheme. It seems there's one law for us and another for the Reverends.

2. If you are Al-Qaeda, don't bother flying planes into buildings. Just stick some slowacting Anthrax into a bag of yeast and send it on with a message saying "send this cake to 5 dear loved ones for happiness". Civilization destroyed in a jiffy.

haircut

I went to the hairdresser today. She gave me a pitying look and said "shall we leave it long around the top?" That's the second time that's happened.

I guess there's some conspiracy among hairdressers to keep balding men's hair long. To keep us kidding ourselves, so we don't go and shave it all off with a Number One.

I'm not going to go back there again. Those people are so tactless.

Saturday, 25 April 2009

plastic

Very interesting Daily Telegraph article about the Great Pacific Garbage Patch. I think a lot of us have virtuously given up plastic shopping bags, but simultaneously started to drink mineral water in plastic bottles, which end up in the ocean. I will try to cut down on that.

Hmm, songs about plastic:
Plastic Fantastic Lover - Jefferson Airplane
Plasticman - Kinks
How I Wrote Plastic Man - The Fall. Actually it's called How I Wrote Elastic Man but he sings "plastic man".

Friday, 13 March 2009

New paper up on my website

... at davidhughjones.googlepages.com (or download directly). This is an early draft which I'll present at MPSA. It tackles the question of why people go to war. Essentially it provides microfoundations for thinking that the decision to fight is like a Stag Hunt, rather than a Prisoner's Dilemma. (Stag Hunts are relatively benign collective action problems, in which everyone is willing to cooperate so long as everybody else does.) Most people's intuition is that war is a PD. I try to show this is not always the case. Along the way, I provide a very simple model of the social construction of ethnic identity, handwave vaguely at endogenizing ethnic boundaries, and say mean things about Social Dominance Theory.

Thursday, 4 December 2008

Monday, 24 November 2008

Coalitional signalling

There at the top, on the edge of the castle moat we found a group of Druzes, young men and boys, standing in a circle and singing a terrible song. They were all armed and most of them carried bare swords. "Oh Lord our God, upon them! upon them!" I too joined the circle with my guide. "Let the child leave his mother's side. Let the young man mount and be gone." Over and over again they repeated a single phrase. Then half a dozen or so stepped into the circle, each shaking his club or his drawn sword in the face of those standing round. "Are you a good man? are you a true man? are you valiant?" they shouted. "Ha! ha!" came the answer, and the swords glistened and quivered in the moonlight. Then several came up to me and saluted me. "Upon thee be peace" they said "the English and the Druze are one." I said: "Praise be to God! we too are a fighting race." And if you had listened to that song you would know that the finest thing in the world is to go out and kill your enemy.


Gertrude Bell, Letters

Saturday, 22 November 2008

Tibetans Stay With Conciliatory Approach to China

Meme

Rules:
* Grab the book nearest you. Right now.
* Turn to page 56.
* Find the fifth sentence.
* Post that sentence along with these instructions in a note to your wall.

For me: "Very probably the occupational, ethnic, and other subgroups that combined to form Sumerian (and other subsequent) cities and civilizations danced together among themselves on appropriate occasions" (a classic evolutionary Just So Story from Keeping Together In Time by William H. McNeill.)

Saturday, 15 November 2008

A million?

UK's 'secure' child protection database will be open to one million


ContactPoint is now scheduled to launch in January. It will store and share data including every child's name, home address and school, and information about their legal guardians...

Sunday, 9 November 2008

Nothing new under the sun, part II

At one point in the proceedings, Bishop Turner rose to the podium and thundered a diatribe against legalized U.S. racism, prompting the Constitution to report "He Prefers Hell To United States; Calls American Flag Dirty and Contemptible Rag." ... Turner wrote to the Constitution a letter accusing them of misquotation but reiterating, "there was more color babble in the United States than in hell itself."
-- Mark Bauerlein, Negrophobia: A Race Riot in Atlanta 1906

Thursday, 30 October 2008

Dammit, even the Economist is against me.

When Obama wins, I'll probably feel kind of excited. But every time I read his election plans and McCain's, I think "McCain's are better".

As for Obama: well I'd call it 55-45. 55% he's a Clinton. 45% he's a Carter. What worries me about the guy is that he's got ideas. That's a terrible thing for a politician. Politicians should just have instincts.

Wednesday, 15 October 2008

Friday, 10 October 2008

Why the ECB Can't Fix Europe

which could also be titled "why it is a good idea for monetary sovereignty to be aligned with fiscal sovereignty".

Monday, 6 October 2008

Quote

It is not enough to propose things that are good in the end, but suppose this model were an excellent model, and fit for England and the kingdom to receive, it is our duty as Christians and men to consider consequences, and to consider the way.

-- Oliver Cromwell, during the Putney Debates

Wednesday, 24 September 2008

Reading on the financial crisis

Here's one via Martin Wolf in the FT: why Paulson is wrong. I've been reading FT alphaville - great fun - and various bloggers, articles etc. At least we are not short of opinions....

Me & Debbie were talking about this last night, like a pair of concerned amateur astrologers trying to understand a comet.... I think our conclusions were something along these lines:

1. Governments face inevitable pressures to protect voters' savings and houses; banks are therefore quite rational in lending irresponsibly.

2. If it goes ahead, the Paulson government bailout will create the conditions for another house price boom in the next economic cycle. This isn't sustainable. The banks are socializing their losses. (But, on a personal note - stay bullish on property in the long term!)

3. Larger banks are more likely to be "too big to fail" and therefore to lend irresponsibly. What is more, there is an incentive to grow so that one becomes too big to fail.

4. One solution might be to tilt the market towards smaller banks, to dampen the incentive towards inefficient growth. (I don't know how this could be done - maybe by offering them favourable interest rates?)

Monday, 15 September 2008

Getting your Creative Live! Webcam to work on Linux

This is for those of you with a Creative Live! Notebook Webcam - which IDs itself as 041e:4068 if you type "lsusb" on the command line - you'll get something like:

Bus 001 Device 002: ID 041e:4068 Creative Technology, Ltd

The issue with this baby is that it sends JPEG-compressed data, which your computer needs to decompress. For older kernels (2.6.24 and before) you can install the ov51x-jpeg driver. This contained JPEG decompression right in the kernel module. However this was only a part-time project (merci Romain) and not a permanent solution.

For newer kernels (2.6.27), there's a newer and less crazy trick - though obviously it would be nice to have things work out of the box so that Linuxhater won't laugh at us. In the meantime, go to this page to understand what's going on. Then download libv4l and untar it in your home directory.

You will now need the kernel headers for your latest kernel version. (That is, you need videodev2.h in /usr/include/linux.) This is probably best done by installing the package "linux-libc-dev" - at least, that works for me on Ubuntu. You can install the package from synaptic or with "sudo apt-get install linux-libc-dev". Make sure, of course, that it is the right one for your 2.6.27 kernel. (At the moment, I have to add the intrepid sources by hand.)

Now you are ready to go. In a terminal, go into the untarred directory "libv4l-0.1" and type "make". If this completes successfully, you should have some nice files ending in ".so" in a new subdirectory called "lib". Next, follow the instructions in the README file, by entering

export LD_LIBRARY_PATH=`pwd`/lib
export LD_PRELOAD=`pwd`/lib/v4l1compat.so

on the command line. Finally - with your camera plugged in - type "camorama" (or start another webcam application if you prefer - for me, camorama works but "cheese" doesn't). You should now see yourself on screen.

Saturday, 13 September 2008

Reasons to vote for McCain

Jonathan Freedland: Obama is "the fresh start the world is yearning for". " If the free world could choose its leader, it would be Barack Obama."

Chris Spurgeon: the Republicans held a rally - just like the fascists - and support strong leadership - just like the fascists. "Only a leader with McCain’s war record and paternal qualifications can help Americans muster and maintain the tenacity necessary to 'drill baby drill,' (even though this will have no influence on oil price or supply) and generate the requisite hate to 'kill baby, kill.'"

Friday, 12 September 2008

OMGWTF Neurotic animals!

From "Genes, Evolution and Personality", Bouchard and Loehlin 2001. Formatting slightly screwed up, sorry, but I know none of you can resist the news that octopuses are neurotic.


Octopus neurosis 1: you change colour, but you think a passing crab may be laughing at you.

Octopus neurosis 2: nervously tangling your tentacles together.


Table I. Animal Personality Factors Based on Factor Analyses of Individual Animals Classified According to the Five-Factor Model
and Two Additional Factorsa
Five-factor model trait names Additional dimensions
Species Neuroticism Agreeableness Extraversion Openness Conscientiousness Dominance Activity
Chimpanzee x x x x x x x
Gorilla x x x x
Rhesus monkey x x x x x
Vervet monkey x x x
Hyena x x x x
Dog x x x x x
Cat x x x x
Donkey x x
Pig x x x
Rat x x
Guppy x x
Octopus x x x
a

Adapted from Gosling and John (1999); an x indicates that the factor or a combination of two factors was found for that species.

Sunday, 31 August 2008

Surrealism news

Nice article on Nicolas Bourbaki. This made me laugh out loud - kind of a funnier preview of the Derrida/Searle debate:

"In the 1950s, Ralph Boas of Northwestern University wrote an article for the Encyclopaedia Britannica on Bourbaki, explaining that it was the pseudonym for a consortium of French mathematicians. The editors of the encyclopedia soon received a scalding letter signed by Nicolas Bourbaki himself, declaring that he would not allow anyone to question his right to exist. In revenge, Bourbaki began spreading the rumor that Ralph Boas himself didn’t exist, and that B.O.A.S was an acronym of a group of American mathematicians."

In other news, Geoffrey Perkins is dead. Allegedly he was the inventor of the game Mornington Crescent - there's a lively round being played on Slashdot now, Duke of Edinburgh's rules.

Saturday, 30 August 2008

Argh, numbers

I just love articles like these. You can picture some pimply junior reporter struggling to read through the latest issue of Social Trends, grabbing some numbers and writing them down.

"Divorces in the 45 to 49 age group also increased, with more women than men getting divorced. In 2006 there were 14.9 divorces for every 1,000 married women aged 45 to 49, rising to 15.3 by 2007. For every 1,000 45 to 49-year-old married men in 2006 and 2007, 17.3 got divorced."

Eh? Shouldn't that be "more men than women?" Or do they mean, total numbers? But what would be the point of that? Wait, how can more women than men get divorced anyway - are loads of lesbian marriages breaking up? Never mind, just copy something out of the press release, look up a couple of numbers at random in the spreadsheet....

Thursday, 28 August 2008

GENIUS.

Gordon Tullock quotes

BT bills

Small note. If you got a letter from BT giving you free local weekend calls, check your phone bills carefully. We did (in the old house) and we discovered they were still charging us for local calls. They overcharged us £50. Pretty outrageous really - it's hard to imagine how this could be an accident, given the whole billing system is automated.

My nightmare

"Imagine a world where companies and government must keep the public, or their employees, or both, happy with their plans and behavior," Assange says. "That is the world we are striving to create" (from a Wired interview with the founder of Wikileaks). Sounds like a nightmare to me.

Friday, 15 August 2008

Freedom, security

UK consultation on keeping location data (i.e. everywhere you've been over the past year) so that local council officers can find out if you've been overfilling your wheelie bins. This has been in the headlines lately.

Read it, wade through the hideous Eurojargon, write them a letter telling them to reconsider. Or don't. You're probably one of the Germans from my office in Essex, thinking "ha ha! Those crazy eccentric Brits with their privacy obsession! I voluntarily write to my local council every two weeks, detailing my religious beliefs and current favourite sexual position, because in Germany, we have high social capital!" Yes I do mean you, Nils & Steffen. Anyway, here's mine.

Dear Mr Knight

I am a UK citizen. I picked up on the Home Office consultation document on “Transposition of Directive 2006/24/EC” and felt the need to respond.

As I understand it, if the current plan goes ahead, ISPs, phone companies etc. will be required by law to keep data about my communications for a year, including for example mobile phone data that shows where I have been. Up till now there have been only voluntary guidelines about this.

I believe this is a bad idea. I am sure that the police would often find this data useful, as your examples suggest. But it also allows the government – including local councils – too easy access to information about my private life. I think the balance here has gone too far towards centralized storage of our personal data. I do not want local councils to know where I have been. I want to give up some security in exchange for some freedom.

Re: competition. Although the proposals to reimburse ISPs for the cost of keeping location and traffic data may help sustain a competitive market, this is trivial compared to the more serious problem that they turn ISPs into paid government informants, giving them a vested interest in the proposed system.

For these reasons, I support the “Do Nothing” option. It is the least worst.

Yours sincerely,




David Hugh-Jones

Monday, 11 August 2008

RSS feeds for papers

I've been getting into this as a way of keeping up with new papers before they hit the journals.

Here's one that seems to be hidden on the NBER website:

http://www.nber.org/rss/newpol.xml - new NBER papers in political economics.

I mentioned REPEC already. SSRN's feeds for individuals don't seem to work. Most individual journals also have RSS feeds and some have feeds for pre-published papers.

Tuesday, 29 July 2008

RSS feeds for New Economics Papers

RSS feeds are now available for New Economics Papers, so you can read them in your favourite feed reader. (I use google reader. Most journals have RSS feeds, so I can keep up with what's new in one place.)

I mention this because I wrote the code for it! The NEP people were very helpful in giving me access to their system to implement this feature, which I wanted. (Example of a public good which was cheap enough for a single person to provide.)

To subscribe, just go to the page for a particular report, e.g. nep-pol (positive political economics) and click on the orange icon in your brower's location bar.

(Update: not all the RSS feeds are available yet so you may get a "Page Not Found" error for some of these. Should go away when the next report is published.)

Wednesday, 23 July 2008

Author (date) referencing in TeXMacs

This is quite hard to do.

First, you need a bibtex bibliography, and the bibtex tool somewhere that texmacs can access it - I run TeXmacs under Cygwin so I need the Cygwin version of bibtex, not just the windows version.

Next, you can't use the TeXMacs bibliography tools unless there are no spaces in the paths to either your document or your bibliography. So save copies in some appropriate location - for me: C:/cygwin/tmp.

Now, choose the TeXMacs menu option Text->Automatic->Bibliography to insert your bibliography. TeXMacs will ask you for
(1) the bibliography style; type in "plain" for the moment.
(2) the path to the bibliography file. Under Cygwin it's a "unix-style" file path like /cygdrive/c/tmp/biblio.bib


Next use Insert->Link->Citation to put in citations. You will get a cite tag like this: . Fill it in with the bibtex key of your citation. You can see this key in your bibtex manager, or in the raw .bib file. Here's an example with the key highlighted in red:

@ARTICLE{benoit_models_2004,
author = {Kenneth Benoit},
title = {Models of electoral system change}}

Now use Document->Update->Bibliography and you should see your bibliography be filled in with a citation. You will probably also see something like "[1]" where your citation is.

So far so good. If you want to do author-date referencing... unfortunately it gets more complicated.

First, you will need the new cite-author-date.st TeXMacs package file. If you have this already, use the menu option Document->Add package->Customize->cite-author-year. If this option doesn't exist, try getting it from here and putting it in /usr/share/TeXMacs/packages/customize (or the equivalent on your system - your mileage may vary).

Your troubles are not yet over. To use this correctly, you need to get the plainnat.bst style file and put it in your $HOME/.TeXMacs/system/bib directory. This is a bibtex style file and can be found all over the web, e.g. here. Now, change your bibliography
in your TeXMacs document to use "plainnat" style. Probably simplest just to delete your old Bibliography and put the new one in.

Now you should be able to type \cite-author
[return]bibtex_key and get an author citation, or \cite-year[return]bibtex_key and get a year citation. One warning - sometimes you will need to run Document->Update->Bibliography twice before you see your citations properly; and sometimes you will need to update the citations themselves e.g. by putting the cursor in front of them and hitting [backspace][return].

But if you are like me you want more - you'd like a single command to put in "(Author year)" or "Author (year)". Maybe there's a way to do this with standard TeXMacs tools, but this way works for me:

Go to Document->View->Edit source tree so you can see the beautiful raw TeXMacs code of your document. Now enter this at the start of your document:

<assign|caby|<macro|x|<cite-author|x>(<cite-year|x>)>>>
<assign|cay|<macro|x|<cite-author|x><cite-year|x>>>
<assign|cbay|<macro|x|(<cay|x>)>>


Unfortunately, you can't type this in verbatim AFAIK - you have to type \assign[return]caby to type in assign, similarly for macro and cite-author etc., type alt-right before the first x's, and type alt-# before inserting the second and third x's. (If this sounds insane, it is - see the Texmacs help on writing style files. There's probably an easier way to do this.)

If you have done this right, you can go back and uncheck Edit source tree. You should now be able to type

\cbay[return]bibtex_key and get a nice (Author year) citation; while
\caby[return]bibtex_key gets you Author (year).

I guess all of this reads like a kind of propaganda post for Scientific Word. The fact is TeXMacs has terrible usability - sorry, Joris - but it still has the ONLY mathematical word processor that I can use fast enough for it to be intuitive. So until LyX lets me define keyboard shortcuts the way I like, I'm stuck with it.

Thursday, 17 July 2008

Dumb

Dumbest EU idea ever: extend copyright to 95 years retroactively.

The best length of copyright protection is a subject of heated economic research and debate. Almost everyone agrees on one thing, though - retroactively extending copyright protection does society no good at all. (Extending protections in the future might encourage more creative musicians. Obviously there won't be any effect like this from protecting works already produced.)

The Sonny Bono Copyright Term Extension Act is a notorious US example. I didn't think the EU would bow to special interests so transparently. How naive of me! I can hear Mum, UKIP supporter extraordinaire, going "I told you so".

UPDATE: there's a petition against this bullshit here.

Friday, 27 June 2008

Making Creative Live! Webcam work in Ubuntu Hardy

1. Go read linuxhaters.blogspot.com and make sure you don't want to stick with Windows...

2. You need the ov51x-jpeg module from here. The version in the Hardy repository (1.5.4) is too old, so instead download the latest source code.

3. Unpack the tarball (rightclick and choose "extract here")

4. open a terminal and type cd ov51x-jpeg-1.5.8 (or whatever the latest version is)

5. compile with "make" and "sudo make install". You will probably need kernel headers etc. etc. installed. An easy way to get this stuff is to install "module-assistant" from the repository and then on the command line type "sudo module-assistant prepare". That should set you up nicely.

6. Once installed type "sudo modprobe ov51x-jpeg". (If that doesn't work, do "find /lib -name 'ov51x'" and use the resulting filename (ending in .ko) for "sudo insmod ")

7. To make Skype work you may need to do "sudo modprobe ov51x-jpeg forceblock=1".

8. After this cheese, Skype etc. should recognize your webcam.

Good luck... it "only" took me 2 hours or so.... (/me wonders why he can't be satisfied with Windows)

(NB: on the plus side, the picture quality seems to be much better under Linux. I don't know why, maybe I need to change a Windows option or something....)

Monday, 23 June 2008

The Constitutional Treaty and the Lisbon Treaty, side by side

Open Europe have laid the Lisbon Treaty out side by side with the original Constitutional Treaty, so you can see the differences. (There aren't many.)

http://www.openeurope.org.uk/research/comparative.pdf

Friday, 25 April 2008

'...It is this latter ability that has caused so many problems for Facebook users. Third-party plugins such as "SuperWall" claim to extend functionality of the Facebook application, but have behaved in anything but a friendly manner. SuperWall would randomly send messages to existing people in a user's Facebook friends list, claiming that they had to install SuperWall in order to read a new message from that user. Once installed, it would keep performing this trick with the next person, and so forth. As it turned out, this behavior was by design.'

from Between black and white: the state of grayware on the PC

Sunday, 13 April 2008

Wednesday, 19 March 2008

Sunday, 16 March 2008

Bit of background

'At the end of 2005, the UN Special Rapporteur on Torture, Dr Manfred Nowak, visited China, Tibet and Xinjiang. Dr Nowak stated that "he was struck by the strictness of prison discipline and a palpable level of fear and self-censorship when talking to detainees". He also confirmed that a variety of torture methods are still widely and systematically used; including beatings, use of electric shock batons, submersion in pits of sewage, exposure to conditions of extreme heat or cold, deprivation of sleep, food or water, prolonged solitary confinement, denial of medical treatment and hard labour.'

from http://www.freetibet.org/campaigns/stoptorture/index.htm


Wednesday, 16 January 2008

Seriously geeky

Mas-Collel, Whinston and Green provide an elegant proof of the fact that lexicographic preferences cannot be represented by a utility function. Here's an alternative proof that is more intuitive to present. I use ^ to represent superscripts and _ to represent subscripts, as in Latex.

Lexicographic preferences in R^2 are defined as follows: x is weakly preferred to y if and only if either x_1>y_1 or (x_1=y_1 and x_2>=y_2). In words, even the smallest gain in the first dimension outweights even the largest gain in the second dimension.

For a contradiction, suppose there is a utility function u:R^2->R representing these preferences. Consider the line segment from (1,1) to (2,1). Along this line segment, u is increasing and hence continuous at all but a countable set of points (for a proof see Rudin Theorem 4.30). Find a point x where u is continuous. Now consider any point y=(x_1,x_2+e) with e>0. As y is strictly preferred to x, u(y)>u(x). But as we approach x from the right, i.e. for some point z=(x_1+h,x_2) with h>0 small enough, by continuity u(z) approaches u(x) and hence u(z) < u(y). However, by lexicographic preferences, z is strictly preferred to y as it is higher on the first dimension. This contradicts the premise that u represents preferences. QED.

Thursday, 27 December 2007

Nothing new under the sun


The day was gentle and fair…. It was curiously quiet everywhere, not so much silent as hushed and muted. Although the West End pavements were packed with a vast multitude it was a subtly different crowd from any that the authorities had seen before. What had happened was that this most stately public show was being observed with an intensely private emotion…. As the coffin was carried in to the Abbey there was a sense of release…. After the funeral came the homage. In five days over a million people visited the grave and left a hundred thousand wreaths….

Ronald Blythe, The Age of Illusion: the burial of the unknown soldier in Westminster Abbey, 1920

But the worst outcry of this sort came after a talk on birth control by Julian Huxley and Cecil Lewis and was caused by a well-rehearsed voice breaking into the discussion, with a dramatic, ‘I protest… I never… It’s indecent… I protest!’ The discussion stopped, as though shocked, then continued as before. It was all a put-up job by a realistic producer, and when this came out the B.B.C. was loudly condemned for going in for such stunts. The Manchester Guardian likened it to a man who blacks himself all over to play Othello.

Ibid.: the era of Reith at the BBC

Friday, 14 December 2007

Inequality, three

Worries: can I really make this neat dividing line between unacceptable, absolute poverty that allows the people in it to be humiliated and acceptable, relative poverty? Brazil is a middle income country, after all. Our needs are socially defined. Perhaps it’s naĂŻve to think that only some level of absolute poverty “forces” people to sell their dignity. If so, then the move from inequality to indecency to absolute poverty fails. Relative poverty would indeed matter. (Or I could just give up the strong feeling I have that buying people’s humiliation is evil; or I could punt this into the arena of social capital and civic culture, by saying that the problem was the video participants’ lack of self-respect.)

Worries on the other side: can I really neatly divide porn up into what’s acceptable although not my personal cup of tea – maybe even quite gross – and what’s bad and exploitative? I am uncomfortably reminded of that Chris Morris line from Brass Eye: “the amount of heroin I use is harmless.... But what about other people less stable, less educated, less middle-class than me? Builders or blacks for example.”

Inequality, two

Let's get a little more conceptual, staying with the video example.

Why should a convinced free-marketeer like me worry about inequality? Well, I believe in freedom of contract, but I cannot happily accept that one person can buy the ritual humiliation of other people before a global audience. (There is no freedom-of-speech, S&M roleplay, deconstructing-power-games context here, by the way. The context is purely commercial.) The problem, I think, is that this violates the basic respect for human dignity which, among other things, justifies human rights. These things would not exist in a decent society.

On the other hand, I do not want to say that the women who made this movie were misguided. (Basic idea behind rational choice theory: your objects of study are not stupid.) Instead I suppose that they were desperate. That leads me to think that the real problem with inequality is not the customer’s relative wealth, but the women’s absolute poverty. Most reasonably well-off people wouldn’t eat shit on video for a million dollars. (Some people probably would – humans vary – and I’m OK with that as a choice, I take my libertarianism about sex seriously. I’m not OK with extremely poor people being used as playthings.)

That in turn makes me think that the best remedy for “obscene inequality” is pro-poor growth, as fast as possible. As for the expensive cocktails, well, the vulgar new rich will be always with us, and with a bit of luck their children will found libraries.

Inequality, one

Inequality has crept back on to the agenda, witness the recent story about the £35000 cocktail.

For anybody who thinks “obscene wealth” refers to people richer than they are, here’s an anecdote. You know these artists who e.g. pay homeless Russians £25 to pose for nude photographs, thus challenging our ideas of, oh, fill in the blanks? One person, not an artist, just a guy on the internet, pushed this idea a little farther. He hired a bunch of Brazilian women and got a video made in which they spend a lot of time – there is no nice way to put this – eating their own and each others’ shit. He was not motivated by profit, he just one day decided to create an extremely degrading and humiliating video. You can read about it at somethingawful.com, I won’t provide the link. The video is no doubt floating around the internet, and probably will be forever.
When I read this story, written in somethingawful.com’s world-weary tone of voice, it made me viscerally angry and sad, which not many pieces of news do any more. But the important point is: the whole shoot cost about $500.

Wednesday, 12 December 2007

in memoriam Evel Knievel

... I had one of his toy motorbikes.

From the Independent obit: 'the Inland Revenue Service pursued him for many years claiming $21m in unpaid taxes. He told the IRS that if they sent anyone round to his house, "I'll blow his head right off his shoulders".'

Just took the pledge

The NO2ID Pledge - have YOU made it yet?

... what are you waiting for?

Tuesday, 11 December 2007

I could go on

Facebook. like it's 1999 and nobody's yet learned not to forward chain letters.

Facebook: the web's second childhood.

Facebook: A VIRTUAL POKE IS NO GOOD TO ME.

Facebook: [ ] allow this application to rape your privacy.

Facebook: make friends! discover they are vacuous!

RRRRRRRRRRRRRRRRRR. NNNNGGGGG.

Tuesday, 6 November 2007

Poem

The Dog and Fox at Play


Every morning, the dog and the fox pup

Played in the garden without a sound,

Damp and delighted in the knee-high grass,

Chasing each other round and round.


After the divorce, the dog and people went away,

Furniture was packed and the house was sold.

There in November, I saw the adult fox

Check bins for scraps in a moderate cold.


Joy, life and warmth are merely accidental

In a world a sere God made for reasons of His own.

Echoes sometimes reach Him of the hound and fox pup playing

Like the skipping in a wide lake of a stone.