Cognitive Science Cinema

April 3rd, 2013 § 3 comments § permalink

I’ve been trying to think of documentaries on cognitive science topics. This is what I’ve got so far. Can you help?

Surely the hoo-har about replication could only concern a non-cumulative science?

March 10th, 2013 § 2 comments § permalink

There’s a hoo-har in psychology right now about replication. Spurred on by some high profile fraud cases, awareness of the structural biases surrounding publication and perennial rumblings about statistical malpractice, many are asking if the effects reported in the literature are real. There are some laudable projects aimed at improving best practice in science – journals of null results, pre-registration for experiments, the Center for Open Science (see previous link), but it occurs to me that all of this ignores an important bit of context. At the risk of stating the obvious: you need to build in support for replications only to the extent that these do not happen as part of normal practice.

Cumulative science inherently supports replication. For most of science, what counts on news is based on what has been done before – not just in an abstract theoretical sense, but in the sense that it relies on those results being true to make the experiments work. Since I’m a psychologist, and my greatest expertise is in my own work, I’ll give you an example from this recent paper. It’s a study of action learning, but we use a stimulus control technique from colour psychophysics (and by ‘we’, I really mean Martin, who did all the hard stuff). As part of preparing the experiment we replicated some results using stimuli of this type. Only because this work had been done (thanks Petroc!) could we design our experiment; and if this work didn’t replicate, we would have found out in the course of preparing for our study of action learning. Previously in my career I’ve had occasion to do direct replications, and I’ve almost always found the effect reported. I haven’t agreed with the interpretation of why the effect happens, or I’ve found that my beliefs about the effect from just reading the literature were wrong, but the effect has been there.

It is important that replication is possible, but I’ve been bemused that there has been such a noise about creating space for additional formal replications. It makes me wonder what people believe about psychology. If a field was one where news was made by collecting isolated interesting phenomena, then I there would be more need for structures to support formal replication. Should I take the reverse lesson from this – the extent to which people call for structures to support formal replication is evidence of the lack of cumulative science in psychology?

The infantilising power dynamic of public engagement with science

March 1st, 2013 § 0 comments § permalink

The rhetoric of wonder is all about encouraging participation. But this infantilising power dynamic is not conducive to confident involvement or critical inquiry.

Righteously snarky CiF, Prof Brian Cox: physicist or priest? Many popular scientists are atheist, so why are they so happy to use the misty-eyed language of religion? by
Eliane Glaser

Mea culpa musings (angry cyclist edition)

February 13th, 2013 § 13 comments § permalink

I screwed up. My latest column for BBC Future is about why cyclists enrage motorists. My argument is that cyclists offend the ‘moral order’ of the roads, evoking in motorists a feeling of outrage over perceived rule breaking.

Unfortunately, I included some loose words in my article that implied things I don’t believe and wasn’t arguing. Exhibit A:

Then along comes a cyclist, who seems to believe that the rules aren’t made for them, especially the ones that hop onto the pavement, run red lights, or go the wrong way down one-way streets.

This wrongly suggests both that I think the typical cyclists breaks the law (they don’t), and/or that motorists are enraged by cyclists’ law breaking. This is not the case, rather I am arguing that motorists are engaged by cyclists’ perceived rule breaking, where I mean rule in the sense of ‘convention’. Cyclists habitually, legally, and sensibly break conventions of car-driving such as waiting in queued traffic, moving at the speed limit or not under-taking.

Exhibit A has now been changed in the article to the more pleasing:

Then along come cyclists, innocently following what they see are the rules of the road, but doing things that drivers aren’t allowed to: overtaking queues of cars, moving at well below the speed limit or undertaking on the inside.

So, my bad and apologies for this. I should have been a lot clearer than I was. I’m just grateful that a few people understood what I was getting at (if you read the whole article I hope the correct interpretation I supported by the rest of the phrasing I use). The amount and vehemence of feedback has been quite surprising. Lots of people thought I was a frustrated driver who hated cyclists. In fact, the bike is my main form of transport. I’ve ridden nearly every day for over ten years (and been hit by a car once). For this article I was trying not to sound like the self-righteous cycling proto-fascist I feel like sometimes. I obviously succeeded. Perhaps too well.

Other people thought I was claiming that this was the only factor affecting road-user’s attitudes. I don’t think this. Obviously selective memory (for bad cyclists or drivers), in- group/out-group effects and the asymmetry in vulnerability all play a role. I did write a version of the article which laid out the conceptual space a bit clearer, but I decided it was boring to read, and really I wanted to talk about evolutionary game theory and make a novel – and, I thought, interesting – claim.

