I’m not the person you would ever hire to design a trading system, mainly because my programming skills are (being kind to myself) modest. But I think it’s critically important for every trader and investor, whatever his style, to know in principle how to go about developing a trading system. I plan to write a short series of posts on this topic geared to the intelligent novice. Today’s theme is the statistical concept of degrees of freedom.
“Degrees of freedom” is defined mathematically as the rank of a quadratic form. Well, that gets us nowhere fast. The statistical definition isn’t much better: the number of values in the final calculation of a statistic that are free to vary. But we know that the concept is critical in system development. Ralph Vince put it succinctly if not elegantly: “The key to ensure that you have a positive mathematical expectancy in the future is to not restrict your system’s degrees of freedom.” (The Mathematics of Money Management, p. 19)
Urban Jaekle and Emilio Tomasini, in Trading Systems: A New Approach to System Development and Portfolio Optimisation (Harriman House, 2009) tackle this subject from enough points of view that eventually even the most statistically challenged should understand the relevance of this concept in developing a trading system. First, a feeble statistical joke. A married man comments: “There is only one subject, my wife, and my degree of freedom is zero. I should increase my ‘sample size’ by looking at other women.” (p. 16) Second, building on this joke, an illustration by Robert Schulle: “In a scatter plot when there is only one data point, you cannot make any estimation of the regression line. The line can go in any direction . . . Here you have no degrees of freedom . . . for estimation (this may remind you of the joke about the married man). In order to plot a regression line you must have at least two data points (a wife and a mistress). In this case you have one degree of freedom for estimation. . . . In other words, the degree of freedom tells you the number of useful data for estimation. However, when you have two data points only, you can always join them to be a straight regression line and get a perfect correlation. . . Thus the lower the degree of freedom is, the poorer the estimation is.” (p. 17)
What the concept of the degrees of freedom is expressing in a rigorous way is the intuitive notion that the larger the sample size and the smaller the number of variables the better the estimation. Generally, the authors state, “less than 90% remaining degrees of freedom is considered too few.”
Let’s consider some examples so that we have a better idea of how to calculate degrees of freedom for practical purposes. We have a trading strategy that uses a 20-day average of highs and a 60-day average of lows and we’re working with a data sample of three years of highs, lows, opens, and closing prices for a total of 3120 data points (260 days per year x 3 x 4). The 20-day average uses 21 degrees of freedom (20 highs plus 1 more as a rule); the 60-day average uses 61 degrees of freedom (60 lows plus 1 as a rule). The total is 82 degrees of freedom. In percentage terms we’re using 2.6% degrees of freedom (82/3120), leaving 97.4% degrees of freedom. This sample size is adequate to the trading strategy.
Degrees of freedom don’t double count. For instance, if you are using a 5-day and a 10-day moving average of closes you would consume only 12 data points. The 5-day moving average is included in the 10-day moving average. So count only 10 plus 2 rules.
In brief, in order to produce a statistically reliable historical simulation you have match system complexity to sample size. Or, as Vince argues, “You want to keep your system’s degrees of freedom as high as possible to ensure the positive mathematical expectation in the future. This is accomplished not only by eliminating, or at least minimizing, the number of optimizable parameters, but also by eliminating, or at least minimizing, as many of the system rules as possible. Every parameter you add, every rule you add, every little adjustment and qualification you add to your system diminishes its degrees of freedom. Ideally, you will have a system that is very primitive and simple, and that continually grinds out marginal profits over time. . . . [I]t is important that you realize that it really doesn’t matter how profitable the system is, so long as it is profitable. The money you will make trading will be made by how effective the money management you employ is.” (p. 19)
Thursday, January 7, 2010
Wednesday, January 6, 2010
Growth in mastery, the hermit crab between shells
Josh Waitzkin in The Art of Learning invokes a marvelous image to describe the growth process. The hermit crab protects itself with a salvaged shell it carries on its back. As it grows it has to find a larger shell; it never fits into the same shell for more than a few days. “So the slow, lumbering creature goes on a quest for a new home. If an appropriate new shell is not found quickly, a terribly delicate moment of truth arises. A soft creature that is used to the protection of built-in armor must now go out into the world, exposed to predators in all its mushy vulnerability.” The only way the hermit crab can avoid replacing its first second-hand shell with a second second-hand shell is by becoming anorexic, “starving itself so it doesn’t grow to have to find a new shell.” (p. 33)If traders are to increase their mastery, they have step up from under their protective shells and expose themselves to unfamiliar, potentially dangerous conditions. Enough said. Others have written volumes on the topic, but I just loved the image.
Tuesday, January 5, 2010
Bromma, How to Make Money in Alternative Investments
I come from a family that never invested a penny in the stock market. They were risk averse and distrustful of Wall Street. Nonetheless, they managed to increase their wealth bit by bit through a combination of frugality and assorted no- to low-risk schemes. For instance, when silver started to appreciate in value my father would go every night to someone he knew who had vending machines and buy the day’s take. My parents would then sort through the coins looking for silver, sell the silver coins to a dealer, and deposit the remainder in the bank. This was an absolutely no-risk strategy on which they got a handsome return. They were, of course, sorely disappointed when silver cratered, but all they lost was a source of income, not invested money.
I thought of them when reading Hubert and Lisa Moren Bromma’s book How to Make Money in Alternative Investments (McGraw-Hill, 2010). The Brommas outline an assortment of methods for making money outside the traditional markets. For instance, they describe opportunities in private lending and business-to-business cash flows, in precious metals and natural resources (including green investments), and in real estate (domestic and international). These investments can be made through an IRA or 401(k), though currently only 1.5% of all the money in retirement accounts is devoted to anything other than stocks, bonds, mutual funds, and CDs.
The book is an occasional eye-opener for the naïve. For instance, the authors describe how a person could get involved in floor plan auto financing. That is, he would lend money to a used car dealer to buy cars at auction; as the dealer sells each car he pays off the loan and gets title to the car. This business at the retail level can be even sleazier than we might imagine. The authors describe the operations of one used car lot. The lot owner would buy a car at auction for $400 and would then sell it for $1,600 with $400 down and the remaining $1,200 financed at the highest rate allowable under state usury laws—say two years at 21%. He broke even the minute the car left the lot. Since the used car dealer didn’t run any credit checks, he ended up repossessing about 75 percent of the cars he sold. No problem; he just resold them under the same terms—another guaranteed $400 profit and a shot at getting at least some of the $1,200 he financed.
The Brommas stress the importance of due diligence in making any of the investments they describe in their book. For instance, purchasing tax liens can be a good investment for someone with a modest amount of cash. You will normally get a handsome interest rate and can expect to be paid in the vast majority of cases because the property owner can’t sell the property until he pays off the tax lien. But you have to make sure that there are no legal complications or environmental issues that could snarl the investment.
This book opens the door to a world beyond the normal financial markets and offers the investor some opportunities for genuine diversification. I found it a refreshing break from the run-of-the-mill investing books.
I thought of them when reading Hubert and Lisa Moren Bromma’s book How to Make Money in Alternative Investments (McGraw-Hill, 2010). The Brommas outline an assortment of methods for making money outside the traditional markets. For instance, they describe opportunities in private lending and business-to-business cash flows, in precious metals and natural resources (including green investments), and in real estate (domestic and international). These investments can be made through an IRA or 401(k), though currently only 1.5% of all the money in retirement accounts is devoted to anything other than stocks, bonds, mutual funds, and CDs.
The book is an occasional eye-opener for the naïve. For instance, the authors describe how a person could get involved in floor plan auto financing. That is, he would lend money to a used car dealer to buy cars at auction; as the dealer sells each car he pays off the loan and gets title to the car. This business at the retail level can be even sleazier than we might imagine. The authors describe the operations of one used car lot. The lot owner would buy a car at auction for $400 and would then sell it for $1,600 with $400 down and the remaining $1,200 financed at the highest rate allowable under state usury laws—say two years at 21%. He broke even the minute the car left the lot. Since the used car dealer didn’t run any credit checks, he ended up repossessing about 75 percent of the cars he sold. No problem; he just resold them under the same terms—another guaranteed $400 profit and a shot at getting at least some of the $1,200 he financed.
The Brommas stress the importance of due diligence in making any of the investments they describe in their book. For instance, purchasing tax liens can be a good investment for someone with a modest amount of cash. You will normally get a handsome interest rate and can expect to be paid in the vast majority of cases because the property owner can’t sell the property until he pays off the tax lien. But you have to make sure that there are no legal complications or environmental issues that could snarl the investment.
This book opens the door to a world beyond the normal financial markets and offers the investor some opportunities for genuine diversification. I found it a refreshing break from the run-of-the-mill investing books.
Monday, January 4, 2010
Using adversity
Josh Waitzkin learned to push himself. With seven weeks to go until he was scheduled to defend his U.S. Push Hands middleweight championship he decided to enter the super heavyweight division of a regional tournament for some extra training. He weighed in at 170 pounds, his opponent at 230 pounds. With only a minute to go the opponent broke Josh’s hand.
Despite the doctor’s pronouncement that there was no chance he could compete at the Nationals because, although his hand might heal in six weeks, his arm would have atrophied from its immobilization from the elbow down, Josh was determined. He was back in training the day after he got his cast. Initially, he didn’t do the usual sort of physical training. Instead, he worked on heightening his sensitivity to “incoming power and intention.” He concentrated on the mental side of his game.
Then he worked to cultivate his weaker side so that his left hand could do everything. He came to realize that if he could control two of his opponent’s limbs with one of his, he could easily use his other arm for “free-pickings.” This principle, he suggests, applies not only to nearly all contact sports but to chess as well: “Any moment that one piece can control, inhibit, or tie down two or more pieces, a potentially critical imbalance is created on the rest of the board.” (p. 130) By extension, the principle can even be applied in art of negotiation or in war. Or, in the financial markets, call it the principle of leverage.
Finally he used intense visualization practice to try to keep his right arm strong. Four days before the Nationals the doctor cleared him to compete; his bone had knit, and he had barely atrophied at all. Slightly favoring his newly empowered left arm, he won the Nationals.
What is the moral of this story? Waitzkin says that one thing he has learned as a competitor is that “there are clear distinctions between what it takes to be decent, what it takes to be good, what it takes to be great, and what it takes to be among the best.” He says that in order to be among the best he has to “take risks others would avoid, always optimizing the learning potential of the moment and turning adversity to [his] advantage.” Adversity, real or even imagined, can become a “tremendous source of creative inspiration.” It raises us out of routines in which we are simply going through the motions. It forces us to “get imaginative.” It keeps our minds engaged, searching.
I realize that many traders have disaster drills, but, however important they are, they are often no more than a series of standard responses—the same kinds of responses that fire departments teach. How many traders have thought through possible adjustments to or hedges of their positions in response to some adversity? How do you dig yourself out of a hole? What if the number of trades you made had to be cut in half? What if your dog decided you needed to get up regularly at 4 a.m.? There are lots of scenarios we can envision that might just help take us to the next level of mastery.
Despite the doctor’s pronouncement that there was no chance he could compete at the Nationals because, although his hand might heal in six weeks, his arm would have atrophied from its immobilization from the elbow down, Josh was determined. He was back in training the day after he got his cast. Initially, he didn’t do the usual sort of physical training. Instead, he worked on heightening his sensitivity to “incoming power and intention.” He concentrated on the mental side of his game.
Then he worked to cultivate his weaker side so that his left hand could do everything. He came to realize that if he could control two of his opponent’s limbs with one of his, he could easily use his other arm for “free-pickings.” This principle, he suggests, applies not only to nearly all contact sports but to chess as well: “Any moment that one piece can control, inhibit, or tie down two or more pieces, a potentially critical imbalance is created on the rest of the board.” (p. 130) By extension, the principle can even be applied in art of negotiation or in war. Or, in the financial markets, call it the principle of leverage.
Finally he used intense visualization practice to try to keep his right arm strong. Four days before the Nationals the doctor cleared him to compete; his bone had knit, and he had barely atrophied at all. Slightly favoring his newly empowered left arm, he won the Nationals.
What is the moral of this story? Waitzkin says that one thing he has learned as a competitor is that “there are clear distinctions between what it takes to be decent, what it takes to be good, what it takes to be great, and what it takes to be among the best.” He says that in order to be among the best he has to “take risks others would avoid, always optimizing the learning potential of the moment and turning adversity to [his] advantage.” Adversity, real or even imagined, can become a “tremendous source of creative inspiration.” It raises us out of routines in which we are simply going through the motions. It forces us to “get imaginative.” It keeps our minds engaged, searching.
I realize that many traders have disaster drills, but, however important they are, they are often no more than a series of standard responses—the same kinds of responses that fire departments teach. How many traders have thought through possible adjustments to or hedges of their positions in response to some adversity? How do you dig yourself out of a hole? What if the number of trades you made had to be cut in half? What if your dog decided you needed to get up regularly at 4 a.m.? There are lots of scenarios we can envision that might just help take us to the next level of mastery.
Sunday, January 3, 2010
“Or else”—the yurt
In The Daily Trading Coach Brett Steenbarger wrote about the power of “or else” in motivating action. Well, for those of you who have made resolutions about your trading for 2010, here’s an “or else” article you might consider compliments of The New York Times. Think about waking up in a yurt in a remote town in Alaska (no roads to anywhere, not even a bridge to nowhere) still able to access your trading account via broadband but without running water (hence no shower or toilet). The inside temperature is freezing; the wood stove that needs to be fed every 15 to 30 minutes doesn’t exactly make the yurt toasty. You’re neither Mongolian nor Eskimo; you’re part of an overeducated family of three, including an 11-month-old son, who manages to live on about $15,000 a year.Since I’ve just gone through a series of brushes with Alaskan yurt existence—first an iced vent stack that made the upstairs toilet and shower unusable for several days, then a loss of heat fortunately resolved by the heating oil company in a few hours, and finally the standard winter problem of the long, impassable driveway—I have absolutely no romantic notions of living in the Alaska wilderness. For me this particular yurt is a powerful “or else” image! What’s yours?
Come tomorrow I'll go back to my serious self. Here's what's planned: more insights from Josh Waitzkin on learning, a short series on system development, a couple of research findings from behavioral finance and psychology, and a look at a new book on alternative investments. So, as they say, stay tuned.
Saturday, January 2, 2010
Stamps and the proposed trader tax
With the exception of one very black swan (I was a cheerleader in the ninth grade—and considered it one of my greatest accomplishments) I have always been something of a nerd. I say “something of” because I don’t consider myself a nerd. Nerds to my mind are the quants of the world—mathematicians and computer scientists. I just spend more time thinking than average folk. I think about Bach, growing dill, chaos. I’m a hopelessly eclectic intellectual.
Did I ever stand a chance of being anything else? Here’s a picture of me as an overly serious, chubby 19-month-old. I’m now older and skinnier but remain far too serious and am still not exactly a fashion plate.
One manifestation of my intellectual eclecticism is a stamp collection that is more attractive and hence hugely less valuable than Bill Gross’s. One thing I never collected was tax stamps, but when I saw the Designing Better Futures article I was intrigued. Nick Gogerty revisits the history of stock, commodity, and derivatives transaction taxes by looking at tax stamps. It’s both fascinating and scary. Take a look.
Did I ever stand a chance of being anything else? Here’s a picture of me as an overly serious, chubby 19-month-old. I’m now older and skinnier but remain far too serious and am still not exactly a fashion plate.One manifestation of my intellectual eclecticism is a stamp collection that is more attractive and hence hugely less valuable than Bill Gross’s. One thing I never collected was tax stamps, but when I saw the Designing Better Futures article I was intrigued. Nick Gogerty revisits the history of stock, commodity, and derivatives transaction taxes by looking at tax stamps. It’s both fascinating and scary. Take a look.
Friday, January 1, 2010
Happy 2010!
For those of you who enjoy Maira Kalman's work, here is the final installment of "And the Pursuit of Happiness," which will appear as a book in October 2010. It's a wonderful way to kick off the new year.
Subscribe to:
Posts (Atom)