Just another day (or two) of torturing data. Like I mentioned a couple of days ago, a week back I decided to update a data set to include the last year or so of data (the data sources I use were recently updated). Like most "simple" jobs, it's turned out to be much more of a hairball than I expected. Although the program I used was fairly simple to rewrite, I realized that I had to update not one, not tWo, but THREE datasets in order to bring everything up to the present.
Caution: SAS Geekspeak ahead
One of the data sets is pretty large (it was about 70 gigabytes, but with the updates and indexing I've done, it's almost 100 gig). So, adding the new data and checking it took quite a while (no matter how efficiently you code things, SAS simply takes a long time to read a 70 gigabyte file). I thought I had everything done except for the final step. Unfortunately, the program kept crashing due to "insufficient resources."
For the unitiated, when manipulating data (sorting, intermediate steps on SQL select statements, etc...) SAS sets up temporary ("scratch") files. They're supposed to be released when SAS terminates, but unfortunately, my system wasn't doing that. So, I had over 180 gigabytes of temporary files clogging up my hard drive. This means that there wasn't enough disk space on my 250 gigabyte drive for SAS to manipulate the large files I'm using.
Of course, I only realized this when my program crashed AFTER EIGHT HOURS OF RUNNING! TWICE!
I've now manually deleted all the temporary files, and I'm running the program overnight to see if this fixes the problem.
Ah well - if it was easy, anyone could do it.
update (next morning): Phew! It ran - it seems the unreleased temporary files were the issue. On to the next problem.
Wednesday, July 1, 2009
Tuesday, June 30, 2009
A Simple (and Impressive) New Three Factor Return Model
First, a little background on "factor models": The CAPM model for estimating expected returns is the oldest and most widely know of all finance models. In it, exposure to systematic risk (i.e. beta) is only factor that gets "priced" (i.e. that's related to expected returns).
In 1993, Fama and French showed that a three factor model (the CAPM market factor plus a size factor and a value/growth factor), did a much better job of explaining cross-sectional returns when compard to the "plain vanilla" CAPM.
Since the FF model became popular, a number of studies have come out that identify other factors that seem to be associated with subsequent returns, such as momentum (Jegadeesh and Titman, 1993), distress (Campbell, Hilscher, and Szilagyi, 2008), stock issues (Fama and French, 2008) and asset growth (Cooper, Gulen, and Schill, 2008).
Now, on to the meat of this post - another factor model. This one is based on q-theory (i.e. on the marginal productivity of a firm's investments). Long Chen and Lu Zhang (from Washington University and Michigan, respectively) recently published a paper "A Better Three-Factor Model That Explains More Anomalies", in the Journal of Finance. They propose a three-factor model", with the three factors being the aggregate returns on the market, the firm's asset-scaled investments, and the firm's return on assets). Their model significantly outperforms the Fama-French (FF) model in explaining stock returns, does a better job (relative to FF) at explaining the size, momentum, and financial distress effects (i.e. you don't need to add additional factors for these effects), and does about as well as FF in capturing the Value (i.e. Book/Market) effect. Here's a taste of their results:
HT: CXO Advisory Group
In 1993, Fama and French showed that a three factor model (the CAPM market factor plus a size factor and a value/growth factor), did a much better job of explaining cross-sectional returns when compard to the "plain vanilla" CAPM.
Since the FF model became popular, a number of studies have come out that identify other factors that seem to be associated with subsequent returns, such as momentum (Jegadeesh and Titman, 1993), distress (Campbell, Hilscher, and Szilagyi, 2008), stock issues (Fama and French, 2008) and asset growth (Cooper, Gulen, and Schill, 2008).
Now, on to the meat of this post - another factor model. This one is based on q-theory (i.e. on the marginal productivity of a firm's investments). Long Chen and Lu Zhang (from Washington University and Michigan, respectively) recently published a paper "A Better Three-Factor Model That Explains More Anomalies", in the Journal of Finance. They propose a three-factor model", with the three factors being the aggregate returns on the market, the firm's asset-scaled investments, and the firm's return on assets). Their model significantly outperforms the Fama-French (FF) model in explaining stock returns, does a better job (relative to FF) at explaining the size, momentum, and financial distress effects (i.e. you don't need to add additional factors for these effects), and does about as well as FF in capturing the Value (i.e. Book/Market) effect. Here's a taste of their results:
- The average return to the investment factor (i.e. the the difference between the low and high investment firms) is 0.43% per month over the 1972-2006 sample period. When measured only among small firms, the return difference between low and high investment firms is about 26% annually)
- The average return to the ROA factor (the difference between returns to the firms with the lowest and highest ROA) is 0.96% per month over the sample period (with a high/low spread of about 26% for the smallest firms).
- The differences in high vs. low portfolios persist (albeit in smaller magnitudes) after controlling for Fama-French and momentum factors.
HT: CXO Advisory Group
Monday, June 29, 2009
What's going on in the Unknown Family
Here's a short update on goings-on in the Unknown Household:
As for the 500 pound gorilla in the room - we're coping fairly well with the whole grieving process. Of course, it's different for the Unknown Wife and I (hey - the process is different for any two people). For me, it's toughest at night (in the time just before sleep)- for the majority of the day, I don't think about it much, except for the odd moments when I see/hear something that reminds me of the little guy. For her, it occurs more frequently, mostly because she's at home most of the day, where she sees more reminders. We each have different "therapies" - for me, I think about Jonathan on bike rides (almost 17 miles yesterday), and for the Unknown wife, it involves talking about him with friends and family.
But, the sharpest part of the grief has largely passed. For now, it only hits us on occasion, and even then not to badly. It's a lot easier knowing that (1), this is not the end of Jonathan's life (but only the end of this part of his life), and (2), he's not only pain-free, but extremely happy now.
But the human psyche has an amazing capacity for dealing with pain and grief - we're an amazing species that way.
As I said, the Unknown Wife is hosting her ladies group shortly -- As I write, three women have already arrived. So, before I succumb to Estrogen overdose (and start watching the Lifetime channel), I'd better bolt.
- The Unknown Daughter is now done with school for the summer. I get a feeling that she'll be doing a lot of social activities this summer - since Friday (the last day of school), she's already had one sleepover (at a cousin's house), and has her second one (at our house) this Wednesday. In addition, she's just finished Neil Gaiman's The Graveyard book. She gets a real kick out of describing the plot to others - it's an unusual tale where the humans are largely the evil characters, and the supernatural ones (ghosts, vampires, werewolves, etc) are the good guys. Next on the agenda is Madeiline L'Engle's A Wrinkle in Time (she just finished the 6th Harry Potter book, and is looking for some variety before tackling the 7th). All in all, not bad for someone who just finished 2nd grade.
- The Unknown Baby is now starting to make sounds - a LOT of sounds. So, he's become the star of any family gathering (he was anyway, but now that he's "talking" and laughing, we pretty much get a complete pass on having to take care of him at any event with others around --our rule is that to hold him, you have to do the associated diaper change). More importantly, he's now sleeping more that 6 hours at a pop at night. So, we give him his last feeding between 11 and 12, and don't hear from him until about 6.
- We've been doing a lot of social things - my sister and law and brother run a golf tournament to raise funds for cancer research (they lost their son to Neuroblastoma a couple of years ago). While we missed the tournament this year, we did make it up for the kid's mini-golf event this past weekend. In addition, the Unknown Wife is hosting her women's bible study group this morning, so the house will shortly be filled with about ten women. Finally, we'll be traveling to West Virginia shortly for a family reunion over the 4th of July weekend.
As for the 500 pound gorilla in the room - we're coping fairly well with the whole grieving process. Of course, it's different for the Unknown Wife and I (hey - the process is different for any two people). For me, it's toughest at night (in the time just before sleep)- for the majority of the day, I don't think about it much, except for the odd moments when I see/hear something that reminds me of the little guy. For her, it occurs more frequently, mostly because she's at home most of the day, where she sees more reminders. We each have different "therapies" - for me, I think about Jonathan on bike rides (almost 17 miles yesterday), and for the Unknown wife, it involves talking about him with friends and family.
But, the sharpest part of the grief has largely passed. For now, it only hits us on occasion, and even then not to badly. It's a lot easier knowing that (1), this is not the end of Jonathan's life (but only the end of this part of his life), and (2), he's not only pain-free, but extremely happy now.
But the human psyche has an amazing capacity for dealing with pain and grief - we're an amazing species that way.
As I said, the Unknown Wife is hosting her ladies group shortly -- As I write, three women have already arrived. So, before I succumb to Estrogen overdose (and start watching the Lifetime channel), I'd better bolt.
Labels:
The Unknown Family
Saturday, June 27, 2009
Even Children Can Understand Economics
Every once in a while (actually, make that "on a regular basis), the Unknown Daughter comes out with something that really floors me.
The other day, UD was asking about my grandparents. I told her that both grandfathers worked it the fabric mills in my hometown (back in the day, there were three mills in town). Somehow, the topic morphed into what happened to the mills, so I told her that the mills eventually moved a lot of their business down south, and then (eventually) overseas.
"Why?" she asked?
I answered, "Because the people there would work in the factories for less, so the mill owners could make the fabric more cheaply. Unfortunately, that means that a lot of the workers in the mill lost their jobs."
"So why did they do it if the workers lost their jobs?"
"Well UD, since it cost less to make, they could sell the fabric at a lower price. So, while the workers lost jobs, the people who bought it actually benefited. This means that some workers lost money, and the people who bought the fabric benefited."
Here's what she said: "But Daddy - the people who bought the fabric weren't the only ones who got something out of it. The people who sold the fabric and the people who owned the stores made more money, so they could spend more on other things, like movies and meals and stuff, so they helped the people who sold those things. And then those people had more money, so they could hire more workers, so they benefited, too."
I asked her how she came up with this idea, and she said she just did. Then she gave me "that look" (i.e. 8 years old going on teenager), and said, "After all--my dad IS a finance professor, so I should be smart".
After thinking about it, I realized that she'd gotten that right, too. But the "genetic" story wasn't what I was thinking about--she picked this up largely through osmosis, since I'm often trying to get the Unknown Wife to think in economic terms (i.e. who benefits and who loses, and how). Of course, when I do this, it only serves to tick UW off.
But UD misses little, and remembers most things she hears or sees. So, when she turns teenager, I'm in biiiig trouble.
I shared this with one of my colleagues, and he suggested that I should have UD talk with our state legislators - she could teach them a thing or two.
But given this Wall Street Journal article, I'm skeptical.
The other day, UD was asking about my grandparents. I told her that both grandfathers worked it the fabric mills in my hometown (back in the day, there were three mills in town). Somehow, the topic morphed into what happened to the mills, so I told her that the mills eventually moved a lot of their business down south, and then (eventually) overseas.
"Why?" she asked?
I answered, "Because the people there would work in the factories for less, so the mill owners could make the fabric more cheaply. Unfortunately, that means that a lot of the workers in the mill lost their jobs."
"So why did they do it if the workers lost their jobs?"
"Well UD, since it cost less to make, they could sell the fabric at a lower price. So, while the workers lost jobs, the people who bought it actually benefited. This means that some workers lost money, and the people who bought the fabric benefited."
Here's what she said: "But Daddy - the people who bought the fabric weren't the only ones who got something out of it. The people who sold the fabric and the people who owned the stores made more money, so they could spend more on other things, like movies and meals and stuff, so they helped the people who sold those things. And then those people had more money, so they could hire more workers, so they benefited, too."
I asked her how she came up with this idea, and she said she just did. Then she gave me "that look" (i.e. 8 years old going on teenager), and said, "After all--my dad IS a finance professor, so I should be smart".
After thinking about it, I realized that she'd gotten that right, too. But the "genetic" story wasn't what I was thinking about--she picked this up largely through osmosis, since I'm often trying to get the Unknown Wife to think in economic terms (i.e. who benefits and who loses, and how). Of course, when I do this, it only serves to tick UW off.
But UD misses little, and remembers most things she hears or sees. So, when she turns teenager, I'm in biiiig trouble.
I shared this with one of my colleagues, and he suggested that I should have UD talk with our state legislators - she could teach them a thing or two.
But given this Wall Street Journal article, I'm skeptical.
Labels:
Economics,
Unknown Daughter
Friday, June 26, 2009
A Good Private Equity Blog
Thanks to Analyst Forum (one of my regular stops), I just came across a pretty good blog on Private Equity called The Private Equiteer. It has a lot of posts that go through the basics of the private equity world (here's a list of many of them).
I'm adding it to the blogroll.
I'm adding it to the blogroll.
Labels:
Blogs,
Private Equity
Tuesday, June 23, 2009
That D@!* Musical Swing (Punisher Version)
Like many new parents, we use a battery-powered swing to help the Unknown Baby Boy fall asleep for his naps. Our model comes with a musical option that plays an assortment of tunes. They range from "Ode to Joy" to some pretty irritating, calliope-sounding music that could be easily be heard at the circus. But one song in particular makes me smile every time I hear it.
The Unknown Wife asked why, so I showed her this clip (I just linked it because embedding was disabled for this clip). Caution - turn the sound down, because it cuts to a pretty loud, discordant piece near the end.
The Unknown Wife said she'll never hear that tune again without seeing this clip in her mind's eye.
Mission accomplished - my work here is done.
The Unknown Wife asked why, so I showed her this clip (I just linked it because embedding was disabled for this clip). Caution - turn the sound down, because it cuts to a pretty loud, discordant piece near the end.
The Unknown Wife said she'll never hear that tune again without seeing this clip in her mind's eye.
Mission accomplished - my work here is done.
Sunday, June 21, 2009
On Teaching Math
The Unknown Daughter is also known by most of my family as "The Math Princess." She seems to get math concepts more quickly than almost anyone else at her grade level. Well, there is one one boy in her class who is just about at her level, but she has a better Rear Naked Choke than him (knowing what boys can be like, I started teaching her various martial arts techniques at age 4 - I figure if she cripples the first boyfriend, my work is largely done).
She's really good at the rote learning/memorization/multiplication tables part of math, and that's important (hey - if you know your tables cold, many things seems to get easier). But what makes me happiest is that she really enjoys the math puzzles I give her. When she finally sees a pattern, she gets really excited. For example, when she realized that she could use the distributive law (i.e a(b+c) = ab + ac) to do mental math, she got really excited.
So, I enjoyed this piece titled "A Mathematician's Lament" by Paul Lockhart. Here's the best line(s) IMO:
HT: Kids Prefer Cheese
She's really good at the rote learning/memorization/multiplication tables part of math, and that's important (hey - if you know your tables cold, many things seems to get easier). But what makes me happiest is that she really enjoys the math puzzles I give her. When she finally sees a pattern, she gets really excited. For example, when she realized that she could use the distributive law (i.e a(b+c) = ab + ac) to do mental math, she got really excited.
So, I enjoyed this piece titled "A Mathematician's Lament" by Paul Lockhart. Here's the best line(s) IMO:
Part of the problem is that nobody has the faintest idea what it is that mathematicians do. The common perception seems to be that mathematicians are somehow connected with science— perhaps they help the scientists with their formulas, or feed big numbers into computers for some reason or other. There is no question that if the world had to be divided into the “poetic dreamers” and the “rational thinkers” most people would place mathematicians in theHe's an advocate of teaching by puzzles. like "if you inscribe a triangle in a rectangle, can you figure out how much of rectangle's area is captured by the triangle" (for an arbitrary triangle, that is). Read the whole thing - it's worth it.
latter category.
Nevertheless, the fact is that there is nothing as dreamy and poetic, nothing as radical, subversive, and psychedelic, as mathematics. It is every bit as mind blowing as cosmology or physics (mathematicians conceived of black holes long before astronomers actually found any), and allows more freedom of expression than poetry, art, or music (which depend heavily on properties of the physical universe). Mathematics is the purest of the arts, as well as the most misunderstood.
So let me try to explain what mathematics is, and what mathematicians do. I can hardly do better than to begin with G.H. Hardy’s excellent description:
"A mathematician, like a painter or poet, is a maker of patterns. If his patterns are more permanent than theirs, it is because they are made with ideas. "
So mathematicians sit around making patterns of ideas. What sort of patterns? What sort of ideas? Ideas about the rhinoceros? No, those we leave to the biologists. Ideas about language and culture? No, not usually. These things are all far too complicated for most mathematicians’ taste. If there is anything like a unifying aesthetic principle in mathematics, it is this: simple is beautiful. Mathematicians enjoy thinking about the simplest possible things, and the simplest possible things are imaginary.
HT: Kids Prefer Cheese
Subscribe to:
Posts (Atom)