I sometimes think I should get “Telling the truth, just not the whole truth” translated into Latin so I can use it as the motto for the column. Each one I write someone comes back to me with something I missed out. If I tried to be comprehensive I’d end up with a textbook, instead of a 800 word magazine column. I don’t want to write textbooks, so I’m reasonably happy with leaving things out, but I do worry that there is a line you cross when telling some of the truth amounts to a deception or distortion of the whole truth. I’m trying, each time, not to cross that line. Feedback on how to manage this is welcome.

There were many other comments of all shades. You can ‘enjoy’ some of them on the BBC Future facebook page here. If you did leave a comment on email/facebook/twitter I’m sorry I couldn’t respond to all of them. I hope this post clarifies things a bit.

Links for January 2013

January 23rd, 2013 § 0 comments § permalink

Quote #293

December 30th, 2012 § 0 comments § permalink

Work for 6 years. The 7th, go alone or among strangers, so the memory of your friends does not hinder you from being what you have become

Either Vinay, or via Vinay

Quote #292

December 30th, 2012 § 0 comments § permalink

I have not failed. I’ve just found 10,000 ways that won’t work.

Thomas Edison, attib.

Bootstrap: corrected

December 6th, 2012 § 3 comments § permalink

So, previously on this blog (here, and here) I was playing around with the bootstrap as a way of testing if two samples are drawn from a different underlying distribution, by simulating samples with known differences and throwing different tests at the samples. The problem was that I was using the wrong bootstrap test. Tim was kind enough to look at what I’d done and point out that I should have concatenated my two sets of numbers and the pulled two samples from that set, calculated the mean difference and then used that statistic to constructed a probability distribution function against which I could compare my measured statistic (ie the difference of means) to perform a hypothesis test (viz. ‘what are the chances that I could have got this difference of means if the two distributions are not different?’). For people who prefer to think in code, the corrected bootstrap is at the end of this post.

Using the correct bootstrap method, this is what you get:

So what you can see is that, basically, the bootstrap is little improvement over the t-test. Perhaps a marginal amount. As Cosma pointed out, the ex-gaussian / reaction time distributions I’m using look pretty normal at lower sample sizes, so it isn’t too surprising that the t-test is robust. Using the median rather than the mean damages the sensitivity of the bootstrap (contra my previous, erroneous, results). My intuition is that the mean, as a statistic, is influenced by the whole distribution in a way the median isn’t, so it a better summary statistic (statisticians, you can tell me if this makes sense). The mean test is far more sensitive, but, as discussed previously, this is because it has an unacceptably high false alarm rate which is insufficiently penalised by d-prime.

Update: Cosma’s notes on the bootstrap are here and recommened if you want the fundamentals and are already degree-level comfortable with statistical theory.

Corrected boostrap function:

function H=bootstrap(s1,s2,samples,alpha,method)

difference=mean(s2)-mean(s1);

for i=1:samples
    
    sstar=[s1 s2];
    
    boot1=sstar(ceil(rand(1,length(s1))*length(sstar)));
    boot2=sstar(ceil(rand(1,length(s2))*length(sstar)));
    
    if method==1
        a(i)=mean(boot1)-mean(boot2);
    else
        a(i)=median(boot1)-median(boot2);    
    end
    
end

CI=prctile(a,[100*alpha/2,100*(1-alpha/2)]);

H = CI(1)>difference | CI(2)
        

More on Graeber’s Debt: The First 5,000 years

December 2nd, 2012 § 2 comments § permalink

“The story of the origins of capitalism, then, is not the story of the gradual destruction of traditional communities by the impersonal power of the market. It is, rather, the story of how an economy of credit was converted into an economy of interest; of the gradual transformation of moral networks by the intrusion of the impersonal—and often vindictive—power of the state.” (p.332)

Our attitude to debt is a symptom of this erosion of social economies by currency economies. Mutually agreed, honour, credit is replaced by state-backed, economic credit. Loans which inexorably grow due to interest are enforced by brutal laws against debtors. This is the context for the rapacity of European colonialists – they were driven on by the tyranny of interest.

“All this helps explain why the church had been so uncompromising in its attitude toward usury. It was not just a philosophical question; it was a matter of moral rivalry. Money always has the potential to become a moral imperative unto itself. Allow it to expand and it can quickly become a morality so imperative that all others seem frivolous in comparison. For the debtor, the world is reduced to a collection of potential dangers, potential tools, and potential merchandise. Even human relations become a matter of cost-benefit calculation. Clearly, this is the way the conquistadors viewed the worlds they set out to conquer” (p. 319)

It is the secret scandal of capitalism that at no point has it been organized primarily around free labor. The conquest of the Americas began with mass enslavement, then gradually settled into various forms of debt peonage, African slavery, and “indentured service” (p.350)

This is a scandal not just because the system occasionally goes haywire, as it did in the Putumayo, but because it plays havoc with our most cherished assumptions about what capitalism really is—particularly that, in its basic nature, capitalism has something to do with freedom. For the capitalists, this means the freedom of the marketplace. For most workers, it means free labor. Marxists have questioned whether wage labor is ultimately free in any sense (since someone with nothing to sell but his or her body cannot in any sense be considered a genuinely free agent), but they still tend to assume that free wage labor is the basis of capitalism.

Our dominant image of the origins of capitalism continues to be the English workingman toiling in the factories of the industrial revolution, and this image can be traced forward to Silicon Valley, with a straight line in between. All those millions of slaves and serfs and coolies and debt peons disappear, or if we must speak of them, we write them off as temporary bumps along the road. Like sweatshops, this is assumed to be a stage that industrializing nations had to pass through, just as it is still assumed that all those millions of debt peons and contract laborers and sweatshop workers who still exist, often in the same places, will surely live to see their children become regular wage laborers with health insurance and pensions, and their children, doctors and lawyers and entrepreneurs.”(p351)

With this framing, Graeber repaints Adam Smith’s economic account – “It is not from the benevolence of the butcher, the brewer, or the baker that we expect our dinner, but from their regard to their own interest.” etc – as a purely moral account, a utopia utterly unlike the actual economic conditions Smith lived in.

To understand the history of capitalism, however, we have to begin by realizing that the picture we have in our heads, of workers who dutifully punch the clock at 8:00 a.m. and receive regular remuneration every Friday, on the basis of a temporary contract that either party is free to break off at any time, began as a utopian vision, was only gradually put into effect even in England and North America, and has never, at any point, been the main way of organising the production for the market, ever, anywhere.
This is actually why Smith’s work is so important. He created the vision of an imaginary world almost entirely free of debt and credit, and therefore, free of guilt and sin; a world where men and women were free to simply calculate their interests in full knowledge that everything had been prearranged by God to ensure that it will serve the greater good. (p.354).

For some critical commentary see here: http://onthespiral.com/review-reactions-debt-first-years, the Crooked Timber seminar (ht Alex)

Update 30/12/12. There’s an important point about rights being conceptualised as property, which Gemma summarises well:

Our freedom is defined as a right, which we own, as opposed to Graeber’s view that rights are actually obligations on others (e.g. our right to free speech is actually others obligations to allow my free speech). Rights have been defined in this way to justify debt-peonage or even slavery – if we own our rights, like property, then we are free to give them away or even sell them (p206).

Bootstrap update

November 30th, 2012 § 4 comments § permalink

Update: This post used an incorrect implementation of the bootstrap, so the conclusions don’t hold. See this correction

Mike suggested that I alter the variance of the underlying distibutions. This makes total sense, since it matches what we are usually trying to do in psychological research – detect a small difference in a lot of noise. So I made the underlying distibutions look a lot like reaction time distributions, with a 30ms difference between them. The code is

    t0=200;
    s1=t0+25*(randn(1,m)+exp(randn(1,m)));
    s2=t0+25*(randn(1,m)+exp(randn(1,m)))+d;

Where m is the sample size, and d is either 0 or 30. For a very large sample, the distributions look like this:

After a discussion with Jim I looked at the hit rate and false alarm rate separately. For the simple comparison of means, the false alarm rate stays around 0.5 (as you’d predict). For the other tests it drops to about 0.05. The simple comparison of means is so sensitive to a true difference, however, that the dprime can still be superior to that of the other tests. Which suggests dprime is not a good summary statistic to me, rather than that we should do testing simply by comparing the sample means.

So I rerun the procedure I described before, but with higher variance on the underlying samples.

The results are very similar. The bootstrap using the mean as the test statistic is worse than the t-test. The bootstrap using the median is clear superior. This surprises me. I had been told that the bootstrap was superior for nonparametric distributions. In this case it seems as if using the mean as a test statistic eliminates the potential superiority of bootstrapping.

This is still a work in progress, so I will investigate further and may have to update this conclusion as the story evolves.

Debt: The first 5,000 years

November 28th, 2012 § 4 comments § permalink

David Graeber traces a line from Roman property law, through Cartesian dualism and Hobbes’ state of nature, to the foundational myth of the free market:

