## Monday, November 25, 2013

### Collaboration Distance and the Math Genealogy Project

The American Mathematical Society has a fun site on "collaboration distance" between various mathematicians. The idea is simple: If, for example, I wrote with X, and X wrote with Z, then my collaboration distance to Z is two. There's a good description here, and the actual calculator is here.

You can track your collaboration distance not only to Erdos (of course), but also to all-time giants like Gauss or Laplace. The calculator reveals, for example, that my collaboration distance to Gauss is just eight:

I co-authored with Marc Nerlove
Marc Nerlove co-authored with Kenneth J. Arrow
Kenneth J. Arrow co-authored with Theodore E. Harris
Theodore E. Harris co-authored with Richard E. Bellman
Richard E. Bellman co-authored with Ernst G. Straus
Ernst G. Straus co-authored with Albert Einstein
Albert Einstein co-authored with Hermann Minkowski
Hermann Minkowski co-authored with Carl Friedrich Gauss.

Wow -- and some great company along the way, quite apart from the origin at old Carl Friedrich!

Of course I understand the "small-world" network phenomenon, but it's nevertheless hard not to be astounded at first.

So how truly astounding is my eight-step connection to Gauss? Let's do a back-of-the-envelope calculation. For a benchmark Erdos-Renyi network we have:

$$max \approx \frac{\ln N}{\ln \mu},$$
where $$max$$ is the maximum collaboration distance, $$N$$ is the number of authors in the network, and $$\mu$$ is the mean number of co-authors. Suppose there are 1,000,000 authors ($$N=1,000,000$$), each with 5 co-authors (so, trivially, $$\mu=5$$). Then we have $$max \approx 9$$.

Hmmm...I'm no longer feeling so special.

## Monday, November 18, 2013

### The e-Writing Jungle Part 2: The MathML Impasse and the MathJax Solution

Back to LaTeX and MathJax and MathML and Python and Sphinx and IPython and R and Knitter and Firefox and Chrome and ...

In Part 1, I praised e-books done as LaTeX to pdf to the web, perhaps surprisingly. Now let's go the other way, to an e-book done natively on the web as HTML. Each approach is worth considering, depending on the application, as each has different costs and benefits.

Part 2: The MathML Impasse and the MathJax Solution

