tungwaiyip.info

home

about me

links

Blog

< May 2010 >
SuMoTuWeThFrSa
       1
2 3 4 5 6 7 8
9101112131415
16171819202122
23242526272829
3031     

past articles »

Click for San Francisco, California Forecast

San Francisco, USA

 

Why Smart People Make Big Money Mistakes

I have just finished a fascinating book, Why Smart People Make Big Money Mistakes by Gary Belsky and Thomas Gilovich. Traditional economics considers people as rational being, acting to optimize one's own welfare. In practice, few people really acting rationally all the time. Even well informed people have found to make many faulted financial decisions. Behavioral economics incorporates psychology and cognitive factor into consideration. It have found great insight into people decision making process.

Below are simply my notes taken from the book.

Ch.1 Mental Accounting, Richard Thaler. Statistical Regression, Sir Francis Galton, 1911 (tendency to fall back into statistical mean).

Ch.2 Prospect Theory, Daniel Kahneman, Amos Tversky, 1979. (Issue framing, e.g. loss aversion, sunk cost fallacy).

Ch.3 The Devil That You Know

Decision Paralysis - tendencies to avoid or delay action, particularly due to the fear of regret and a preference for the familiar.

  • Maximizer/Satisfier - Herbert Simon, 1950s.
  • Trade off contrast - choices are enhanced or hindered by the tradeoff between options, even for options we wouldn't choose anyway, Tversky, Simonson.
  • Extremeness aversion - people are more likely to choose an option if it is an intermediate choice within a group, Tversky, Simonson. (so it can be manipulated by introducing extreme choice).
  • Status quo basis, endowment effect - preference for holding on what you have.
  • Regret aversion - avoid the pain of regret and the responsibility for negative outcomes.

Counter Measures

  • Take opportunity cost into account
  • Mark Twain's saying, "Twenty Years from now you will be more disappointed by the things you didn't do than by the ones you did do."

Ch.4 Number Numbness

  • Neglecting the base rate - tendency to disregard or discount overall odds, Kahneman, Tversky.

Ch.5 Dropping Anchor

  • Anchoring - clinging to a fact or figure or idea that may or may not have any real relevance to your judgment or decision.
  • Confirmation bias/Preferential bias - once people developed bias, they tend to view new information in such a way that it supports those preferences (Edward Russo).

Ch.6 The Ego Trap

The tendency to attribute success to your ability but to attribute failure to other causes.

  • Heads I win, tails it's chance, Eileen Langer, 1975
  • "Expert" predicition, Tetlock
  • "Hindsight bias", Baruch Fischhoff

2010.05.27 [, ] - comments

 

My New Desktop Background

This is the picture I've used as my new desktop background. What is that? I think this is just some random picture my 4 year old son has taken. You know, he has learned to aim a camera to something, press the shutter button and got his own pictures. He makes outrageous mistakes by photographers' standard. A lot of times the lens was obscured by his finger, the picture was blurry, or he has framed on some unobvious objects. But sometimes his pictures also have certain abstract, artistic quality, certain intricacy of light, something totally original that you will never know how to make. So instead of just deleting his pictures, I have kept some of them.

Abstract Desktop Background

When I was flipping through my picture library to select a desktop background, one of his come out fittingly! I used to use pictures of beautiful landscape or family portrait as a background. What a mistake! The subject, the detail and the contrast are really distracting. Desktop is a place for holding clutters and a place for work. If you want to see beautiful picture, you should run a slide show. Turn out this out of focus picture of some place in my home works wonderfully. It stays in the background as a background image should. It provides good contrast to the icons over it. It has more visual interest than a plain solid color background. And viola, I've a totally unique picture nobody else has!

2010.05.26 [] - comments

 

Lenovo Laptop Upgrade

In the last few days, I was inundated with many new ideas and new gadgets. I was struggling to find the time to review information and write about them. I hope I can do this before the freshness wane off.

I am most grateful that my work horse laptop has gotten an upgrade. Over the last year the performance of my 3 year old Lenovo has deteriorated to an unusable level, probably due to a combination hardware and software issues. It was long over due for an upgrade. The replacement was a high end model, with 4GB RAM, SSD drive and Windows 7 OS.

The first impression, many operations are dramatically faster than its predecessor. For example, Excel takes just 1 second to launch, compares to 15 seconds in hold laptop. Bringing the laptop to sleep and then awake is also noticeably faster. Of course other people may have experience a less dramatic boost if their baseline performance wasn't as bad as my pathetic old laptop.

