Unnaturally Long Attention Span

AvatarA blog about Grad School at Stanford, Working in a Silicon Valley Internet Company, and Statistical Machine Learning. mike AT ai.stanford.edu

On Stock Trading

I've made quite a bit of money this past week trading stocks in my Roth IRA. Here's a few things that I learned, which I hope will be of use to you as well.

1. The reward function of playing the stock market game should NOT be the stock price itself. The reward function is actually SELLING stocks at a high margin over what you paid for them. So, if you are training a reinforcement learner (such as your brain or a Markov Decision Process) , no reward should be applied when the stock price increases, unless a sale is to be made.

Taking this into account, only two modes of short-term stock trading make sense to me:

1. Betting on a Bull Market
In this mode, you begin the trading near the beginning of a big event, such as the winter shopping season or the end of the fiscal year for a particular industry. You choose a basket of stocks that reflects how you predict the industry will be changed at the end of this quarter. Take all of the companies that you think will be affected positively, subtract out those which everyone else thinks will be positive (since those expectations are already reflected in the price) and buy those stocks. So for example, if you think AMD will beat out INTEL in the next batch of processor releases and it is counter to what the public believes, then buy it! Hold on to the stock until the event passes, and then sell your stock at the end of this 1-2 month period. Your gain/loss will reflect exactly how good your prediction was.

2. Interday/Week trading
The most important thing to remember is that each trade costs you $7 (with Scottrade, which is what I use), so you must try to make trades that at least cover you for the $7. This means that the trades necessarily have to be in larger volumes on stocks that have higher volitility. This translates into more risk. However, there are techniques to balance the risk by choosing a set of stocks that balance each other. Unlike the first mode, this type of trading can be done even when the market is flat, since you are just betting on the small changes that happen day-to-day. In addition to choosing stocks that move a lot from day-to-day, you want to choose stocks that have a sufficient information streams. What I mean, is that even though those penny stocks might have huge amounts of movement, if there is not much news related to that company, you don't really have enough information to make an informed trade. So, you really want to choose companies that have a mid-size stock, information-rich news stream, and those that are not likely to go out of business the next day. For this type of trading, you want to hold onto the stock for at most just a few days.

Grad Student Orientation Event this Friday

Hi friends,

Sorry for the relative dearth of posts recently. There are a few reasons for this:

1. We are in scramble-to-get-it-done mode for prepping our DEMO Fall05 here at the startup. Our biz-dev guys are down in Long Beach now getting ready. Check out live video updates at http://www.demo.com/

2. I've been catching up with a lot of friends and family lately

3. I've been putting some time into my own hobbies.

Hopefully things will change soon and you will start to see more posts.

Later this week, I will be back on campus! I have been volulntering my time to help out new incoming Grad students. The department will be hosting an orientation lunch on Friday to welcome the new students. For those of you that have been busy asking me questions all summer, this is a great chance for you to network with your future peers and I highly recommend it. It's really true that you will probably meet your best acquaintances at orientation. It'll be nice to finally put a face to an email address and I'll be able to give you the inside scoop on how to get RA and TAships, getting around paying tuition, finding jobs and venture capital, the local housing situation, and what are the best seafood bars in Silicon Valley.

Looking forward to meeting you all,

Now, coming to you on location from Mountain View, CA

OK, so this past weekend I finally moved out of Stanford campus into Mountain View. Thanks a lot to my girlfriend for the hard labour, I couldn't have done it without you! Now, I'm literally a short bike ride away from work, the San Antonio shopping center, the movie theater on Shoreline and yummy ethnic foods of Cupertino. It's a great location--I'm paying less rent and my room is now double in size, we have pool table, private gym, and garaged parking. For those of you that know the Stanford campus, it is the absolute worst place to get food after dark(or even during the day). Not the ideal environment for the hungry late night hacker. Now i'm walking distance from food 24/7...

Ahh, Missing Good Old Berkeley

A 6 year old programmer

http://davidbau.com/archives/2005/07/29/haaarg_world.html

This is a cute post about a dad teaching his son to program a game. I got started in CS by programming my own games, too. This was because, unlike the other cool kids, I didn't have any games on my computer, since my Dad had an Apple. My first CS book was TRS80 Basic Computer Games, which I bought with a quarter while I was out yard sale shopping with my mom. This was an old book, even at that time, and it was not all that useful, since I didn't have a Radio Shack TRS80, so I had to port the code myself. This was back in elementary school, and my Dad quickly figured out that I had an interest in this sort of stuff and got me my first compiler: MS QuickBasic for Apple. The rest, as they say, is history...

How many other coders got their start this way?

San Jose Grand Prix

I woke up at 7AM this morning, stupefied at my inability to sleep. I had been awaken, not by the humming of the quad-proc rank mounted server under my bed, nor the by the persistent sounds from the street outside, but by an algorithm. I had an idea for a new algorithm in my head that just needed to get out. It had been bothering me for days.

Maybe this is why I can't sleep.

