The OODA Loop and Scientific Research

As you might have seen from elsewhere on this site, I’m a former military man, and one that took (some) time to study military theory.  One particular bit of theory that I was recently re-introduced to was John Boyd’s model of competition/conflict, sometimes referred to as the “OODA loop.” The similarities between the OODA loop and the scientific research cycle were striking, so I decided to comment upon them.

A quick history of John Boyd: he was a fighter pilot in Korea and took the lessons that he learned dogfighting and generalized them into what he then called “energy-maneuverability theory”. Boyd gained a reputation as a maverick, but was valuable enough to be a special consultant of some kind at the Pentagon after he retired. While there, he further generalized his thoughts about conflict in general into a model of conflict, which he presented in numerous briefings but never got around to putting in print. Boyd’s ideas and influence were central to the procurement of the A-10, F-15, and F-16, among other things.

Boyd’s OODA loop, short for “Observe, Orient, Decide, Act,” is probably the most well-known element of his theory.  Observations are all the external stimuli to the commander and staff–intelligence, friendly status reports, the terrain and weather.  Orientation is the process of taking observations, as well as insights from experience, culture, doctrine, and many many more “internal” factors to understand the situation. In a way, this Orient phase tries to estimate all the things left unobserved, predict the opponent’s actions, and develop potential own actions to counter or pre-empt the opponent.  The Decide and Act phases obviously select the course of action and implement it. The main paths in the loop go O-O-D-A and back to O again, but there are short circuits: sometimes observations are so plain and urgent, they cause a reflex Action. Sometimes after the Orient phase the commander knows he needs for information, so seeks observations to fill out the operating picture. The winner of the competition, assuming a relatively balanced(but not necessarily symmetric) set of capabilities, in Boyd’s view, was the competitor who executed the OODA loops the fastest with the correct orientation.  The graphic below illustrates:

Courtesy http://billbrantley.com/using-the-ooda-loop-to-solve-complex-problems/

This sounds exactly like the process of scientific research: make an observation, develop a hypothesis, design an experiment to test the hypothesis, execute the experiment and gain new observations, refine the hypothesis, etc . . .

Now, the OODA loop is for competition . . . but research is more like coopertition–the idea that even though two scientists might be racing to a discovery, they can reach a far greater understanding and produce better results if they share information and ideas, check and correct one another.  This is also the rationale for a company like Tesla to open-source its patents, or why Google open-sources one of its most popular products, Chrome/Chromium.  When engineers and scientists share information, their research becomes mutually supporting–my observations and orientation can help you get a correct orientation, develop a great experiment, and vice versa.

For further reading on John Boyd and his model of conflict, see Chuck Spinney’s or Robert Coram’s website.

Review of Team of Rivals

Ok, a short one. I just finished Team of Rivals by Doris Kearns Goodwin, and wanted to write about it. This is, of course, a little bit (a lot) of patting myself on the back. To tell the whole truth, it took me 2-1/2 years to get through, though the last half I gutted through over the last few months. My wife, I’m sure, got annoyed at the little pieces of trivia I was telling her. In the end though, it was worth it, as I learned an incredible amount of history and leadership lessons.

What an amazing work of American history. I didn’t really pay close attention to history when I was in high school. Of course, I generally knew the big stuff from that era, like when the Civil War happened, that it was fought over a combination of slavery and states’ rights, that Lincoln was President and that he was assassinated at the end of it. But I’m sure the teacher lectured about the different battles and generals, about the seemingly paradoxical views of the pro-slavery Unionists. But I never had any idea about the intricacies of Lincoln’s dealings with his generals and his cabinet, his balancing act of leading and following public opinion. I had NO idea that he so regularly traveled to the front battle lines to meet soldiers and confer with Grant, etc. I had no idea how the social scene continued in the shadow of the Civil War and all the personalities in Washington. I’ll try to capture a few of the points and main themes of the book that amazed and enriched me.

    • Lincoln’s possibly greatest strength was to never take things personally. People who had slandered him, attacked him, talked badly toward him, always were offered forgiveness. This gave him the humility to offer cabinet positions to his chief rivals during the presidential campaign (Seward, Chase, and Bates), as well as the former Attorney General (Stanton) who had called him at one point a “long-armed ape.”
    • George B. McClellan was an impressive general until he continually failed to take the offensive against Richmond and made public disparaging remarks against Lincoln. (Somehow, having been fired as commander of the Army, we still named an Army base after him.)
    • Lincoln had a child die in office. Unfathomable.
    • People could just walk in to the White House and talk to the President. In fact, Lincoln felt (during the early part of his first term) that it was his duty to not turn anyone away.
    • Lincoln spent a couple of the hot summers in Washington practically by himself in the White House.
    • His assassination was supposed to be a triple assassination, taking out the Vice President and Secretary of State.  The assassin for the VP balked and walked away; the attacker of the Sec. State nearly succeeded, but Seward recovered from his injuries.
    • Lincoln’s original position on the slavery question was non-expansion of slavery into new states, not complete abolition. This kind of thinking is why one of the few things I remember  my history teacher saying: “The Civil War wasn’t about slavery, it was about states’ rights.”
    • Despite Lincoln not being a radical abolitionist, freed slave Fredrick Douglass claimed that Lincoln was one of the few people who ever treated him with friendship and respect, on a level of equality.
    • Lincoln’s plan for Reconstruction were very lenient, requiring only a couple of key items for southern states to rejoin the union. He took a lot of heat for that from people who felt the rebel states ought to be harshly punished for the rebellion.