At this point we can finally see what’s really at stake in our peculiar habit of defining ourselves simultaneously as master and slave, reduplicating the most brutal aspects of the ancient household in our very concept of ourselves, as masters of our freedoms, or as owners of our very selves. It is the only way that we can imagine ourselves as completely isolated beings. There is a direct line from the new Roman conception of liberty – not as the ability to form mutual relationships with others, but as the kind of absolute power of “use and abuse” over the conquered chattel who make up the bulk of a wealthy Roman man’s household – to the strange fantasies of liberal philosophers like Hobbes, Locke, and Smith, about the origins of human society in some collection of thirty- or forty-year-old males who seem to have sprung from the earth fully formed, then have to decide whether to kill each other or begin to swap beaver pelts.

David Graeber (2011) ‘Debt: The First 500 years’, p209-210.

Graeber uses an anthropologist’s view of history to argue that markets are brought into existence by the state, and particularly by an expansionist military state which wishes to force all social actors to be intermediaries in the war machine. By obliging everyone to accept state currency a state-coinage-slavery complex is created. This dynamic drives the creation of slaves, which are, by definition, people ripped from all social context. The collision of market economies with social economies (which are about interaction as much as obtaining goods) creates a moral dilemma which we can trace written in the texts of all the ancient religions (you’ll have to read the book for details). The dominant modes of human relation in historical time have been three: exchange, hierarchy and communism (not in the Marxist sense). The dominion of the exchange mode, and its perversion into being primarily market exchange, reduces the primacy of the other modes in the models of liberal/market thinkers, and so our conception of our selves (individually and politically) is contaminated by contradictory notions of debt and ownership (again, you’ll have to read the book). Ultimately this finds expression in a vision of ourselves as separate from our own bodies, and in the foundational myth of economics in which we markets come into being de novo among an asocial but equal status collection of isolates who can begin to trade to satisfy their wants.

It’s an extremely rich book, which is also very disorganised in its arguments. I’m still digesting what I’ve read so this is a poor summary. Most importantly for me, and separate from the specifics of the argument, the anthropological and historical material does the job of expanding our conception of what we and our society could be.

Pro-tip: on the final pages (p384-387) Graeber offers his own summary of the thesis of the book.

Testing bootstrapping

November 26th, 2012 § 3 comments § permalink

Update: This post used an incorrect implementation of the bootstrap, so the conclusions don’t hold. See this correction

This surprised me. I decided to try out bootstrapping as a method of testing if two sets of numbers are drawn from different distributions. I did this by generating sets of numbers of size m from two ex-gaussian distributions which are identical except for a fixed difference, d

    s1=randn(1,m)+exp(randn(1,m));
    s2=randn(1,m)+exp(randn(1,m))+d;

All code is matlab. Sorry about that.

Then, for each pair of numbers I apply a series of different tests for if the distributions are different.
1. Standard t-test (0.05 significance level)
2. Is the mean(s1) 3. Bootstrapping using mean as the test statistic (0.05 significance level)
4. Bootstrapping using the median as the test statistic (0.05 significance level)

I used Ione Fine’s pages on bootstrapping as a guide. The bootstrapping code is:

function H=bootstrap(s1,s2,samples,alpha,method)

for i=1:samples
    
    boot1=s1(ceil(rand(1,length(s1))*length(s1)));
    boot2=s2(ceil(rand(1,length(s2))*length(s2)));
    
    if method==1
        a(i)=mean(boot1)-mean(boot2);
    else
        a(i)=median(boot1)-median(boot2);    
    end
    
end

CI=prctile(a,[100*alpha/2,100*(1-alpha/2)]);

H = CI(1)>0 | CI(2)<0;