All we want is an HTML version with native support and beautiful rendering of mathematics. That's what HTML5 does, except for a small detail: many browsers (IE, Chrome, ...) won't display HTML5. The real problem is MathML, which is embedded in HTML5, and which is the key to math fonts in HTML5 or anywhere else. It's not just a question of browser suppliers finally waking up and flipping on the MathML switch; rather, successful MathML integration turns out to be really hard (seriously, although I don't really know why), and there are also security issues (again seriously, and again I don't really know why). For those reasons, the good folks at Microsoft and Google, for example, have now basically decided that they'll never support MathML. There's a lot of noise about all this swirling around right now -- some of it quite bitter -- but a single recent informative and entertaining piece will catapult you to the cutting edge, "Google Subtracts MathML from Chrome, and Anger Multiplies," by Steven Shankland.

The bottom line: Math has now been officially sentenced to an eternity of second-class web citizenship, in the sense that native and broad math browser support is not going to happen. But that brings us to MathJax, a JavaScript app that works with HTML. You simply type in LaTeX and MathJax finds any math expressions and renders them beautifully. (For an example see my recent post On the Wastefulness of (Pseudo-) Out-of-Sample Predictive Model Comparisons, which was done in LaTeX and rendered using MathJax.) Note well that MathJax is not just pasting graphics images; hence its output scales nicely and works well on mobile devices too. For all you need to know, check out "MathML Forges On," by Peter Krautzberger.

So what's the big problem? Doesn't HTML plus MathJax basically equal HTML5, with the major additional benefit that it actually works? Of course it's somewhat insulting to us math folk, and certainly it's aesthetically unappealing, to have to overlay something on HTML just to get it to display math. (I'm reminded of the old days of PC hardware, with separate "math co-processors.") And there are other issues. For example, MathJax loads from the cloud (unless it's on your machine(s), which requires installations and updates, and which can't be done for mobile devices), and the MathJax math rendering may take a few seconds or more, depending on the speed of your connection and the complexity/length of your math.

But are any of the above "problems" truly serious? I don't think so. On the contrary, MathJax strikes me as a versatile and long-overdue solution for web-based math. And its future looks very bright, with official supporters now ranging from the American Mathematical Society to Springer to Matlab. (Not that I'm a fan of Matlab any longer -- please join the resistance, purge Matlab from your life, and replace it with Python and R -- but that's a topic for another day.)

[Next: Python, Sphinx, ...]

## Monday, November 11, 2013

### A New Center to Watch for Predictive Macroeconomic and Financial Modeling

Check out USC's fine new Center for Applied Financial Economics, led by the indefatigable Hashem Pesaran. The first event is a fascinating conference, "Recent Developments on Forecasting Techniques for Macro and Finance."  Lots of information here, and program below.

PROGRAM

Wednesday, November 20th, 2013

8:00-8:45 a.m. Registration and Continental Breakfast

8:45-9:00 a.m. WELCOME
Hashem Pesaran, John E. Elliott Distinguished Chair of Economics and Director of the Centre for Applied Financial Economics (CAFE), USC Dornsife

9:00-9:50 a.m. SESSION I Chair: Robert Dekle
Speaker: Òscar Jordà
Title: Semiparametric Estimates of Monetary Policy
Effects: String Theory Revisited. With Joshua D. Angrist and Guido Kuersteiner.
Discussant: Eleonora Granziera

9:50-10:40 a.m. SESSION II Chair: Yu-Wei Hsieh
Speaker: Michael W. McCracken
Title: Evaluating Forecasts from Vector Autoregressions Conditional on Policy Paths. With Todd E. Clark.
Discussant: Andreas Pick

11:00-11:50 p.m. SESSION III Chair: Michael Magill
Speaker: Jose A. Lopez
Title: A Probability-Based Stress Test of Federal Reserve Assets and Income. With Jens H.E. Christensen and Glenn D. Rudebusch.
Discussant: Wayne Ferson

11:50-12:40 p.m. SESSION IV Chair: Yilmaz Kocer
Speaker: Tae-Hwy Lee
Title: Density and Risk Forecast of Financial Returns Using Decomposition and Maximum Entropy. With Zhou Xi and Ru Zhang.
Discussant: Hyungsik Roger Moon

2:00-2:50 p.m. SESSION V Chair: Juan D. Carrillo
Speaker: Allan Timmermann
Title: Equivalence Between Out-of-Sample Forecast
Comparisons and Wald Statistics. With Peter Reinhard Hansen.
Discussant: Hashem Pesaran

2:50-3:40 p.m. SESSION VI Chair: Jeffrey B. Nugent
Speaker: Gloria Gonzalez-Rivera
Title: In-Sample and Out-of-Sample Performance of
Autocontour-Testing in Unstable Environments. With
Yingying Sun.
Discussant: Cheng Hsiao

4:00-4:50 p.m. SESSION VII Chair: Giorgio Coricelli
. Speaker: Gareth M. James
Title: Functional Response Additive Model Estimation with
Online Virtual Stock Markets. With Yingying Fan, Natasha Foutz, and Wolfgang Jank.
Discussant: Dalia A. Ghanem

4:50-5:40 p.m. SESSION VIII Chair: Joel David
Speaker: Marcelle Chauvet
Title: Nowcasting of Nominal GDP. With William A. Barnett and Danilo Leiva-Leon.
Discussant: Michael Bauer

5:40 p.m. Concluding Remarks

## Thursday, November 7, 2013

### The e-Writing Jungle Part 1: LaTeX to pdf to the Web

LaTeX and MathML and MathJax and Python and Sphinx and IPython and R and Knitter and Firefox and Chrome and ...

My head is spinning with all this stuff. Maybe yours is too.

One thing is clear: The traditional academic book publishing paradigm (broadly defined) is cracking and will soon be crumbling. In the emerging e-paradigm there will be essentially no difference among books, courses, e-books, e-courses, web sites, blogs, and so on. With no loss of generality, then, let's just call it all "e-books," filled with text, color graphics, audio/video, animations, interactive learning tools, massive numbers of internal and external hyper-links, etc.

An interesting question is how to create (write"?) and distribute such e-books. The amazing thing is that the answer remains unclear. Both pitfalls and opportunities abound. Here are some thoughts.

Part 1:  LaTeX to pdf to the Web

One obvious e-book creation and distribution route is traditional LaTeX, compiled to pdf and posted on the web. Effete insiders now sneer at that, viewing it as little more than posting page photos of an old-fashioned B&W paper book. I beg to differ. What's true is that most people still fail to use the e-capabilities of LaTeX, so of course their pdf product is little more than an e-copy of an old paper book, but that's their fault. All of the above-mentioned e-desiderata are readily available in LaTeX/pdf/web; one just has to use them!

Moreover, LaTeX/pdf/web has at least two extra benefits relative to a website (say). First, trivially, the pdf is instantly printable on-demand as a beautiful traditional book, which is sometimes useful. Second, and more importantly, the linear beginning-to-end layout of a "book" -- in contrast to the non-linear jumble of links that is that is a website -- is pedagogically invaluable when done well. That is, good authors put things in a precise order for a reason, and readers benefit by reading in that order.

OK, you say, but how to restrict access only to those who pay for a LaTeX/pdf/web e-book? (It's true, a pdf web post is basically impossible to copy-protect.) My present view is very simple: Just get over it and forget the chump change. Scholarly monographs and texts are labors of love; the real compensation is satisfaction from helping to advance and spread knowledge. And if that's not quite enough, rest assured that if you write a great book you'll reap handsome monetary rewards in subtle but nevertheless very real ways, even if you post it gratis.

[To be continued. Next: HTML and MathML and LaTeXtoHTML5 and MathJax and ...]

## Monday, November 4, 2013

### Federal Reserve Bank of Philadelphia Launches Improved U.S. GDP Growth Series

Exciting news for empirical macroeconomics and finance: The Federal Reserve Bank of Philadelphia today released a new and improved $$GDP$$ growth series, $$GDPplus$$. It's an optimal blend of the BEA's expenditure-side and income-side estimates (call them $$GDP_E$$ and $$GDP_I$$, respectively). The $$GDPplus$$ web page contains extensive background information and will be updated whenever new or revised data for $$GDP_E$$ and/or $$GDP_I$$, and hence $$GDPplus$$, are released.

$$GDPplus$$ (developed in Aruoba, Diebold, Nalewaik, Schorfheide and Song, "Improving GDP Measurement: A Measurement-Error Perspective," NBER Working Paper 18954, 2013) is based on a dynamic-factor model,

$$\begin{pmatrix} GDP_{Et} \\ GDP_{It} \end{pmatrix} = \begin{pmatrix} 1 \\ 1 \end{pmatrix} GDP_t + \begin{pmatrix} \epsilon_{Et} \\ \epsilon_{It} \end{pmatrix}$$
$$GDP_{t} = \mu (1- \rho) + \rho GDP_{t-1} + \epsilon_{Gt},$$
where $$GDP_E$$ and $$GDP_I$$ are noisy indicators of latent true $$GDP$$, $$\epsilon_{E}$$ and $$\epsilon_{I}$$ are expenditure- and income-side stochastic measurement errors, and $$\epsilon_{G}$$ is a stochastic shock to true $$GDP$$. The Kalman smoother provides an optimal estimate of $$GDP$$ based on the noisy indicators $$GDP_{E}$$ and $$GDP_{I}$$. That optimal estimate is $$GDPplus$$. Note that $$GDPplus$$ is not just a period-by-period simple average, or even a weighted average, of $$GDP_E$$ and $$GDP_I$$, because optimal signal extraction averages not only across the $$GDP_E$$ and $$GDP_I$$ series, but also over time.

The historical perspective on $$GDP$$ provided by $$GDPplus$$ complements the real-time perspective on the overall business cycle provided by the Aruoba-Diebold-Scotti (ADS) Index, also published by the Federal Reserve Bank of Philadelphia.

Moving forward, $$GDPplus$$ will be updated at 2 PM on every day that new and/or revised $$GDP_E$$ and/or $$GDP_I$$ data are released. The next update will be November 7, the day of BEA's NIPA release for Q3 (delayed due to the government shutdown).

## Friday, November 1, 2013

### LaTeX/MathJax Rendering in Blog Posts

It seems that LaTeX/MathJax is working fine with my blog, including with mobile devices, which is great (see, for example, my recent post On the Wastefulness of (Pseudo-) Out-of-Sample Predictive Model Comparisons). However, a problem exists for those with email delivery, who just get raw LaTeX dumped into the email. If that happens to you, simply click on the blog post title in the email. Then you'll be taken to the actual blog, and it should render well.

Please let me know of any other problems!