I take a short drive to the office. 3 hours later, I had written 20 pages of code. I grab some drinks and snacks from the break room and scan the daily newspaper. Apparently there's some major event this weekend in downtown San Jose, so I decide to drive down and check it out. The first ever San Jose Grand Prix is Indy 500 meets street racing. They had blocked out several streets in downtown San Jose near Almaden (by the Adobe building) to form one long makeshift racetrack. I saw several Formula 1 racecars, black dudes spinning out on motorcycles, and NASCAR dads grilling burgers. As expected there were plenty of hot dogs, beer vendors, and scantily clad women. I wish Palo Alto was this cool.

Anyways, I was just there for a short while, but here are some photos other people took.

Birds mimic ringtones

German ornithologists claim that some birds are now singing the songs of cell phone ringtones. Richard Schneider of the NABU bird conservation center near Tuebingen says that jackdaws, starlings, and jays are the best mimics. Still, the birds apparently can't copy more complex polyphonic ringtones. From Deutsche Presse-Agenture:
One reason for the phenomenon was that these birds were increasingly common in the urban environment, even the relatively shy jay, (Schneider) said. "There is food and an increasing amount of green space in modern cities."

The birds were simply adapting to their environment in imitating human sounds in what he termed an "evolutionary playground."
Link

Stanford Shots

Check out this great collection of Stanford Panoramas.

http://www.flickr.com/photos/madh/22775430/in/photostream/

There is a rare shot of Lake Lagunita with water!

Humorous Links

http://gameads.gamepressure.com/tv_game_commercial.asp?ID=1535
http://www.monzy.com/intro/drama_lyrics.html

US Politics

If you want a good laugh, try reading CNN sometime. US politics and FR are such a joke these days..

Gen. John Abizaid's testimony came at a contentious Senate Armed Services Committee hearing at which Defense Secretary Donald H. Rumsfeld clashed with members of both parties, including a renewed call by Sen. Edward M. Kennedy of Massachusetts for him to step down.

Citing what he called repeated "gross errors and mistakes" in the U.S. military campaign in Iraq, Kennedy told Rumsfeld: "In baseball, it's three strikes, you're out. What is it for the secretary of defense?"

"Isn't it time for you to resign?" Kennedy asked.

"I've offered my resignation to the president twice," Rumsfeld shot back, saying that President Bush had decided not to accept it. "That's his call," he said.

Kennedy has called for Rumsfeld's resignation before.

Wow, I wonder how Rumsfeld's self-esteem is doing these days.
source: CNN

Weekend Movie Review: Howl's Moving Castle

Howl's Moving Castle by Diana Wynne Jones seems especially suitable for adaptation by Hayao Miyazaki because it has many of his favorite themes. The central character is a young girl who shows determination and loyalty when she is brought into a world of strange and magical characters, many of whom appear oddly remote. She faces challenges that teach her that she is more capable and loving and deserving of love than she knew. And it has the kinds of settings that Miyazaki loves to illustrate, with intricate mechanical devices, characters who are transformed or disguised, and shifts of angles and planes that show off his gift for vertiginous perspectives.

The story is about a girl who is transformed into an old woman by a witch whose spell prevents her from even telling anyone what happened. So, she becomes the cleaning lady for a mysterious wizard who lives in a magical castle that flies from one place to another.

It turns out she is not the only one who is not what she seems. A graceful but silent scarecrow, a wheezing dog, a little boy, the wizard, and even the wicked witch will all have unexpected transformations as they try to escape from the order of the king, who wants all magicians to help him fight a war.

There are some gorgeous visuals,a lush field of flowers, a charming town, and the endlessly inventive castle, which moves along on chicken feet. But like the title character, it seems to be missing a heart. The characters are reserved and distant, and they tolerate, even seem to expect a level of disengagement from enemies, friends, and even family that is disconcerting. The voice talents include Lauren Bacall, Blythe Danner, and Christian Bale, but they never mesh; it's as though each is in a different movie. It is unsettling that the objects -- a flame (voice of Billy Crystal), a scarecrow, even the machines seem to have more personality than the humans. Ultimately, it is easier to appreciate the movie than to be enchanted or engaged by it.

Parents should know that this movie includes battle violence and frequent peril and tense confrontations. Characters are transformed or disguised in forms that may be troubling to some in the audience. A character smokes a cigar. There is brief non-sexual nudity (tush) and implied off-screen nudity.

Families who see this movie should talk about the advantages and disadvantates Sophie finds in being old. Why does she change her mind about the witch?

Families who enjoy this movie will also enjoy the Oscar-winning Spirited Away. They should read the book and some of the other stories by Diana Wynne Jones. They will also enjoy the books of Lloyd Alexander, Brian Jaques, and Tamora Pierce.

Happy Father's Day

Made it into office at a record 12:45PM... I'm putting the finishing touches on this vertical crawler I'm working on and eating a Honey Ham sandwich I brought for lunch. All of the sudden I'm surrounded by three skinny Latino girls with short frilly skirts, bleach died hair, and tight revealing tops.

"Hi, Michael! Is that your name?", I hear as I swivel around and notice the out-of-place female in front of me. I look across the hall at Scott, sitting in his office and giving me a smart smirk.

