Friday, May 7, 2010

The Stock Market's Feedback Loop

I have a computer science and physics background. This is what I think of when I think of this week's stock market activity.

Positive feedback

1. Why is positive feedback important? The key feature of positive feedback is that small disturbances are amplified. When positive feedback is present, there is some causal loop where a small change creates an effect that causes an even bigger change -- like a ball rolling down an increasingly steep hill.

2. Systemic risk is the risk that an amplification or leverage or positive feedback process is built into a system, this is usually unknown, and under certain conditions this process can amplify exponentially and rapidly lead to destructive or chaotic behavior. A Ponzi scheme is a good example of a positive-feedback system, because its output (profit) is fed back to the input (new investors), causing rapid growth toward collapse.

3. In sociology, a self-fulfilling prophecy is a positive feedback loop between beliefs and behavior: if enough people believe that something is true, their behavior makes it true, and observations of their behavior in turn increase belief. A classic example is a bank run.

I found it hard to believe that one trader could cause such carnage by simply typing a "b" instead of an "m".

I did not find it hard to believe that several competing computer algorithms might indirectly explore each other's black boxes and find neither willing to support prices. If that was indeed the case, then these competing computer algorithms would simultaneously come up with the same conclusion. Sell!

Black box

In science and engineering, a black box is a device, system or object which can (and sometimes can only) be viewed solely in terms of its input, output and transfer characteristics without any knowledge of its internal workings. Almost anything might be referred to as a black box: a transistor, an algorithm, or the human mind.

That is exactly how program trading works. What goes on within each firm's algorithms is a closely guarded secret.

One firm can't know what the black boxes of other firms are doing except by watching them. Watch a black box long enough and you'll start to figure out how they will probably react to changing inputs though.

Let's say there are two firms and two black boxes. We'll call them BlackboxA and BlackboxB. In the early days BlackboxA and BlackboxB were simple algorithms. They didn't know or care about each other's existence.

Some bright guy at Firm A decided that his black box could be smarter if it started watching BlackboxB. If BlackboxA knew BlackboxB would sell, then BlackboxA would sell first. This made BlackboxA smarter.

Meanwhile...

Some bright guy at Firm B decided that his black box could be smarter if it started watching BlackboxA. If BlackboxB knew BlackboxA would sell, then BlackboxB would sell first. This made BlackboxB smarter.

See the problem here? BlackboxA relies on information from BlackboxB. BlackboxB relies on information from BlackboxA. BlackboxA therefore indirectly relies on information from BlackboxA. It's a form of circular logic. That's bad.


Circular reference

Circular references can appear in computer programming when one piece of code requires the result from another, but that code needs the result from the first.

The entire set of functions is now worthless because none of them can return any useful information whatsoever.

A circular reference represents a big problem in computing.

Picture two cells (A1 and B1) in Excel each representing one of the black boxes above. You can type "=B1-1" into cell A1 in Excel. A1 now relies on the information from B1. There will be no complaints. Once you type "=A1-1" into cell B1 there's a big problem though. It makes no sense. Excel now has no way to determine what the value of either cell should be.

Microsoft cannot calculate a formula. Cell references in the formula refer to the formula's result, creating a circular reference.

You can still do it in Excel though if you turn on the maximum number of iterations feature. It will be amusing if you do. Every time the spreadsheet recalculates, the value of those two cells will get smaller (as each cell tries to be smaller than its neighbor).

Computers, Not Human Error, Likely Caused Market Meltdown

Market sources say the confluence of events likely triggered electronic selling programs. As that selling commenced, the human element of the markets quickly evaporated and computerized trading programs wantonly sold stocks at whatever price was available, creating a feeding frenzy.

That seems to make the most sense to me. It's just an opinion though.

11 comments:

EconomicDisconnect said...

"So you understand that when we increase the number of variables, the axioms themselves never change."
mega obscure reference.

Great post, though at the end I felt I was back where I started, 3 lefts and all.

Stagflationary Mark said...

GYSC,

mega obscure reference

I see the dying words of a fictional alegbra teacher. Have you posted something like this in the past? Perhaps early February of this year? I don't know. The image is a bit foggy.