My company was sticking with Windows XP, skipping Vista, before finally upgrading to Windows 7. Windows 7 seems to be a good improvement so far. There is a badly needed system search function. Finally my outlook mail is searchable. The interface has undergone some changes. The taskbar becomes more like Mac's dock. Another change is better security. Installing program or writing to the registry will trigger a dialog requesting for administrator privilege. This may also cause problem in some older programs. For example, if a program simply writes its data into its program directory, it is considered a protected area. The write will fail unless the program can acquire special privilege.

I've spend more than one day reinstalling software and transferring data to the new machine. I pass using the data migration program offered our company's IT and opt to do most of this manually instead. I believe a lot of performance issues that I've been seeing has to do with the ...

(This is found in my draft folder and posted in 2016. Original date is estimated)

2010.05.20 comments

 

Droid v.s. iPhone - My First Impression

I have received Motorola Droid phone as a free gift courtesy from Google. My first question, do I really want an Android phone? I'm an iPhone user of 1.5 year. My service contract has not even ended. But since it is free I'll just give it a try. This is a report of my impression after using it for a few weeks.

The first thing that delights me is Droid has a physical keyboard! The onscreen keyboard is one of my biggest issue with iPhone. Despite iPhone fans' claim, the inaccuracy of onscreen keyboard bothers me. Unfortunately, Droid's keyboard quickly disappoints. The keys are flat. Its tactile feeling is so so. The keys are arranged as a rectangular grid rather than staggered. As much as I dislike onscreen keyboards, I can enter keys with a light touch. With this keyboard I have to push hard each time. My thumbs get sore quickly.

There are more serious problems though. I want to kill the designer who line the number keys on the top row. It is a real pain to type any long number like a phone number. Holding down the ALT key with the left thumb and reaching for the number key with the right thumb while trying to hold the handset steady is such a struggle. Yet this can be fixed simply by having a different layout. Arrange the keys in a numeric keypad pattern as in the diagram will do. You can easily use the left thumb to hold down the ALT key and type any numbers with the right thumb all sitting close together.

Droid Numeric Key Layout

Another problem is the alignment of the keyboard. Due to used space on the right, the Droid keyboard is significantly off centered toward the left. On a normal keyboard, the G and H keys are at about the center. On Droid, because the H key is so far to the left, it makes it much harder to reach it using the right thumb. As such Droid has a QWERTY keyboard that does not really feel like a QWERTY keyboard. What a shame! To this day my most favorite phone keyboard is still the first generation Sidekick. The large and well positioned keyboard makes it a real note taking machine!

Droid v.s. Sidekick keyboard

If the keyboard does not work as well as it should, the direction pad is still great. For navigation, the direction pad delivers much better precision compares to touch screen. I like to scroll using it rather than the imprecise, trial and error flicking gesture. Even better is its preciseness for moving the cursor inside a text for editing. With iPhone, it is super frustrating to try to position the cursor in any different location. So much that I simply give up correcting typing error or do much editing. With Droid I am writing this entire post using the phone, editing out every single error as I see it. Still there is a problem with Droid's direction pad. The key is hidden under the screen, making it unavailable when the lid is closed.

The 5MP camera is a big improvement over my iPhone's. The quality is approaching a basic digital camera. But most importantly, it has a macro lens that's pretty good at close up. This allows me to do what I like to do for a long time, to draw sketches on paper or whiteboard, then pull out a camera, take a picture and send it to my computer to be incorporated into a document or email. The keyboard sketches that I used in this post is the way I like to do. The important point here is not to produce the best quality illustration, which takes time and resources. It is that the process should be easy and casual. Just like drawing with pencil and paper. Droid is the first tool that make this feasible.

One of the key component that makes it possible is Gmail. This is how I transfer the pictures from the phone to my computer. Much to Google's credit, integration with Gmail is super smooth. The first time you setup the phone, it ask for your Google account information. Assuming you have a Google account, your are done. Gmail works right away! Google calendar also works! And you don't need to do any manual tethered syncing using iTunes!

Finally I want to comment on Android's UI Aesthetic. After using iPhone for a while, I find Android rather verbose. On iPhone the home screen is populated with big application icons. I can find application by picking from the pictures. With Android it is difficult to identify the application from their icons. They are about 30% smaller and their design seems not very distinguishable. Instead I have to pick the application by reading the text under it. Secondly iPhone UI relies more on icon and direct manipulation. It keeps the use of text to a minimal. On Android I often see long phrases, or even a complete sentences, for describing the action. Contrast their setup screen for the difference in style.

Setup screen Droid v.s. iPhone

I suspect my son won't like my Android phone as much as the iPhone. Well he is only 4. So why does it matters? The things is he start to play with my iPhone before he turns 3, and has become quite good in applications like the camera or the photo gallery. All these he mostly learn on his own with few instruction from me (indeed I actively discourage him from messing with my phone.) I think this is a testimony that the iPhone UI is a really phenomenal success. It sets a high bar for others to beat.