I do that 5000 times for each difference, d, and each sample size, m. Then I take the average answer from each test (where 1 is 'conclude there distributions are different' and 0 is 'don't conclude the distributions are different'). For the case where d > 0 this gives you a hit rate, the likelihood that the test will tell you there is a difference when there is a difference. For d = 0.5 you get a difference that most of the tests can detect the majority of the time as long as the sample is more than 50. For the case where d = 0, you can calculate the false alarm rate for each test (at each sample size).

From these you can calculate d-prime as a standard index of sensitivity and plot the result. Sttest, Smean, Sbootstrap and Sbootstrap2 are matrices which hold the likelihood of the four tests giving a positive answer for each sample size (columns) for two differences, 0 and 0.5 (the rows):

figure(1);clf
plot(measures,norminv(Sttest(2,:))-norminv(Sttest(1,:),0,1),'k')
hold on
plot(measures,norminv(Smean(2,:))-norminv(Smean(1,:)),'r')
%plot(measures,norminv(Smedian(2,:))-norminv(Smedian(1,:)),'c--')
plot(measures,norminv(Sbootstrap(2,:))-norminv(Sbootstrap(1,:)),'m')
plot(measures,norminv(Sbootstrap2(2,:))-norminv(Sbootstrap2(1,:)),'g')
xlabel('Sample size')
ylabel('sensitivity - d prime')
legend('T-test','mean','bstrap-mean','bstrap-median')

Here is the result (click for larger):

What surprised me was:

  • The t-test is more sensitive than the bootstrap, if the mean is used as the test statistic
  • How much more sensitive the bootstrap is than the other tests if the median is used as the test statistic
  • How well the simple mean does. I suspect there's so nuance I'm missing here, such as unacceptably high false positive rate for smaller differences

Update 28/11/12
-Fixed an inconsequential bug in the dprime calculation
-Closer inspection shows that the simple mean case gives a ~50% false alarm rate, but the high sensitivity offsets this. Suggests dprime isn't a wise summary statistic?

Links for autumn 2012

November 13th, 2012 § 0 comments § permalink

New academic website

October 25th, 2012 § 0 comments § permalink

I have made myself a new website for my day job. I used wordpress, and it was fantastically convenient. I’m also pretty happy with how it looks. Feedback welcome.

Notes for undergraduates

October 11th, 2012 § 0 comments § permalink

This has been in my email signature for the last year or so.

If you email me, please say your full name, level and, if relevant, which course(s) you are referring to. Although you know what “the lecture” or “the coursework” refers to, I may not. If you refer to an article, book or a webpage, please give the full reference and/or URL so that I know what you are talking about. Similarly, if you include a citation (surname, date) in a piece of writing, please include the full reference (in APA style) at the end.

It is important that you leave the University of Sheffield in the habit of writing formally to people. I may not be bothered by you not including an introduction to your email, or by you not signing it, but many people you write to will be. You should also make an effort to capitalise, punctuate and spell correctly in your email. Again, although I may not judge you negatively if you fail to do this, many people will, so you should practice the habit of taking care over these things when you write.

If you are a PSY241 student, please read this before emailing me

http://psy241.group.shef.ac.uk/psy241wiki/index.php/FAQ

If you need a response by a particular time, it helps if you mention this in the email. If you have an urgent query (i.e. requires a response within 48 hours) email is not appropriate. Please call instead.

I do not read my email over the weekend, or after 5pm.

Answers to most of the questions I get asked are readily available, either in the Undergraduate Handbook or on the Departmental or University webpages. If you write to me with a question like this I will probably write back and ask you where you have looked already for the information. If you want to avoid this, please say in your email how you tried searching for the information you required before emailing me.

If we make an appointment to meet you must turn up on time. If you are late I may not be able to begin a meeting with you because it will infringe on other commitments. If you are unable to make an appointment, or are going to be late, please call to let me know, so that I am able to do other things with my time and am not waiting around like a lemon.

Finally, congratulations on reading this far. Here’s some good advice: “The way to get a first class mark is to answer a specific question by making arguments about theories and supporting those arguments with evidence”. Even if you aren’t aiming for a first class mark, you can still avoid getting a lower mark than you should by ensuring that you answer the question. We cannot give you marks for providing correct information which does not answer the question.

Bonus advice for 2012: If you want to get answers from busy people, ask simple direct questions. “Is today’s lecture at 12 o’clock?” is better than “When are the lectures?”, and may be more in line with what you really want to know anyway. Both of these options are better than something like “What do I need to know about the course?” which is so poorly specified that you are unlikely to get a swift and helpful answer.

Quote #291: Sutherland on Consciousness

September 24th, 2012 § 1 comment § permalink

Consciousness is a fascinating but elusive phenomenon; it is impossible to specify what it is, what it does, or why it evolved. Nothing worth reading has been written on it.

Stuart Sutherland, in The International Dictionary of Psychology entry on Consciousness

An accommodation with the authority of common sense

September 21st, 2012 § 2 comments § permalink

In Science in Action, Bruno Latour talks of the birth of the modern science of geology, triumphed by Charles Lyell. He discusses Lyell’s attempt to professionalise and win respect for geology, and the need to find funds to support research in the new discipline. One solution to the need for funds it to appeal directly to the public, in Lyell’s case by writing a book that the landed gentry might read and so be convinced to donate to the cause of Geology:

If geology is successful in reshaping the earth’s history, size, composition and age, by the same token, it is also extremely shocking and unusual. You start the book in a world created by God’s will 6000 years ago, and you end it with a few poor Englishmen lost in the eons of time, preceded by hundreds of Floods and hundreds of thousands of different species. The shock might be so violent that the whole of England would be up in arms against geologists, bringing the whole discipline into disrepute. On the other hand, if Lyell softens the blow too much, then the book is not about new facts, but is a careful compromise between commonsense and the geologists’ opinion. This negotiation is all the more difficult if the new discipline runs not only against the Church’s teachings but also against Lyell’s own beliefs, as is the case with the advent of humanity into earth history which Lyell preferred to keep recent and miraculous despite his other theories. How is it possible to say simultaneously that it is useful for everyone, but runs against everyone’s beliefs? How is it possible to convince the gentry and at the same time to destroy the authority of common sense? How is it possible to assert that it is morally necessary to develop geology while agonising in private in the meantime on the position of humanity in Nature?

(p.149)

Replace 19th century geology with ‘cognitive sciences’, and gentry with ‘public’, and the essential tension is still there. The new brain science seeks attention and kudos, and in doing this must reach an uncomfortable accommodation with the ‘authority of common sense’. Psychologists and neuroscientists want to be heard in the public domain, but they will get so much more attention if they flatter received wisdom rather than attempt to overturn strongly held intuitions about human freedom, reasoning and morality.

Quote #290

September 21st, 2012 § 0 comments § permalink

Life shrinks or expands in proportion to one’s courage.

Anaïs Nin, volume 3 of her diaries (apparently)

Quote #289: There are no solutions here

September 12th, 2012 § 0 comments § permalink

There are no solutions here – it’s about what problems you choose to address on an ongoing basis

Rob Riordan, via @AlecPatton

I hear new news every day

August 27th, 2012 § 0 comments § permalink

I hear new news every day, and those ordinary rumours of war, plagues, fires, inundations, thefts, murders, massacres, meteors, comets, spectrums, prodigies, apparitions, of towns taken, cities besieged in France, Germany, Turkey, Persia, Poland, &c., daily musters and preparations, and such like, which these tempestuous times afford, battles fought, so many men slain, monomachies, shipwrecks, piracies, and sea-fights, peace, leagues, stratagems, and fresh alarms. A vast confusion of vows, wishes, actions, edicts, petitions, lawsuits, pleas, laws, proclamations, complaints, grievances, are daily brought to our ears. New books every day, pamphlets, currantoes, stories, whole catalogues of volumes of all sorts, new paradoxes, opinions, schisms, heresies, controversies in philosophy, religion, &c. Now come tidings of weddings, maskings, mummeries, entertainments, jubilees, embassies, tilts and tournaments, trophies, triumphs, revels, sports, plays: then again, as in a new shifted scene, treasons, cheating tricks, robberies, enormous villanies in all kinds, funerals, burials, deaths of Princes, new discoveries, expeditions; now comical then tragical matters. To-day we hear of new Lords and officers created, to-morrow of some great men deposed, and then again of fresh honours conferred; one is let loose, another imprisoned; one purchaseth, another breaketh: he thrives, his neighbour turns bankrupt; now plenty, then again dearth and famine; one runs, another rides, wrangles, laughs, weeps &c. Thus I daily hear, and such like, both private and publick news. Amdist the gallantry and misery of the world: jollity, pride, perplexities and cares, simplicity and villany; subtlety, knavery, candour and integrity, mutually mixed and offering themselves, I rub on in a strictly private life.

Robert Burton, The Anatomy of Melancholy (p.19)

Seeking help: Drawing machines

August 7th, 2012 § 3 comments § permalink

Matt is making a drawing machine. A robot which will live on a wall and plot out paths which are an algorithmic solution to the artistic seeds that Matt feeds it. I’m helping Matt, but we’re stuck with a bit of the maths.

Due to artistic and practical constraints, this is how the robot will work: there will be two motors, top left and top right, from which a ‘pen’ is suspended. Our problem is about how to change the length of the chains from which the pen is suspended to draw a straight line between two points. I’ve done a diagram to make this easier to explain. The crudely drawn black circles are the two motors. There is a small blue circle (a start point), and the two chains in green (with lengths l1 and r1 respectively. The target endpoint is show as a red cross, with the chains shown in purple (with lengths l2 and r2 respectively (obviously there are only ever two chains, one right and one left, not four).

Calculating the length of the chains at the start and the end is fairly trivial. The problem is at what rate to turn the motors to lengthen or draw in the chains to get between the start and the end points drawing a straight line. For artistic reasons it is absolutely essential that the line drawn between two points is straight.

I had a go at solving this. You can have a look at this python code (incidentally, my first ever python script!). The problem is, my solution makes curved lines, like this (points along the path shown as blue dots)

The chains need to be tightened by some amount during travel to stop a curve being described, but I know enough maths to know that I don’t have a hope of solving this one. Can you help?

Quote #287

August 6th, 2012 § 0 comments § permalink

Style is knowing who you are, what you want to say, and not giving a damn.

Gore Vidal, I’m told

Links for summer 2012

July 27th, 2012 § 1 comment § permalink

By the same impure urgency

June 8th, 2012 § 0 comments § permalink

I have no explanation for my own vile ambitions. Confronted with your pus, I could not stop to examine my direction, whether or not I was aimed at a star. As I limped down the street every window broadcast a command: Change! Purify! Experiment! Cauterize! Reverse! Burn! Preserve! Teach! Believe me, Edith, I had to act, and act fast. That was my nature. Call me Dr. Frankenstein with a deadline. I seemed to wake up in the middle of a car accident, limbs strewn everywhere, detached voices screaming for comfort, severed fingers pointing homeward, all the debris withering like sliced cheese out of Cellophane – and all I had in the wrecked world was a needle and thread, so I got down on my knees, I pulled pieces out of the mess and I started to stitch them together. I had an idea of what a man should look like, but it kept changing. I couldn’t devote a lifetime to discovering the ideal physique. All I heard was pain, all I saw was mutilation. My needle going so madly, sometimes I found I’d run the thread right through my own flesh and I was joined to one of my own grotesque creations – I’d rip us apart – and then I heard my own voice howling with the others, and I knew that I was also truly part of the disaster. But I also realized that I was not the only one on my knees sewing frantically. There were others like me, making the same monstrous mistakes, driven by the same impure urgency, stitching themselves into the ruined heap, painfully extracting themselves

F., in Leonard Cohen’s Beautiful Losers (1966), p.175

Fundamentals of learning: the exploration-exploitation trade-off

June 6th, 2012 § 0 comments § permalink

The exploration-exploitation trade-off is a fundamental dilemma whenever you learn about the world by trying things out. The dilemma is between choosing what you know and getting something close to what you expect (‘exploitation’) and choosing something you aren’t sure about and possibly learning more (‘exploration’). For example, suppose you are in a restaurant and you look at the menu:

  • Fish and Chips
  • Chole Poori
  • Paneer Uttappam
  • Khara Dosa

Assuming for the sake of example that you’re not very good with Sri Lankan food, you’ve now got a choice. You can ‘exploit’ – go with the fish and chips, which will probably be alright – or you can ‘explore’ – try something you haven’t had before and see what you get. Obviously which you decide to do will depend on many things: how hungry you are, how good the restaurant reviews are, how adventurous you are, how often you reckon you’ll be coming back ..etc. What’s important is that the study of the best way to make these kinds of choices – called reinforcement learning – has shown that optimal learning requires that you to sometimes make some bad choices. This means that sometimes you have to choose to avoid the action you think will be most rewarding, and take an action which you think will be less rewarding. The rationale is that these ‘sub-optimal’ actions are necessary for your long term benefit – you need to go off track sometimes to learn more about the environment. The exploration-exploitation dilemma is really a trade-off : enjoy more now vs learn more now and enjoy later. You can’t avoid it, all you can do is position yourself somewhere along the spectrum.

Because the trade-off is fundamental we would expect to be able to see it in all learning domains, not just restaurant food choices. In work just published, we’ve been using a new task to look at how actions are learnt. Using a joystick we asked people to explore the space of all possible movements, giving them a signal when they made a particular target movement. This task – which we’re pretty keen on – gives us a lens to look at the relation between how people explore the possible movements they can make and which particular movements they learn to rely on to generate predictable outcomes (which we call ‘actions’).

Using data gathered from this task, it is possible to see the exploitation-exploration trade-off in action. With each target people get 10 attempts to try to identify the right movement to make. Obviously some successful movements will be more efficient than others, because it is possible to hit the target after going all “round the houses” first, adding lots of extraneous movements and taking longer than needed. If you had a success like this you could repeat it exactly (‘exploit’), or try and cut out some of the extraneous movement and risk missing the target (‘explore’). Obviously this refinement of action through trial and error is of critical interest to anyone who cares about how we learn skilled movements.

I calculated an average performance score for the first 50% and second 50% of attempts (basically a measure of distance travelled before hitting the target – so lower scores mean better performance). I also calculated how variable these performance scores were in the first 50% and second 50%. Normally we would expect people who perform best in the first half of a test to perform best in the second half (depressingly people who start out ahead usually stay there!). But this analysis showed up something interesting: a strong correlation between variability in the first half and performance in the second half. You can see this in the graph

This shows that people who are most inconsistent when they start to learn perform best towards the end of learning. Usually inconsistency is a bad sign, so it is somewhat surprising that it predicts better performance later on. The obvious interpretation is in terms of the exploration-exploitation trade-off. The inconsistent people are trying out more things at the beginning, learning more about what works and what doesn’t. This provides them with the foundation to perform well later on. This pattern holds when comparing across individuals, but it also holds for comparing across trials (so for the same individual, their later performance is better for targets on which they are most inconsistent on early in learning).

You can read about this, and more, in our new paper, which is open-access over at PLoS One A novel task for the investigation of action acquisition.

New paper: A novel task for the investigation of action acquisition

June 4th, 2012 § 0 comments § permalink

Our new paper, A novel task for the investigation of action acquisition, has been published in PLoS One today. The paper describes a new paradigm we’ve been using to investigate how actions are learnt.

It’s a curious fact that although psychologists have thoroughly investigated how actions are valued (i.e. how you figure out how good or bad a thing is to do), and how actions are trained (i.e. shaped and refined over time), the same effort has not gone into investigating how a behaviour is first identified and stored as a part of our repertoire. We hope this task provides a useful tool for opening up this area for investigation.

As well as the basic description of the task, the paper also contains a section outlining how the form of learning the the task makes available for inspection is different from the forms of learning made available by other ‘action learning’ tasks (such as, for example, operant conditioning tasks). In addition to serving an under-investigated area of learning research, the task also has a number of practical benefits. It is scalable in difficulty, suitable for repeated measures designs (meaning you can do it again and again – it isn’t something you learn once and then can’t be tested on any more) as well being adaptable for different species (meaning you can test humans and non-human animals on the task).

The paper is based on work done as part of the EU robotics project I’m on (‘I’M-CLeVeR‘) and on Tom Walton’s PhD thesis, The Discovery of Novel Actions

The Natures of Explanation

May 9th, 2012 § 2 comments § permalink

(Attention conservation notice: mostly me trying to work out what I mean. If you know, feel free to get in touch)

Explanation is not a zero-sum game. You can add additional explanations without negating existing explanations. The loss of life after the flooding of New Orleans was due to Hurricane Katrina. And it was due to climate change. And under-investment in the levees. And a history of social exclusion based on race and class. All these explanations are true, there is no explanatory exclusivity.

I am reading Bruno Latour’s “Science in Action” where he gives the best (only?) account I have seen of how any explanation can be countered or superseded by subsequent explanations. Scientists seek to settle claims – to generate “black boxes” of fact, in Latour’s terms – but the process of scientific debate sees a flux of competing explanations. An experiment by A said X. But two experiments by Y said not-X. But Y isn’t using the correct equipment, of course his experiments give the wrong results. But X’s equipment is biased to give the answer X, Y has to use non-standard equipment. But Z has shown not-X with A’s equipment for sub-case Z. And so on. Explanations seek to settle, but can always be weakened by subsequent explanations which qualify, reframe or negate. It is not just that subsequent claims diminish our confidence that X is the case, on some linear scale where 0>confidence>1. Instead, there is a fundamental uncertainty in the very metrics we are judging.

We seek to define or find (domains) where exclusivity applies. Responsibility and blame feels like a domain where exclusivity applies – almost by definition, because we want it to apply. If it was my fault it is not your fault. We want blame to sum to 1, so that even in complex cases we sort through the responsibility of all involved an apportion a limited amount of blame to each party.

Obviously, when non-exclusive explanations originating from science are used in the moral domain, it is natural for people to interpret them exclusively. If your brain or your environment made you commit a crime, it is not your fault. In a similar way – perhaps essentially similar – freedom of the will is often talked about as an exclusive property. Is your choice at the moment free OR is it pre-determined? This is a fundamental misconception, in my opinion.

You need a tolerance for ambiguity to deal in non-exclusive explanations. Usually we seek to find a restricted domain where we can argue over explanations which are, temporarily, exclusive. Is it nature or nurture? Is dyslexia caused by cerebellar dysfunction or magnocellular pathway dysfunction? For the non-restricted domain the ground can always shift underneath you. Someone can come along a redefine any element of what you are arguing about, including the tools of argument themselves.

Quote #285: Of Beauty

March 27th, 2012 § 0 comments § permalink

There is no excellent beauty that hath not some strangeness in the proportion

Francis Bacon (1561–1626), ‘Of Beauty‘.

Psychology’s missing link

March 25th, 2012 § 0 comments § permalink

Affordance links perception to action, as it links a creature to its environment. It links both to cognition, because it relates to meaning. Mean­ing is in the world, as much as in the mind, because meaning involves the appropriateness of an organism’s actions to its surroundings

Eleanor Gibson, in Gibson, E. J. (1988). Exploratory behavior in the development of perceiving, acting, and the acquiring of knowledge. Annual review of psychology, 39(1), 1–42.

Links for March-February 2012

March 23rd, 2012 § 0 comments § permalink