One of the more boring tasks a referee faces is to check the algebra of a submission that looks promising. This is often trivial to do but may be quite time consuming, and it requires concentration. Given programs like Mathematica, the task can be simplified by asking authors to give their calculations in machine readable code. This would render it easier to do such boring checks and would, at the same time, help authors to avoid mistakes.
Mathematica is, however, too expensive. Is there any freeware that could be used for such purposes? If so, RePEc could recommend using it as a standard. This would ease the refereeing process. Referees could concentrate on contents rather than being immersed in ultimately trivial calculations. Such a program must of course be able to do symbolic calculations, like forming derivatives or evaluating symbolic equation systems.
I use R: http://www.r-project.org/
It’s almost as good as mathematica at this stage, and has a huge community behind it.
Maxima is an open-source (e.g., free) computer algebra system ( http://maxima.sourceforge.net/ ) which would be able to replicate Mathematica’s capabilities. It is capable of symbolic derivations. I’ve never personally tried it, but I have heard positive feedback from others.
A good overview of some open-source computer application packages can be found here: http://www.springerlink.com/content/3224808lu7871175/
One should first question why referees should be checking algebra. Given the number of referees a paper goes through until it is published, this seems a highly inefficient use of time. No wonder refereeing takes forever. If this task can be taken over by some automatic verification, the better. That would allow a paper to be really judged on its true contribution, beyond algebra. But it would require authors to contribute the program code for their model, and then referees would end up checking for bugs in the code…
Shane, does R do symbolic computations? I checked the standard version, and it seems that the feature is not available (example: Calculate the derivative of f(x)/g(x) with f() and g() unspecified).
Tom, I checked Maxima. This seems to work well. So maybe this could serve as a starting point for creating a standard.
Christian, it would not be so much debugging any code, because in Maxima (or, what I know better, Mathematica) there is no code, simply a standard way to write down mathematical expressions. If these expressions are typed in, they look very much like the formulae in the paper. Of course the program will usually come up with different but equivalent expressions. So if I start with a Lagrange thing, for instance, the paper will give the derivatives. The accompanying script will give the same Langrange function. From this, the program calculates the derivative. The referee sees that in the print out and can check it in the script if he wishes. In a next line, the author will program a query whether the formula derived by the program is identical to the formula given in the paper, and the response will be “True”. Much of the script will simply count as a proof.
So with these programs you do not need to really check everything, and there is no “programming” involved.
I guess Maxima is ideal for our purposes. I shall try, however and check more closely. The next submission I do will include a Maxima script. How it works with Mathematica can be seen from the attachment I did for a recent revision available here:
I have provided calculations in Mathematica output form for a paper of mine at
You find it under “calculations.pdf.” I am going to prepare a similar output with Maxima (if it turns out to be workable). These examples may serve to illustrate what I have suggested.
R does not do symbolic computation.
Hopefully Maxima works. I have no doubt it will have the same outcome as the Mathematica code you posted.
I could see two potential areas for problems: (1) complicated symbolic mathematics and (2) numeric computation. For (1), sometimes derivatives or integrals with several natural logs or exponential functions can give some output with esoteric notation that economists usually don’t see (I don’t have examples, and never ran across it doing economic computations, but saw it for other math problems).
For (2), the floating point can differ between programs and computers. I found MatLab 10*.05 == 5 is false because of a floating point issue, but could not replicate the problem in Mathematica, R and Java. If your .nb file contained numerical approximations, one of your steps may be false depending on the computer (32-bit vs. 64-bit) and language (Mathematica v. Maxima).
Elmar Nubbemeyer is just replicating my little example in Maxima. It seems to work well. Elmar will post it soon. It seems that it does not look as intuitive as in Mathematica. (Maxima has no Greek letters, for instance.)
As to your points:
(1) Even if you obtain esoteric output, you still can test whether the formulae you gave in your text are correct or not, just by checking for equality. So the idea would not be to give derivations of your results to the referee, but rather to check your results by testing for equality of the results derived by the program and the results given in your paper in a way the referee can easily replicate. This should work for symbolic calculations.
(2) This is certainly a problem. The question is how relevant this is for cases the referees could be expected to check. The MatLab bug you report seems exceptional. As a rule, and from my own experience, Mathematica calculations are much more reliable than my own. Further, we should not ask more from the programs than we do from the referees at this point in time.
I have now reconstructed all calculations in Maxima. The Maxima session file can be downloaded here: http://www.semverteilung.vwl.uni-muenchen.de/ekkehart/downloads/Schlicht_calculations.wxm , and a PDF printout of all inputs and outputs is available here: http://www.semverteilung.vwl.uni-muenchen.de/ekkehart/downloads/Schlicht_calculations.pdf .
First of all, when it comes to the features of the software, it is no problem to do these types of calculations with Maxima. Although I found the syntax at times less intuitive than Mathematica’s, Maxima lets you easily define functions and variables, solves equation systems, calculates derivatives, checks equality of given expressions etc.
But, in comparison to Mathematica, I found the handling at times less comfortable. Maxima offers no direct support for greek letters –
there is a display option, but then you have to type the full name of the greek latter every time you use it, e.g. “alpha”. Editing existing session files is also more cumbersome (I used the front-end wxMaxima, maybe this is easier with other clients). Exporting options are also limited in comparison to Mathematica, especially beause the Latex export only works for single outputs and there is no command to export a whole Maxima session to Latex.
All in all, I think Maxima could be suited for many cases of economic modelling and as a standard for submitting mathematical appendices of articles. But I have to add here that I’m lacking necessary experience in both
Maxima and Mathematica to give a thorough judgement on this.