2010.05.19 [, ] - comments

 

Python CSV reader is much faster than pickle

If you are considering to serialize a large amount of data to the disk, performance may become a concern to you. Python provides a serialization tool in the pickle module. There is also an optimized version called the cPickle. But how do they perform?

The data of concern to me is tabular data. In order to do a bake off, I have generated 50,000 records of sample data. The CSV representation is shown below:

seq, name, address, city, age, birthday
1000,John M. Doe,2147 Main St.,Middle Town 14,47,1985-05-15
1001,John N. Doe,2148 Main St.,Middle Town 15,48,1985-05-16
1002,John O. Doe,2149 Main St.,Middle Town 16,49,1985-05-17
1003,John P. Doe,2150 Main St.,Middle Town 17,50,1985-05-18
1004,John Q. Doe,2151 Main St.,Middle Town 18,51,1985-05-19
1005,John R. Doe,2152 Main St.,Middle Town 19,52,1985-05-20
1006,John S. Doe,2153 Main St.,Middle Town 20,53,1985-05-21
1007,John T. Doe,211 Main St.,Middle Town 21,1,1985-05-22
...

Naturally, CSV is a contender for storing tabular data. (Indeed the data source I'm working with is in CSV format.) The two pickle modules produce identical data output. In addition, Python 2.6 also provides a JSON module that do the similar task as pickle but outputs a standard text based format. I included it in the comparison below.

First observation, CSV output the most compact data at 3MB. Pickle output is 40% larger at 4.2MB. JSON is somewhere in between. The speed? CSV is the winner among them all.


Method Load Time (ms) File size (MB)
CSV 188 3
CSV int 289 3
cPickle 692 4.2
pickle 1,815 4.2
JSON 4,975 3.9

Note that CSV reader create data items as string. In the sample data, two out of the six columns are integer fields. In order to do an apple-to-apple comparison I have another test that do integer conversion after loading such that the data loaded is identical to pickle's. This impacted the performance somewhat. But it is still more than twice as fast as the faster cPickle module. The standard library's JSON's performance trailing far behind, making it unsuitable for anything performance intensive. FYI, unlike the other modules, JSON's output is in unicode.

The test is done by Python 2.6 on Windows XP machine with 2.33GHz Core2 CPU (Download source code).


2010.05.12 [, ] - comments

 

The Day When Machines Rule The World

Yesterday the U.S. stock market experienced a sudden and volatile fluctuation. Dow Jones index has briefly dropped by 10% during intraday trading. The main culprit seems not to be economic issue but suspect to be a glitch in trading. Apparently one trader has entered an exceptionally large trade by mistake, which set off all the automatic trading program to sell-off. There goes the market value.

Watching this episode I see a picture emerging. This is the day when machines begin to rule the world. For all the vigilance put in place after the computer induced 1987 market crash, we are still, or perhaps even more vulnerable due to more reliance on computers.

The conflict of man against machine seems like a sci-fi plot. But I think it is more realistic than most people think. The problem is we are looking for an anthropomorphous entity like HAL, an supercomputer that knows it all, have immense analytic power, and the most frightening part, it has a mind of its own. As far as I know I don't see anything like this on the horizon.

Instead there are countless software agents roaming the net, collecting information, building database, distributing information and in some case taking active roles like trading stock. This global computer network has developed immensely in the past 2 decades, impacting every aspect of our society. Mostly it makes our economy more efficient and keeping us better informed. But does the system also enslave us in some way? Are human truly in control of our destiny. Or are we at the mercy of the system?

I am imagining how the next computer glitch would look like. Think Google Calendar. One day it may suddenly 'recommend' a political rally event to all users, those logic that even its creator cannot explain. And our history may have changed as a result.

2010.05.07 [, ] - comments

 

past articles »

 

BBC News

 

Prague gunman killed himself on roof as police approached (22 Dec 2023)

 

Bodycam footage shows police hunting Prague gunman (22 Dec 2023)

 

Alex Batty: Police launch abduction investigation into disappearance of British teen (22 Dec 2023)

 

Banksy stop sign drones art removed in London (22 Dec 2023)

 

Martin Kemp refunds disabled ticket after fans' difficulty with seller (22 Dec 2023)

 

Queues at Dover as Christmas getaway begins for millions (22 Dec 2023)

 

New £38,700 visa rule will be introduced in early 2025, says Rishi Sunak (22 Dec 2023)

 

UK at risk of recession after economy shrinks (22 Dec 2023)

 

Mohamed Al Bared: Student jailed for life for building IS drone (22 Dec 2023)

 

Andrew Tate denied request to visit ill mother in UK (22 Dec 2023)

more »

 

SF Gate

more »


Site feed Updated: 2023-Dec-22 09:00