Again–I’m glad I read it; but can only recommend it for people who have the stomach for really, really, really long reads.

Publication Quality Figures from Matlab

I’m currently working on a journal paper, and started having frustrations with the process for getting the figures to be publication quality. So after wrestling a little (a lot) with putting these things together, I figured I would share the system.

The first element is the actual format of the figure. Matlab’s default format is good for quick & dirty “preview” data visualization, but the line weight and font size are near illegible when shrunk and placed in document:

A default plot as it looks onscreen.
A default plot as it looks onscreen.
The default plot after conversion to EPS and embedded in a latex document.
The default plot after conversion to EPS and embedded in a latex document.

There are several sites, (here, and here, and here) that give code to clean up plots and make them more publication ready.  And they are very good-looking, but the scripts tend to be a bit more complicated than I have the interest in figuring out.  If you do like those enough to do the work, it’s probably best to put the formatting commands into a file/function called formatForPublication() or something like that.  At any rate, I’m going to recommend that unless you have a much more specific formatting requirement for your figures, you use the ‘Powerpoint’ export format.

You can get this through the GUI by going to the figure window, clicking File > Export Setup . . . , then at the bottom there is a pulldown selection where the choices are ‘default’, ‘Word’, and ‘Powerpoint’.  Pick Powerpoint and then the ‘Load’ button, then the ‘Apply’ button, then the ‘Export’ button. Select the file format you want to use (more on that below), then pick a filename, then save.

How it looks onscreen after applying gridlines and the PowerPoint style.
How it looks onscreen after applying the PowerPoint style.
The final product as it looks in the paper.
The final product as it looks in the paper.

This method of formatting is fine, in fact probably the best when you have just a few figures.  However, it can get REALLY tedious when you have dozens of figures.  So here is the big time and headache saver: this process can be done in 1 or 2 lines of code from the command window.  Those lines of code are this:

s = hgexport('readstyle','PowerPoint');

hgexport(gcf,'plotname001.eps',s);

Done.This is the basic format for this kind of command, and obviously if you only have one or two figures, clicking around with the mouse a little bit is going to be faster. However, if you have a lot more, you may want to use a script. But first, a public service announcment:

Always-always-always save figures that you plan to publish in the native Matlab .fig format, without applying any other formatting commands. This means that at the end of the day you can always go back to the original figure and apply different formatting. If you only save the bitmap or jpeg exported version, you can’t go back and change it later.

I’ll presume you have a folder full of .fig files with no formatting applied beyond the default, and none open.  This script will tranform all of the figures into publication quality figures.


close all;

figureNames = dir('*.fig'); % gets a list of all the figures
hw = waitbar(0,'Progress...') % initiates the waitbar so you can see progress
total = size(figureNames,1); % how many figures to be converted
s = hgexport('readstyle','PowerPoint'); % store the formatting information in the variable s

for i = 1:total

waitbar(i/total); % update the progress meter
open(figureNames(i,:)); % opens one of the figures
fn = figureNames(i,1:end-4); % extract the file name without the .fig extension
hgexport(gcf,[ fn, '.eps'],s); % save the file in eps format using the correct formatting
close(gcf); %close the figure

end

close(hw); % close the progress bar

And there you have it.

If you want to take it a little bit further, you can adjust the fonts used for the figures to match the more “academic” fonts used in publication.  Side note–one of the reasons to always always always keep the original .fig file is because the editors at the journal may require you to use a certain font for publication–but you won’t find out until you’ve gone through the review process. Having the ability to go back to the plot without having to reconstruct it from data is a big boon. Anyway, there are two ways you can change the fonts in your plots. You can change them on a per-figure basis, or, if you know that you will be producing figures with such a font requirement for a long time, you can change the default font used by Matlab. To do this, go to the folder $MATLAB$/local/toolbox. In there, you’ll find a file called startupsav.m. Read the instructions in the file, and add this line to it:

set(0, 'DefaultAxesFontName', <desired_fontname>)

Ok–so on to the question of what file format to export to.

1) No JPEG. Don’t do it! JPEG is a format that is REALLY good at compressing photographs, but horrendous when it comes to things like text and lines. If you want more details on why, see this episode of Computerphile.

2) If you absolutely must use a non-vector format, select PNG over BMP–PNG is becoming the defacto standard for raster graphics on the web and in print; BMP is a relic of a bygone time in Windows. TIFF is okay too, but the size of the file will be absurdly large.

3) EPS is probably the best choice in general, since the publisher may ultimately request figures in EPS format. WMF is a little bit better if you are using Word–and remember that EPS and WMF might look crappy on screen with Word, they will look gorgeous after printing. This is because EPS is a format that the printer natively understands, while Word is only showing you a low quality preview of the figure. If you are writing with LaTeX, you may find that you prefer to convert your figures to PDF from EPS.

A word on MS Word: Don’t use it to publish papers unless you really, really have to. Word is great for letters and resumes and schoolwork, but the results of it are not meant for publishing, even if the publisher has a Word template. Use LaTeX instead. Or I hear Scrivener is pretty good for this sort of thing.
Finally, the usual points apply. No matter how beautiful the plots look, they’re not publication ready until you label axes with both variable and units, you include a legend if more than one curve, you use colors that contrast well to distinguish curves, etc.

Happy plotting!