14 January 2015

A Yentle for the 21st Century

Quant maker, quant maker, make me a quant!

At least since the implosion of LTC (Long Term Capital Management, and follow the references for the gory details if you're interested) in 1998, or a bit earlier if one notes the proximate event, the ability of quants to get it right has been in question. Yet, they (or, at least, some) are paid wages in the seven figures.
The theories of Merton and Scholes took a public beating. In its annual reports, Merrill Lynch observed that mathematical risk models "may provide a greater sense of security than warranted; therefore, reliance on these models should be limited."

One might even go back to the savings and loan scandal(s) of the mid-1980s. Again, the references, if you're interested. Again, the 1% were looking for ways to earn greater than the market rate of interest at lower risk. They Ain't No Such Thing As A Free Lunch.
L. William Seidman, former chairman of both the Federal Deposit Insurance Corporation (FDIC) and the Resolution Trust Corporation, stated, "The banking problems of the '80s and '90s came primarily, but not exclusively, from unsound real estate lending".

In other words, the S&L scandal, or crisis as apologists prefer to call it, was directly caused by quantitative incompetence at its most elementary. This wasn't off-the-wall derivatives, but basic present value calculation. The same can be said of The Great Recession. "Money for nuthin' and the chicks for free."

But, these two banking (in the extended sense) screw ups taught both the regulators and the participants nothing. Moral hazard was ignored, and the quants went on a bacchanal with the election of W. Liar loans were created, securities made from them were created, and derivatives of said securities were created, with the credit default swap being the most evil. Imagine if you and your best friends could bet on whether an abandoned tenement crack house (which none of you own any part of) in the worst part of town might burn down in the next year or two? That's a CDS. Regulators looked the other way. Moral hazard? Never heard of it.

Which brings us to the London Whale. Bruno Iksil is reported to have graduated from a top tier French engineering school (École Centrale Paris), although I've not yet seen which degree or subject he earned. Likely not a Ph.D., since those who've got one generally boast. Even so, it appears that Excel was beyond his ken.

From the JPM internal review as reported:
"After subtracting the old rate from the new rate, the spreadsheet divided by their sum instead of their average, as the modeler had intended. This error likely had the effect of muting volatility by a factor of two and of lowering the VaR . . ."

That's some interesting history. The last few days brings the whining of petro-bankers. They never saw the reserves coming? Reminds me of this quote from Upton Sinclair:
It is difficult to get a man to understand something, when his salary depends on his not understanding it.

Here's their problem:
Still, if oil prices remain near $50 a barrel for long, economists and industry analysts expect a sharp deceleration in production this year, idling energy bankers and cutting into their lucrative fees.

Quant maker, quant maker, make me a quant?

It wasn't as if these petro-bankers didn't know how much drilling and lifting was being done with their money. Nor could they have been ignorant of both the anemic recovery in the USofA, and the stalled economies of Europe and Asia. Or that the Saudis can lift oil at a profit at a price much lower than shale or tar sands; they'll continue to lift in order to get the moolah needed to keep a lid on unrest. Econ 101: supply is increasing and demand is, at best, stagnant. Of course the price per barrel will fall. D'oh!!! These are the same yahoos who asserted, by action at least, that house prices could rise 10%/annum for-freaking-ever.
When oil prices crashed in the 1980s, many Texas banks failed not because of loans to oil producers, but because of loans to local real estate developers who had been caught in the energy bust.

How'd you like to be a S&L president in North Dakota, today?? Eh?

Let's assume that quants built the right way, and installed in organizations which deal with data, might aid in avoiding such nonsense.

So, how to build a quant? Let's assume that the goal is short term conversion of a subject expert into a subject expert who speaks data good.

Quant maker, quant maker, make me a quant?

Most who do "quant", especially in the financial sector, aren't math stats or ORs. They're just folks looking for cracks in existing regulation that can be exploited to make ever more money for themselves, and aren't the sort of folks I'm talking about. Those who do so, and call themselves quants, are the apotheosis of micros. The CDS was created by a banker, outside the realm of what then current regulation understood. Whether anyone, at the time or since, understood that the instrument amounted to allowing the entire moneyed community to bet on some crackhouse to burn down, is unknown. And, likely, unknowable, since such derivatives were and remain largely unregulated (mega lobbying against Dodd-Frank provisions to bring them to heel). Even knowing the global value of derivatives is not known with certainty, since each is viewed as a private contract. Wonderful.

Many quants, in the financial sector according to legend, come not from the social sciences, but math and physical sciences. The latter understand a rule game decreed by God (or Nature, as you prefer), which leads them, if not reminded constantly, to model based on whatever set rules they know about. That the rules of finance are created and changed by other humans (or, in the case of the CDS, themselves) seems to be forgotten. Read most texts on financial engineering, and you get the gist: we model based on fixed laws of actors' behavior. Fact is, most financial engineering is really about finding lucrative cracks in regulation.

Quant maker, quant maker, make me a quant?

What's a quant? The first question to answer. I'll exclude the flunked out hard science Ph.Ds who write C/C++ for high frequency trading firms. They're not really doing quantitative analysis, rather money flow arbitrage in microscopic time frames. Yes, in large enough scopes, such inquiry may look a bit like Brownian motion and other physical phenomena. Also, the folks who create new products based on perceived holes in law/regulation. Again, these folks are exploiting weakness in the boundaries that exist to keep Darwinian anarchy from breaking out all over. Ayn would be proud of them, but not I. Much of financial engineering is based on time series analysis of asset pricing. That's quant, but is based on a stability assumption that's often incorrect. The results don't always (may be, nearly never) live up to the promise, but the techniques are quant. Thus, ride the trend up passively and depart to cash (or market shorting ETFs) passively at inflection. When is that? The hard sciences, bio related in particular, make use of regressions and ANOVAs as a matter of course. That's quant. The social sciences, again, lots of ANOVA (the psycho- types invented it).

Second, who? It could be "me" who wants to be a quant, or it could be a Corner Office Suit who decides another quant is needed. In both cases, we'll assume that the candidate isn't already a math stat or operations researcher. Like early programming in the '50s and '60s, quant (and Data Scientist!) is largely a self-created occupation. Just look at all the flunked out maths (not math stats), physics, engineering, chemistry, etc. folks that have been in the Wall Street invasion. So: the process has to be self-administered in the former case, and divined from CVs in the latter. We want a short-course to turn either "me" or some subject expert into a real quant. Well, real enough for the organization's purpose.

The latter case is easier to deal with. The COS should be looking for a candidate who's mostly subject specific. Math stats tend toward new proofs, and we've seen from The Great Recession that applying a God's Rules world view to dig in the minute cracks of regulation leads to disaster. Student and Fisher were grounded in industrial (physical) processes, but not so much these days. If your goal is to just suss out ways to bend the current rules, or lobby for beneficial (to you) rules changes, you don't much need a quant. Beyond the exercise of adding up your anticipated windfall. You just need to find a welcoming ear to lobby for the policy you want.

Quant maker, quant maker, make me a quant?

Early in my career, such as it has been, I taught quant type courses for the CSC/OPM at Dupont Circle in Washington. Nice coffee shops in the neighborhood. They were anywhere from a couple of days to a couple of weeks, with basic stats, stat packages (pstat, BMDP, and a bit of SPSS), and elementary programming (BASIC and FORTRAN); later on 1-2-3 was very popular. One can create a quant in a few weeks, if the goal is narrow, and the content taught is focused. Hell, the London Whale was an Excel Master of the World; or so he thought.

So, the tool? R, of course. I don't take R with unbridled enthusiasm. Too much of the R community is coding-centric, likely because S was really a DSL by and for math stats. The goal here, make me a quant, is to get the subject expert up to speed with R and ancillaries sufficiently to use R function and packages to analyze some data. A user of R, not a maker of R. May be, for data acquisition, a few words about Excel. But not for analysis. The candidates are, nearly certainly, convinced that they're already Excel Guru level, and equally likely to be averse to having to go through some other training exercise. "I know Excel. What more do I need?" That sort of thing.

While in the process of composing this missive, I found this post from a prof building a bespoke text for a one semester undergraduate econometrics course. (Ironic asides: while not the London Whale's ecole, it is a French one. If you know the name Bourbaki, you see the irony. Second irony: Kind of a NetPaper course book thingee. If only NetPaper hadn't crapped out.) So, we'll say 8 or so weeks of material to make an econometrician. I'll say an 'applied' econometrician, in that economists continue to shave off new bits of stuff; some of it actually useful. Chapter 3 is the meat of stats meets economics.

First, RStudio. It makes no sense to force such folks, who will be menu clickers, to suss out command line R. Ick.

Second, what should be the reference? One could construct a bespoke "course pack" text as above, but that's more in service to a prof's publishing CV than to the students. It makes more sense to work from a comprehensive text, pick and chose the topics/chapters that pertain, and provide precursor topics in digest form. They students leave knowing the focused material, and a reference that will serve in their work. Crawley's The R Book retains first place, for me. Graphics are still from base, so Hadley's ggplot2 book, too. He's recently written that a new edition is in the works. Chapters referenced are from Crawley.

Quant maker, quant maker, make me a quant?

Here are the topics I'd want in a short-course quant making:

- basic R and Rstudio
Chapters 1 and 2. RStudio functionality introduced as needed along the way.

- elementary probability
While not likely to be used directly, and I've always been leery of its importance, the notions of probability are important. The course completer isn't likely to discover new probability distributions.

Crawley doesn't have a probability chapter, somewhat oddly. I'd substitute Wikipedia page, and referenced topics, for discussion purposes.

- the data
My preference, no surprise, is to stress getting fully munged data from the RDBMS using SQL. A bit of talk about Postgres and PL/R capability is in order, given that most other industrial strength databases offer similar now.

Parts chapters 3 and 4.

- descriptive statistics
Very important, particularly in these days of Big Data, which devolves from inferential stats into just descriptive. I say "just" because inferential machinery no longer applies. Now, for some areas, such as consumer manipulation, correlation is important.

Most of chapter 7 deals with distributions and their parameters. That will do.

- graphics
Why in third place? Well, for those in the Big Data and descriptive world, and for those who've got to make pretty pictures for the COS, that's 99.44% of the job. So, basic R graphics and ggplot2.

Chapters 5 and 29 (no, no one has figured out why he split that way or why no ggplot2) deals with base graphics, which are sufficient for most purposes. From there, ggplot2.

Now, things get goal specific.

- finance and bio and other physical realms
The first bit of chapter 9 on modeling, then chapter 10 on regression and 13 on generalized linear models. Time series in chapter 24.

- social sciences and such
Chapter 11 on ANOVA and 12 on ANCOVA.

The obligatory "advanced topics"
Chapter 22 on Bayes, 25 on multivariate.

By the time you're done, you'll know enough to get around R, and apply existing stat processes to data. You won't be an R coder; you'll be an SPSS/SAS user with a different syntax. Coding, in the sense of writing new stat procs, will come much later if at all. Don't worry about it. One aspect of such short courses, as distinct from the more contemplative semester in college approach, is that we've jammed a lot of material into the skull quickly; a week or two or three. (Recall that a 30 hour semester course is 3 hours a week for 10 or so weeks. We'll be chewing up 40 hours in a calendar week. Some brains will explode in the classroom. Pay them no mind.) It can spill out just as quickly if it isn't used; the difference between short-term and long-term memory isn't a myth. You want your base quant in short order. You'd better put that new knowledge to work in equally short order. Over time, months and years, the knowledge will become internalized, much like a shortstop learns to throw both side arm and overhand, and when, in an afternoon. Takes a while until he does it right without thinking about it (well, unless you're A-Rod, in which case there's never much thinking ever).

Quant maker, quant maker, make me a quant?

No comments: