Some Notes on Converting From Subversion to Mercurial (hg)
May 17th, 2008
Distributed versioning systems (VCMs) have now matured to the point that I’ve been planning to switch from subversion for quite a while — at least for own personal repositories where there are no coordination issues. Having chosen mercurial (hg) as my DVCM of choice the next step was to actually convert. While there is quite a bit of documentation on this topic available online I didn’t always find these had the necessary info. Combined with my experience of several ’snags’ along the way I thought it worth documenting my experience in case it proves useful to others.
I’d waited until hg 0.9.5 was available on my distro precisely because I wanted to use the hg convert functionality (alteratives such as tailor looked to have difficulties and though it turned out I could have used hgsvn without problem my original impression of it had been it was oriented for integration of hg and svn rather than straight conversion).
Before I docment the steps it is important to get clear one v. important thing about how hg works:
There is no distinction between a working copy and a repository.
In particular, each repository is a working copy and vice versa. The actual repo is stored inside the working copy at its root in a .hg directory. When you ‘checkout’ (svn terminology) you do so simply by ‘cloning’ an existing repository (or if just want a limited set of changes — e.g. those since you lasted ‘updated’ (svn terminology) you can do a ‘pull’). In fact you could even just make a plain copy that .hg directory and send it to someone — though obviously this might not work so well if you are moving between 2 OSs with different filesystems.
Anyway, the main point to take from this is that the result of an hg convert will simply be a new directory with all the files (the working copy) plus a .hg directory in that directory (the repo).
To convert all you do is::
$ hg convert <svn-repo-or-co> <some-new-directory>
The devil however is in the detail:
- svn-repo-or-co can be the uri of a subversion repo or the path of a svn checkout. Where a checkout hg convert will just work out the source repo and pull from there
- Note however hg convert will not move across working copy files themselves. The obvious solution to this is to do the convert and then just move the .hg file across into your svn checkout and delete all the .svn directories (or vice-versa)
- some-new-directory: this is where the new hg repo/working copy with end up.
- After doing hg convert rather surprisingly all of the files in the new hg repository will be listed as ‘?’ (not tracked) when you do a
hg status. To solve this just do ahg update - To speed up conversions it is often worth getting a local copy of the subversion repo (to save pulling lots of stuff over the network connection). To do this either use svnsync or just dump the remote repo and load into a local one (if converting from a working copy you’ll then just need to do a
svn switch --relocate - My repository did not have a branches/tags/trunk layout (instead it has multiples subprojects …). This led to weird errors involving files and directories at the root of the repository which looked like: ‘hg convert abort: path contains illegal component’. I solved this by using the
--filemapoption tohg convertand putting explicit renames of the form:/root-path-1 root-path-1in that file. - What do you for all the other working copies once you have converted the repo/your working copy? This is now simple:
- Clone your hg repo to each of the machines with a working copy.
- For this purpose you will probably want to make your original hg repo available over the Internet using either ssh or http protocols (for details see mercurial docs).
- Copy over the svn working files into that new hg repo
- For this purpose you will probably want to make your original hg repo available over the Internet using either ssh or http protocols (for details see mercurial docs).
- Clone your hg repo to each of the machines with a working copy.
Today I’ll be presenting my paper Forever Minus a Day? Theory and Empirics of Optimal Copyright Term at Stanford in the Social Science and Technology Seminar Series (also here).
This new paper is a heavily revised version of the copyright-term specific portions of my original ‘Forever Minus a Day’ paper (see post from last summer). The rest of the original paper can now be found in Optimal Copyright over Time: Technological Change and the Stock of Works which was published in the December issue of the Review of Economic Research on Copyright Issues (RERCI).
Update post-talk (2008-05-16): the slides are now online at:
http://rufuspollock.org/economics/papers/optimal_copyright_term_talk_stanford.pdf
What’s Wrong with Modern Macroeconomics
May 6th, 2008
This January I met Alan Kirman at the Robinson Workshop on Rationality and Emotions. Over lunch we had a brief discussion about the difficulties of modern macroeconomics. I was therefore intrigued to see a new paper of his (co-authored with Peter Howitt, David Colander, Axel Leijonhufvud and Perry Mehrling) entitled Beyond DSGE Models: Towards an Empirically-Based Macroeconomics which was presented in January at the AEA conference (and looks like it will be appearing in the AER ‘Papers and Proceedings’).
The paper has much to say about the current state of macro, in particular the serious problems with DSGE (dynamic stochastic general equilibrium models) and where we should go from here. As the abstract puts it:
This paper argues that macro models should be as simple as possible, but not more so. Existing models are “more so” by far. It is time for the science of macro to step beyond representative agent, DSGE models and focus more on alternative heterogeneous agent macro models that take agent interaction, complexity, coordination problems and endogenous learning seriously. It further argues that as analytic work on these scientific models continues, policy-relevant models should be more empirically based; policy researchers should not approach the data with theoretical blinders on; instead, they should follow an engineering approach to policy analysis and let the data guide their choice of the relevant theory to apply.
It is worth quoting at some length from the paper in order to bring out the full ramifications of the story the authors tell:
Keynesianism Goes Wrong
With the development of macro econometric models in the 1950s, many of the Keynesian models were presented as having formal underpinnings of microeconomic theory and thus as providing a formal model of the macro economy. Specifically, IS/LM type models were too often presented as being “scientific” in this sense, rather than as the ad hoc engineering models that they were. Selective micro foundations were integrated into sectors of the models which give them the illusory appearance of being based on the axiomatic approach of General Equilibrium theory. This led to the economics of Keynes becoming separated from Keynesian economics.
The Reaction and a New Dawn (Rational Expectations and Neoclassical GE Models)
The exaggerated claims for the macro models of the 1960s led to a justifiable reaction by macroeconomists wanting to “do the science of macro right”, which meant bringing it up to the standards of rigor imposed by the General Equilibrium tradition. Thus, in the 1970s the formal modeling of macro in this spirit began, including work on the micro foundations of macroeconomics, construction of an explicit New Classical macroeconomic model, and the rational expectations approach. All of this work rightfully challenged the rigor of the previous work. The aim was to build a general equilibrium model of the macro economy based on explicit and fully formulated micro foundations.
But ‘Technical’ Difficulties Intervene
Given the difficulties inherent in such an approach, researchers started with a simple analytically tractable macro model which they hoped would be a stepping stone toward a more sensible macro model grounded in microfoundations. The problem is that the simple model was not susceptible to generalization, so the profession languished on the first step; and rational expectations representative agent models mysteriously became the only allowable modeling method. Moreover, such models were directly applied to policy even though they had little or no relevance. … [emphasis added]
But There Was a Reason For This: Other Stuff is Hard
The reason researchers clung to the rational expectations representative agent models for so long is not that they did not recognize their problems, but because of the analytical difficulties involved in moving beyond these models. Dropping the standard assumptions about agent rationality would complicate the already complicated models and abandoning the ad hoc representative agent assumption would leave them face to face with the difficulties raised by Sonnenschein, Mantel and Debreu. While the standard DSGE representative models may look daunting, it is the mathematical sophistication of the analysis and not the models themselves which are difficult. Conceptually, their technical difficulty pales in comparison to models with more realistic specifications: heterogeneous agents, statistical dynamics, multiple equilibria (or no equilibria), and endogenous learning. Yet, it is precisely such models that are needed if we are to start to capture the relevant intricacies of the macro economy.
Building more realistic models along these lines involves enormous work with little immediate payoff; one must either move beyond the extremely restrictive class of economic models to far more complicated analytic macro models, or one must replace the analytic modeling approach with virtual modeling. Happily, both changes are occurring; researchers are beginning to move on to models that attempt to deal with heterogeneous interacting agents, potential emergent macro properties, and behaviorally more varied and more realistic opportunistic agents. The papers in this session describe some of these new approaches. [emphasis added]
Some Closing Comments of My Own
So there you go: plenty of tough challenges and a big dose of humility. To some extent here it seems thing run on 30-40 years cycles: Keynesianism from 1945-1975, Rational Expectations DSGE from 1975-2005 and now we’re into the era of complexity and ‘loose’ tools with emphasis on empirics and heuristics rather than formal models. Whether this new approach will deliver more than the old is yet to be seen. After all, one reason that there are so many physicists getting interested in Economics and Finance is that the going is so hard in, e.g., condensed matter physics (superconductivity anyone …). If the economy really is so complex will we ever do any better at the macro scale than we do for the weather and if so will it not rely on some conceptual breakthrough rather than just doing using more hard-core dynamical systems theory and running more agent-based simulations?
That said, as the authors argue, the ’simple’ route isn’t working and the hardness of the path is no reason not to attempt it — an argument in many ways directly inverse to the traditional ‘drunkard-and-the-lamp’ approach in which we restrict our models, often beyond the point in which they remain relevant, in order to maintain analytical tractability. Thus, though cautious regarding what more ‘complexity-oriented’ methods can deliver, I am in wholehearted agreement with the authors that they justify much greater exploration.
Death in Hamburg: Society and Politics in the Cholera Years, 1830-1910 by Richard Evans
May 1st, 2008
6/10. Death in Hamburg: Society and Politics in the Cholera Years, 1830-1910 by Richard Evans
This book promises much but ultimately rather disappoints, largely because of its tendency to lose focus, sprawling into this of that side-avenue. Partly this must be due to a lack of clarity as to what the book is about — an impression strongly reinforced by the book’s afterword which does much to illuminate the intentions and the author.
Is this a narrative history? An analytic investigation of the of public health provision, focusing especially on the 1892 epidemic? A wide-ranging overview of Hamburg society and the mentality of its dominant classes, a marxist-influenced study of class tension and conflict or …? The author does not seem to be sure. The result is rather a mish-mash.
At some points we seem to be investigating the political and social reasons for Hamburg’s poor public health outcomes, in particular the constant fighting between the different ‘fractions of capital’ (in particular the merchant/lawyer senators and the property-owners) over the provision of public goods, at others having a detailed description of working class living conditions, and at another a history of medical approaches to cholera and other diseases in the 19th century, and at another describing in detail how the ‘dominant’ classes used charitable support both in general, and after the 1892 epidemic, to exercise social and moral ‘control’.
Of course, it is possible these different approaches and angles could have been woven together to produce a single rich and compelling whole. But this is not so. To take the main focus of the book — which I take to be the Cholera epidemic of 1892 together with its causes and outcomes. By the time I had finished the more than 700 pages I was still unsure as to what, in Professor Evan’s view, were the main reasons for Hamburg’s terrible performance in comparison with other German (or European) cities. To pick just a few of the possible ones:
- The failure to develop sand-filtration for the public water supply. Was this in turn due to:
- The form of the Citizens’ Assembly, in particular the ability of the property owners to block improvements that might result in reductions in their profits.
- Early investment in a new water system which then made it relatively more costly to upgrade later (Hamburg was one of the first cities in Germany to develop an external resevoir).
- Ideological opposition (see next items)
- The ideological commitment of Hamburg’s ruling groups to ‘Trade’ and ‘Laissez Faire’
- Reinforced, perhaps, by direct self-interest in the case of ship-owners and others for whom quarantine meant serious disturbance to their work or enterprise
- The inefficient governance structures (in particular the operation and make-up of the Senate and Burgomaster)
- Hamburg’s governance compared particularly poorly with the more efficient, though also more, authoritarian action of the Imperial government (particularly that of the Imperial Health Office and Koch).
- Continuing support in medical circles (and in administrative positions) for ‘miasmatist’ rather than ‘contagionist’ theories of disease (especially in relation to Cholera)
- The inadequate living conditions of the poor especially in the ‘Alley Quarters’.
- Incorrect medical treatment either due to lack of medical knowledge or incompetence.
- The (in)ability of different socio-economic groups to follow the medical instructions provided — whether because of wealth (e.g. ‘rich’: able to have their servant boil all their water, ‘poor’: unable to resist the fruit which is suddenly cheaply available because normally denied it), literacy (can one read the instructions distributed), respect for ‘authority’, etc.
One would not expect to have a single explanation put forward but it would be useful to have some indication of which of these items were the more important, particularly where different reasons are substitutes not complements. For example, at several points Evans appears to indicate that the water-supply was the single biggest determinant of death by far (he cites a particularly illuminating comparison of a set of apartments that drew its water from two different sources). But if this is so then almost all of the focus should be on the water-supply question and why this public good was not present in Hamburg when it was elsewhere. No doubt, in answering this, one will be lead onto many of the other items as secondary causes but it an important step will have been made in stratifying, and thereby clarifying, the analysis. Furthermore, from this perspective an explicit comparative analysis with other localities becomes essential. While Evans does perform this to some extent, it is largely in terms of the behaviour of the localities in 1892 (e.g. re. imposition of quarantine) rather than the more important investigation of why those localities had sand filtration while Hamburg did not — in particular why had they found the political will to provide this important public good while Hamburg had not? In particular, why were the property-owners in Bremen, Berlin and elsewhere not able to block these same kinds of public infrastructure projects?
Once lead down this route the reader must be increasingly concerned about the weight, and attention, Evans focuses upon socio-ideological explanations (made particularly noticeable by the frequent intrusion of Marxist historiographical language and approach — an influence made explicit in the afterword). As Evans acknowledges in respect of most other disease outcomes Hamburg did little worse than elsewhere in Germany. If this is so how much does the 1892 epidemic really tell us about the society and politics of Hamburg (and vice-versa)? Perhaps if Hamburg had not invested early in its water supply, it would have had an ‘out-of-date’ one by 1892? Perhaps if Veresman had been Burgomaster more rapid and effective steps would have been taken early on that would have dramatically reduced the impact? Perhaps if Hamburg had been more authoritarian (rather than more democratic) the Senate would have been able to improve the water-supply earlier?
This brings me on to my final comment. The contemporary relevance of the book is emphasized in several places, for example on the back-jacket text and in several of the blurbs — Gordon Craig’s NYRB review extract quoted on the cover reads “… about the contemporary relevance of this book there can be no question”. Of course, we should allow for the fact that this was published in 1987 when the AIDS epidemic was receiving very widespread attention. But one does need to ask exactly what one does learn from this book regarding public health? That we should invest in public goods projects? That it is good for medical science to be accurate and correct? That one should respond rapidly to an outbreak of a contagious disease?
Surely the answer to all of these is yes. The devil, of course, is in the detail. how do we trade off the benefits of rapid and sharp response, which is likely to involve sharply restricting movement of persons and goods, against the costs of such restrictions both socially and commercially? What institutional structures will result in adequate investment in public goods and rapid response to public concerns? Are there tensions between responsiveness to concerns (e.g. via full representative government!) and effectiveness in action (which might necessitate a single executive office with significant power and autonomy)? Finally, if the answers to these questions are reasonably obvious (e.g. its Democracy stupid!) then what prevents a polity, whether today or in the 19th century, from acting in the correct way? (Answer: entrenched powers and vested interests — but how did these come into being and how are they overcome?).
The test then of Evans’ book is whether it supplies us with interesting answers to these, more nuanced, questions. In this regard the book, I feel, comes up short. Without a comparative analysis at the social, and more importantly, political level in other German (or European) cities how can we know whether Hamburg’s terrible experience was the result of a common generalizable pattern or mere historical accident?
In sum this an interesting book albeit a little lengthy and heavy-going in places. Confused as to its structure and purpose it largely fails to deliver on its promise to answer the main question posed on its jacket: “Why were nearly 10000 people killed in six weeks in Hamburg while most of Europe was left almost unscathed?” As such it is also limited in the light it can throw on public health problems today. Nevertheless the reader will have been left with a wide-ranging coverage of a whole variety of 19th century topics, most significantly the two items explicitly mentioned in the title: Hamburg and Cholera.
Notes on Theories of Contextual Judgement
April 30th, 2008
Over the last couple of months for the purpose of my research on happiness/subjective-well-being I’ve been putting together some notes on theories of contextual judgement. The first part of these is now in a form suitable for public consumption and I’ve posted them at:
http://www.rufuspollock.org/economics/notes/theories-of-contextual-judgement/
My Brother Was an Only Child
April 23rd, 2008
7/10. A good story and an excellent performance in the leading role combine to make this recent Italian drama a very watchable piece.
Happy Go Lucky
April 22nd, 2008
5.5/10. Not uninteresting and really quite funny in places. However, while certainly better than some of Leigh’s other recent outings, it was rather intermittent and never became more than a mildly diverting ramble around Poppy’s life.
Workshop on Well-Being IV
April 22nd, 2008
Following on from the third workshop a month ago, yesterday saw the third in the series of “Workshops on Well-being” take place at the LSE. This time the presentations were given by Mat White of Plymouth University and Andrew Steptoe of UCL. Below are some (very) impressionistic notes.
Presentation by Mat White (+ Paul Dolan): Accounting for the richness of our daily activities
Social psychologist: started out on risk perception, trust etc. (Fear of crime)
General problems with life satisfaction data
- lots of it deals with attributes which are beyond realm of govt intervention (e.g. race, gender)
- Response/cross person comparisons issue: same externals result in different reported happiness levels across individuals (e.g. old, poor people are happiest in Dolan’s Welsh data, perhaps because of a “Don’t grumble” attitude). [ed: essence is the qualia problem: can we compare different people’s report of their internal states, both across people and across time. Or more pithily: is my ‘Good’ or ‘OK’ the same as your ‘Good’ or ‘OK’?]
- Subjective well-being isn’t one thing but a composite: SWB = Feelings + Thoughts + Time
Solutions
- Experience Sampling Method: ask people during day
- Problems: costly, only points in time, no duration etc
- Day Reconstruction Method (DRM): solve duration issues
- Can now base utility as integral of well-being function over time (ed: what utility always was but we just didn’t have the moment by data)
- Find what one might expect re. what activities are nice
- However no/v. weak correlation with e.g. income
- But maybe because those payoffs are in the future
- Or maybe because there are rewards in terms of thoughts, feelings about themselves etc (Eudamonia)
This project: add thoughts (about activities) to DRM
- 625 Germans
- 5815 Episodes (3057 single activities)
- Online panel
- Have 12 adjectives they can use which break down into ‘pleasurable’ and ‘rewarding’
Adding in Eudamonia makes a big difference!
- Nice graph contrasting the DRM with ‘pleasure’ vs. ‘rewarding’ (at least partially inversely correlated).
- Argue that we should sum both ‘eudaimonic’ and ‘hedonic’ evaluations over whole day.
- Can now plot activities on x-y graph with x=hedonia, y=eudamonia (normalized about the mean values)
- Get a slight -ve correlation
- ed: this makes sense due to selection effects. Let w be total well-being and h hedonia score, e is eudamonia score. Suppose w is a linear combination of these underlying factors: w = h + k e. Now we would generally choose only to do activites with w > w0 (some outside option) => h+ke > w0 which gives the -ve correlation.
- If reweight with duration [ed: equivalent to doing integral] then get a slight +ve correlation
ed: this reweighting by duration causes major changes to the form of the data. In particular all longer activities receive a positive shift while short ones receives a negative shift (explanation below). Whether this is what could/should do with the data was not entirely clear.
Why does this shift occur. Results are plotted as ‘relative’ values (i.e. normalized about the mean). Thus if original value (x,y) it is plotted at (x-m1,y-m2) where m1 is the overall x-mean and m2 is overall y-mean. Adding duration means original values are now (dx,dy) and these are plotted relative to n1,n2 where n1,n2 are new duration weighted means.
Letting dbar be the mean duration we could make the rough approximation that n1 = dbar m1, n2 = dbar y1. Then the new x position is: dx-n1 = dx - dbar m1 = d(x-m1) + (d-dbar)m1. Hence the new x-position will be a combination of a linear scaling out from the origin by d plus some offset of (d-dbar)m1. Since m1 is always positive this offset is positive (negative) as the duration of the activity is greater (less) than the mean duration of an activity.
After discussion
- pop-ups (thoughts either +ve or -ve) have a big impact
- in a regression on day-satisfaction number of +ve and-ve popups explained more than hedonic or eudamonic variables (total value for whole day)
- could be useful to look at something more than a simple integral [ed: e.g. use contextual judgment stuff]
- Eudamonia: enters day satisfaction regressions negatively. This is what we would expect given association of ’satisfaction’ with ‘pleasurable’ activites and slight negative correlation of ‘rewarding’ (eudamonic) activities with ‘pleasurable’ (hedonic) ones.
- ed: could interpret eudamonic value as discounted future value coming from associated payoffs. I.e. if I work hard now this might not be pleasurable but it has high eudamonic content reflecting the future hedonic payoffs (nice garden, good holidays etc) of doing that work (NB: this is intentionally putting things very crudely).
Andrew Steptoe: DRM Analyses
Primarily interested in ‘positive affect’ and health outcomes
Questions:
- how accurate is DRM
- what does DRM tell us about activities and feelings of depressed people
Data: Daytracker study
- 200 healthy women in full-time work
- 2 x 24hr starting @ 5pm (one work day and one non work-day)
- International dimension
- EMA and DRM
Comparing EMA and DRM
- Across aggregate data already see some differences (DRM shows noticeable rise towards end day while EMA does not really show this)
- Per individual: similar differences but also fairly close correlation
- Doing actual correlation looking at 4 different aspects (happy, tired, stress, anger) find medium correlations (0.2-0.7) which is reasonable but not great
- also noticeable that timepoints are important: worst correlations are generally 12noon and 3pm
How accurate is the DRM for estimating feelings (esp. in relation to depression)
- Do depressed people: have diminished pleasure in all activities or is reduced exposure to good stuff?
- Depressed people are less happy across most interactions (except with Grandchildren) though effect (of depression) does vary and is strongest for being Alone or with your Partner
- Looking at time: depressed people seem to spend more time (compared to non-depressed) doing things they don’t like
- Similarly, looking across activities, depressed people are less happy doing most stuff
- Again looking at time, seem to find depressed people spending more time on things that they particularly dislike (relative to others)
- [ed: Not sure what this is telling us. After all the activities depressed people spend more time on may still be better than other options even if those options do not get as large a negative ‘hit’ from being depressed — e.g. house-work may not be much worse when depressed than non-depressed but it still might be worse than everything else]
In Bruges
April 21st, 2008
6.5/10. Interesting and unusual, though slightly conventionalized in its last 15 minutes. At last we have Ralph Fiennes playing an appropriately nasty character — I can never understand why he ends up in so many ‘romantic’ roles for his froideur and general demeanour make him entirely unsuited.
Teaching to the Test: Some (Old) Evidence from Kenya
April 21st, 2008
Several years ago I read Michael Kremer’s article entitled “Randomized Evaluations of Educational Programs in Developing Countries: Some Lessons” in the 2003 AER Papers and Proceedings issue (jstor link). This brief article reviewed some of the recent results of evaluating the effects of various different programs on educational outcomes in the developing world. What particularly caught my eye was this paragraph summarizing a teacher incentive program in Kenya:
Some parent-run school committees in the area provide gifts to teachers whose students perform well. Glewwe et al (2002a) evaluate a program that provided prizes to teachers in schools that performed well on exams and had low dropout rates. In theory, this type of incentive could lead teachers either to increase effort or, alternatively, to teach to the test. Empirically, teachers responded to the program not by increasing attendance, but by increasing prep sessions designed to prepare students for exams. Consistent with a model in which teachers responded to the program primarily by increasing effort devoted to manipulating test scores, rather than by increasing effort at stimulating long-term learning, test scores for pupils who had been part of the program initially increased but then fell back to levels similar to the comparison group at the end of the program. [p. 104, emphasis added]
This provides a nice ‘real-world’ example of exactly what can go wrong when providing incentives in a multi-task situation — that is one where the ‘agent’ (here the teacher) performs multiple tasks not all of which can be monitored equally. As such it should make us wary of the current trend to ever more performance-based reward structures in everything from schooling to health-care.
