Micro-consulting and mentoring

Sometimes a quick answer to a question is priceless. It can even be valuable to know that you could get a quick answer to a question, even if you never ask. For example, if your company is considering doing something new, knowing that there’s someone to help could make the difference in the decision to go forward.

Next year I’ll be offering this sort of micro-consulting and mentoring. For a monthly retainer, I will be available to answer questions and give advice. This would be for questions I could answer on the spot or with minimal research; anything more involved would have to be a separate consulting project. You would be guaranteed my availability for a certain amount of time per month and a quick turn-round on correspondence. (My response might be “I don’t know,” but I’d get back to you promptly.)

I’ve done some of this kind of consulting, and clients have found it very valuable. I’d like to do more of this next year as a way to fill some of the interstitial time between larger projects. I also expect it will lead to larger projects, e.g. “We like your idea of what we should do. Could you do it for us?”

If this sounds interesting to you, please contact me.

Heisenberg, Gödel, and Chomsky walk into a bar …

Seth Godin tells the following joke in The Icarus Deception:

Heisenberg looks around the bar and says, “Because there are three of us and because this is a bar, it must be a joke. But the question remains, is it funny or not?”

And Gödel thinks for a moment and says, “Well, because we’re inside the joke, we can’t tell whether it is funny. We’d have to be outside looking at it.”

And Chomsky looks at both of them and says, “Of course it’s funny. You’re just telling it wrong.”

Related: A priest, a Levite, and a Samaritan walk into a bar …

Visualizing Galois groups of quadratics

Yesterday Jack Kennedy told me about a graph he’d made as part of a project he’s working on and I asked if I could post it here.

The Galois group of a quadratic polynomial x2 + bx + c is either A2 or S2. If b2 – 4c is a perfect square, the polynomial has rational roots and the Galois group is the trivial group A2. Otherwise there are distinct irrational roots and the Galois group is the two-element group S2.

As b and c range over integers, color a pixel yellow if the group is A2 and black otherwise. This produces the image below.

Note that what appear to be the crossed lines y = ±x intersecting at 0 are actually the lines y = ±(x+1) intersecting at (-1,0).

You can find a larger image here. View the page source to see the JavaScript that produced the image. The page is calculating and setting the value of one million pixels, and yet the time to render the page isn’t even noticeable.

Today’s an international prime day

Today’s a prime day. Whether you write the date in American (MMDDYY), European (DDMMYY), or ISO 8601 (YYYYMMDD) format, you get a prime. That is, 112913 and 291113 and 20131129 are all prime numbers.

We’ll call a date an American prime date if MMDDYY is prime, a European prime date if DDMMYY is prime, and an ISO prime date if YYYYMMDD is prime. (Single-digit days and months are padded with a zero.) If a date is prime by all three criteria, we’ll call it an international prime date. Today is an international prime date, and there won’t be another one until August 11, 2019.

If a date is an American prime date and a European prime date, we’ll call it a transatlantic prime date. After today, the next transatlantic prime dates are December 4 and 13 this year. There will be no transatlantic prime dates in 2014, 2015, and 2016 since these dates correspond to numbers that are divisible by either 2 or 5. The first transatlantic prime date of 2017 will be January 16.

We got the definition wrong

When I was in grad school, I had a course in Banach spaces with Haskell Rosenthal. One day he said “We got the definition wrong.” It took a while to understand what he meant.

There’s nothing logically inconsistent about the definition of Banach spaces. What I believe he meant is that the definition is too broad to permit nice classification theorems.

I had intended to specialize in functional analysis in grad school, but my impression after taking that course was that researchers in the field, at least locally, were only interested in questions of the form “Does every Banach space have the property …” In my mind, this translated to “Can you construct a space so pathological that it lacks a property enjoyed by every space that anyone cares about?” This was not for me.

I ended up studying differential equations. I found it more interesting to use Banach spaces to prove theorems about PDEs than to study them for their own sake. From my perspective there was nothing wrong with their definition.

Related posts

Beneficial but not sufficient

The phrase necessary but not sufficient refers to something that you’ve got to have, but it isn’t enough. For example, being divisible by 2 is a necessary but not sufficient condition for being divisible by 6. Odd numbers are not divisible by 6, so being even is necessary. But evenness is not sufficient because, for example, 8 is an even number not divisible by 6.

Wrongly believing that nice theoretical properties are sufficient for a good model is known as a reification error. I don’t know of a name for wrongly believing theoretical properties are necessary. Believing theoretical criteria are sufficient when they’re not is a sophomoric error. Believing theoretical criteria are necessary when they’re not is a more subtle error.

Maybe it would be helpful to use a phrase like “beneficial but not sufficient” to indicate that some property increases our confidence in a model, though it may not be necessary.

Book review: Practical Data Analysis

Many people have drawn Venn diagrams to locate machine learning and related ideas in the intellectual landscape. Drew Conway’s diagram may have been the first. It has at least been frequently referenced.

By this classification, Hector Cuesta’s new book Practical Data Analysis is located toward the “hacking skills” corner of the diagram. No single book can cover everything, and this one emphasizes practical software knowledge more than mathematical theory or details of a particular problem domain.

The biggest strength of the book may be that it brings together in one place information on tools that are used together but whose documentation is scattered. The book is great source for sample code. The source code  is available on GitHub, though it’s more understandable in the context of the book.

Much of the book uses Python and related modules and tools including:

  • NumPy
  • mlpy
  • PIL
  • twython
  • Pandas
  • NLTK
  • IPython
  • Wakari

It also uses D3.js (with JSON, CSS, HTML, …), MongoDB (with MapReduce, Mongo Shell, PyMongo, …), and miscellaneous other tools and APIs.

There’s a lot of material here in 360 pages, making it a useful reference.

Applicable math

When I was in college, my advisor and I published a paper in a journal called “Applicable Analysis.” At the time, I thought that was a good name for a journal. It suggested research that was toward the applied end of the spectrum but not tied to a specific application.

Now when I hear “applicable analysis” I wonder what inapplicable analysis or inapplicable math in general would be. I’d hesitate to call any area of math inapplicable. Certainly some areas of math are applied more frequently and more directly than others, but I’ve been repeatedly surprised by useful applications of areas of math not traditionally classified as “applied.”

Convenient and innocuous priors

Andrew Gelman has some interesting comments on non-informative priors this morning. Rather than thinking of the prior as a static thing, think of it as a way to prime the pump.

… a non-informative prior is a placeholder: you can use the non-informative prior to get the analysis started, then if your posterior distribution is less informative than you would like, or if it does not make sense, you can go back and add prior information. …

At first this may sound like tweaking your analysis until you get the conclusion you want. It’s like the old joke about consultants: the client asks what 2+2 equals and the consultant counters by asking the client what he wants it to equal. But that’s not what Andrew is recommending.

A prior distribution cannot strictly be non-informative, but there are common intuitive notions of what it means to be non-informative. It may be helpful to substitute “convenient” or “innocuous” for “non-informative.” My take on Andrew’s advice is something like this.

Start with a prior distribution that’s easy to use and that nobody is going to give you grief for using. Maybe the prior doesn’t make much difference. But if your convenient/innocuous prior leads to too vague a conclusion, go back and use a more realistic prior, one that requires more effort or risks more criticism.

It’s odd that realistic priors can be more controversial than unrealistic priors, but that’s been my experience. It’s OK to be unrealistic as long as you’re conventional.