"The Elements of Statistical Learning, how is that book?"
"It's a bit dry", I say.
"We're here selling perfume for Father's day", she says as she sprays a liberal amount of yellow liquid and massages it all over my arm. "How old are you?"
"I'm 22."
"Oh, so am I! What do you guys do here?"
"We make websites.."
"I have a website, too! Do you want to see my pictures?"
"It's ok."
"Normally, I would charge $30 for this cologne, but today, for you, It'll only be $15 since for Father's day. We take checks, too and it includes the box."
At this point I escort the ladies out of our office, and send them off. I go to the bathroom to wash off the cheap cologne off both my arms. I still smell it...

LOL, only in the Valley.. I wonder how far they walked today. Reminds me of the days in high school me and Saee used to walk into high-tech companies and through tech park parking lots looking for jobs.

StreetPricer.com

I was looking Dell coupons to buy a Plasma HDTV and came across this awesome deals site. You definitely want to check it out! They have all the best coupons and some pretty good special offers. http://www.streetpricer.com - I've put the link permanently on the right side, in case you want to visit it again in the future.

A Great Stock Tutorial

Recently, I found this great stock tutorial online. It goes over the basic types of stocks, short selling, and derivatives and options. Check it out for a great overview of the market as well as for an excellent directory of merchants. Visit http://www.stocktutorials.com

Stay Hungry, Stay Foolish

Video clip

PALO ALTO, California -- Steve Jobs told Stanford University graduates Sunday that dropping out of college was one of the best decisions he ever made because it forced him to be innovative -- even when it came to finding enough money for dinner.

In an unusually candid commencement speech, Apple Computer's CEO also told the almost 5,000 graduates that his bout with a rare form of pancreatic cancer reemphasized the need to live each day to the fullest.

"Your time is limited so don't let it be wasted living someone else's life," Jobs said to a packed stadium of graduates, alumni and family.
Jobs, wearing sandals and jeans under his robe, was treated like a rock star by the students, in large part due to the surge in popularity of Apple's iPod digital music player.

A group of students wore iPod mini costumes over their robes and several shouted, "Steve, hire me!"

Jobs, 50, said he attended Reed College in Portland, Oregon but dropped out after only eight months because it was too expensive for his working-class family. He said his real education started when he "dropped in" on whatever classes interested him -- including calligraphy.

Jobs said he lived off 5-cent soda recycling deposits and free food offered by Hare Krishnas while taking classes.

He told the graduates that few friends could see the value of learning calligraphy at the time but that painstaking attention to detail -- including mastering different "fonts" -- was what set Macintosh apart from its competitors.

"If I had never dropped out I might never have dropped in on that calligraphy," Jobs said.

Jobs also recounted founding Apple in his parent's basement and his tough times after being forced out of the company he founded when he was only 30.

"I was a very public failure and I even thought about running away from the valley," Jobs said.

Instead, he founded Pixar Studios, which has released enormously popular films such as Finding Nemo and Monsters, Inc.

"It was awful tasting medicine but I guess the patient needed it," Jobs said.

When he was diagnosed with cancer, Jobs said his doctor told him he only had three-to-six months to live. He later found out he had a rare, treatable form of the disease -- but he still learned a tough lesson.

"Remembering you are going to die is the best way to avoid the fear that you have something to lose," he said.

Roll-your-own Root Beer

You know, I used to somewhat like Root Beer. I would often get it at restaurants or fast food places to go with dinner. That is--before my girlfriend mentioned that it tastes like toothpaste. That just ruined it for me, and I haven't been able to bring myself to drink it since. Maybe there is hope, though, if I make my own. Here are instructions for how.

Hiring is Obsolete

A few weeks ago, Paul Graham gave an excellent talk at Berkeley about the future of hiring. Classic Paul Graham stuff. For those of you that missed it, he's written up a short essay based on his talk on his website: http://www.paulgraham.com/hiring.html

Beyond Google Maps

Think Google Maps is cool? Try out this new mapping site (http://map.search.ch/) to see an even better mapping program. Try double-clicking on the map!

My First Post!

I open my eyes to a pulsating red glow and deep sweat. I am in bed and it's 6:30 in the morning. The text message on my cell phone that has awaken me politely informs me that our machine in the server facility has gone down again. Shit. Time to reset the crawler, merge the indicies, start up the query processing backend, and reboot the web application. I jump out of bed, through clothing, and into a car. I barrel down the 2.5 mile stretch of El Camino Real that connects the Stanford campus and my office, passing by green lights and small coffee shops just waking up for the day. Burger place, gas station, internet company, burger place, internet startup, Starbucks, internet startup...

So, another day begins at the internet company I work at. After resolving a certain persistent server crisis, I head over to the company gym across the building. A short jog, 5 sets on the bench press, curls, abs, squats and I'm awake. Life is beautiful. I sit down on my black task chair in my corner office on the first floor of our Mountain View building. In front of me are two laptops, four bottles of water, two protein bars, three paper notebooks, a stack of charts and tables, and a stack of research papers. One of the laptops has a blinking console open to the NERSC supercomputing cluster at Lawrence Berkeley Labs. So much to do, so few CPU cycles..