That's not all. I see a vacation in your recent past. Something involving cats and pink birds. Does that make any sense to you?

For just $50 I could provide you with a detailed reading of your future. Yes. Yes. I see something you should know about. This may take more than one session.

As seen on the Internet...

During a recent publicity outing, Hillary sneaked off to visit a fortune teller of some local repute.

In a dark and hazy room, peering into a crystal ball, the mystic delivered grave news. "There's no easy way to say this, so I'll just be blunt: Prepare yourself to be a widow. Your husband will die a violent and horrible death this year."

Visibly shaken, Hillary stared at the woman's lined face, then at the single flickering candle, then down at her hands. She took a few deep breaths to compose herself. She simply had to know. She met the fortune teller's gaze, steadied her voice, and asked her question. "Will I be acquitted?"

EconomicDisconnect said...

Mark you must be part elephant with that memory, and please leave the part of the elephant jokes at the door!

What are you saying, I am not original? Thanks bro

Stagflationary Mark said...

GYSC,

Heavens no!

I'm just always amazed what can be found on the Internet. That's all.

I went looking for the source of the quote and one of the search results to me to MaxedOutMama's site. :)

G.H. said...

Stag,

"I went looking for the source of the quote and one of the search results to me to MaxedOutMama's site."

From what I believe is the page you're referring to I found this response from MOM to a readers question:

"In any case, one thing about human beings appears to be proved by evidence. We are very adept at changing our circumstances - most especially at manipulating and adapting the natural world. We are very bad at changing ourselves, and very poor at understanding ourselves. Both individually and in groups, we repeat the same mistakes over and over again."

If in fact retail investors are simply stepping into post holes in this market climate (and I'm sure some are) the above statement could provide some insight. It's sort of Nassim Taleb-ish. Know what I mean?

Stagflationary Mark said...

G.H. (& GYSC),

I actually found the exact quote but what you found is quite appropriate too.

His was a reference to Stephen King, an author I've read many times. I'm sure if people went looking for H.P. Lovecraft quotes, they'd similarly find me at the other end. I quote him quite a bit. We both clearly like exploring the dark side (by quoting horror authors).

I try to learn from both my own mistakes and the mistakes of others. In some ways this blog is just a collection of past mistakes. Maybe that's why I enjoy doing it.

My favorite quote is actually from Eric Hoffer though. I've used it SO many times.

"You can discover what your enemy fears most by observing the means he uses to frighten you."

I think you can also discover what central bankers fear most by observing the means they use to comfort us.

Stagflationary Mark said...

Speaking of Eric Hoffer's quote...

Check this out.

"Every time officials in Europe starts yapping about containing the European debt crisis, the market makes complete fools of them."

AllanF said...

Did you see where Goldman's prop trading didn't lose money a single day last quarter? Where's the SEC investigation into that!?!

Let's see, Tuesday run-up on the Mass Senate exit polls: caught it.
Wednesday Sell-off on the Mass Senate results: caught it.
Friday Feb 4 drop and bounce: caught it.

Unreal. There were so many conflicting cross-currents and whiplashes in Q1 the only way one could *never* lose money is to front run the order flow. The market is a rigged casino if there ever was one.

Stagflationary Mark said...

AllanF,

Goldman Sachs seems like a data mining operation, making money off of every day trader who thinks he's smarter than the market.

I expect to be on the losing end of every trade I do, maybe just a nickel or a dime if I am lucky. The less I trade the better.

If everyone would simply just buy something they want directly, avoid the middle men, and hold it long-term, it sure would be a lot harder for the financial casino to extract wealth from its customers.

Picture TIPS. I mostly buy them directly from the government during the auctions and hold them until maturity. If everyone did what I did the financial services industry would really be hurting.

Anonymous said...

The economy is non-linear. Non-linear equates to chaos theory. Chaos is one of Physics Foibles - non-predictable. Butterflies may cause tornadoes!!!

Stagflationary Mark said...

Anonymous,

CNBC has a never ending stream of weathermen telling us what the economy will be doing a year from now and you imply that they probably all can't be right.

Who am I to argue with you! ;)