2015-09-23
2013-03-01
SI Units, Date and Time Formats
I just want to explain why I am a big fan of SI units (the metric system), and the ISO date format.
First, the metric system. It is so simple and elegant. Consider some examples: If an airplane has a glide ratio of 1:10, it can glide 10 metres for 1 metre of altitude loss. Now, I am 1.5 km high, and I have an engine failure. How far can I glide? Well, 1.5 x 10 = 15 km. Ok, I can reach that airport, time to go through the checklists. Or that's what it were if the metric system were used. In reality, it is 4500 ft high. So, how far can it glide? Well, 4500 x 10 ft = 45000 ft, that's easy enough, but distances are in nautical miles, so that's 45000 divided by, what, let me try and remember, err, it's about 6070 ft per nautical mile, so that's 45000 by 6076, so that's about 450 by 6.076 or about, let me think, err, 7.5 plus minus a few percent, except by this time I've already lost some 500 feet altitude and now it's only, err, wait, about 6.5 nautical miles.
Note, by the way, that there is a straightforward way to convert between nautical miles and kilometres, namely: 100 km = 54 NM. Why? Because the metre was chosen such that the distance from pole to equator is 10000 km (that's why the circumference of the earth is about 40 Mm (megametres)). On the other hand, a nautical mile corresponds to one arc minute of latitude. But there are 60 minutes per degree, and 90 degrees in a right angle, and from the equator to the pole is just a right angle, i.e. 90 degrees, or 90 x 60 = 5400 arc minutes. Thus, 10000 km = 5400 NM. In practice, this is approximate, because the earth is not quite round.
Next, suppose I want to buy a cheap orange juice. I have one bottle with 2 litres, one with 250 ml, and another with 1.5 litres. I can convert the 250 ml into litres: It's 250 / 1000 = 0.25. Now that was hard. Now I just divide the respective prices by the respective volume (2, 0.25, 1.5), and can choose the cheapest one. Except if I'm in the US. (According to wikipedia, the only 3 countries in the world that do not officially use the metric system are the US, Liberia, and Myanmar. I haven't been to Liberia, and in Myanmar I got fresh juice, not bottled, and given that the country is going through a phase of positive development, I am sure they'll switch to the metric system before long). So, in the US, one bottle will have a half gallon, the other one 3 pints, the next one 10 ounces, and the next one 2 quarts. How to determine which one is cheapest? I have no idea, and I don't really care. Maybe that's why they do it.
Let's look at energy consumption of humans vs cars. An average human eats about 10 MJ (mega Joule) a day, that's 10 000 kJ in one day or 86400 seconds, so let's just call it about 0.1 kJ = 100 J (more or less) per second. Now, a Joule per second is just a Watt, so we humans burn around 100 Watt. That's about as much as a bright light bulb. A car, on the other hand, has about 100 kW, so uses in the vicinity of thousand times as much as a human. Try to reach that conclusion using calories and horse power.
As for dates, my preferred date format is YYYY-MM-DD, eg 2013-02-20. It has several advantages:
- it is unambiguous. 2013-02-20 means 20th February 2013. What does 06/07/08 mean? The DD/MM/YY and MM/DD/YY date formats are particularly reprehensible to me, due to this ambiguity. Why continue to use them? (I have missed meetings, because an international organisation thought it wise to send invitations to a meeting in London on "3/4/2001", which took place in March, not April, when I had filed it.)
- alphabetical order coincides with chronological order. If I name my files "Bank Statement 2012-02-20", "Bank Statement 2012-01-21" etc., and then sort them by name, they are also sorted by date. If I name them "Bank Statement 20 Feb 2012", or "Bank Statement 20.02.2012", and then sort them by name, they will not be sorted by date, but in some mess.
- it is in line with the way we write time: in 19:15:00, we have the largest unit (hours) first, then the middle unit (minutes), then the smallest unit (seconds). If we were to write time the US way, we'd write 15:00:19 (or, given that it's the US, 15/00/7p), while the continental European way would be 00.15.19. How much nicer to write 2013-02-20 19:15:00 (note how that this way, alphabetical order coincides with chronological order even including time, because we progress from biggest to smallest unit (assuming of course that you use the 24h clock))!
This gets to my last point: How civilised is the 24h clock! A day starts at 00:00:00, progresses via 00:00:01, later 11:59:59, 12:00:00, 12:00:01, and 23:59:59 to end at 24:00:00, which is also the 00:00:00 of the next day. (Ignore leap seconds for now). No messing with am and pm, and in particular no messing with the question whether noon is 12 am or pm. And if there is a deadline for midnight of the 10th February, it is 2012-02-10 24:00h. Done. No ambiguity with the question as to what day it is, or whether it's noon or midnight. A flight could depart on 2012-02-11 00:00h, at the same time as the deadline. In the US, your deadline would probably be shortened by a minute to 2/10/12 11:59p, robbing you of a valuable minute to finish things, while your flight would be delayed a whole minute to the exceedingly ugly 2/11/12 12:01a.
Note that the YYYY-MM-DD format is also the international standard (as highlighted by the wonderful xkcd).
To conclude, I have nothing against necessary compromise, and can understand evil that benefits at least someone. But unnecessary, useless, and ugly evil, such as "2/11/12 12:01a"? How revolting.
2013-02-25
My first Loop
The Assumptions Underlying the CAPM
It wasn't quite clear to me what the logical dependencies were in the CAPM (Capital Asset Pricing Model). I looked into it, and have written up my thoughts below.
Here is the main conclusion of the CAPM:
(MC)
where p is any portfolio of assets, E[ r(p) ] the expected return of that portfolio, beta_m(p) the market beta of that portfolio, E[ rm ] the expected return of the market portfolio, and r0 essentially the risk free rate (if no risk free asset exists, the equation still holds by setting r0 to the expected return of the zero covariance portfolio of the market portfolio).
In other words, the expected excess return (i.e., return above r0) of any portfolio is equal to the beta of the portfolio times a constant, namely the expected excess return of the market portfolio. Thus, a portfolio with a beta of one has the same expected return as the market portfolio, while a portfolio with zero beta has an expected return equal to the risk free portfolio.
Definitions
Some quick definitions that come in handy:
- An m-v-efficient portfolio is a portfolio of assets that has the minimum variance for a given expected return (also called a frontier portfolio, because if we plot mean and variance of all possible portfolios, the m-v-efficient portfolios will constitute the (parabolic) frontier of that shape).
- The beta of a portfolio p with respect to some other portfolio m is: where sigma(p,m) denotes covariance between p and m, sigma^2(m) the variance, rho correlation, and sigma(x) the standard deviation of x.
- The market portfolio is the sum (or portfolio) of all portfolios of the individual investors.
The main conclusion of the CAPM (MC) follows immediately from the following:
- 1) The market portfolio is m-v-efficient.
That's really it. The rest is mathematics. (Of course, there are all these idealised world assumptions: no transaction costs, finite set of assets with finite expectation and variance, homogenous expectations (that is, all investors agree on the expected returns and variance-covariance matrix of the assets), shorts sales of all assets allowed, no arbitrage, etc. etc.) But, the main conclusion above rests ONLY on the mean-variance efficiency of the market portfolio, and is a direct mathematical consequence of that.
In particular, two things hold true just by looking at the mathematics of expectation and variance of portfolios.
Mathematics
- A) The set of m-v-efficient portfolios is convex (whether or not there is a risk-free asset). That means that any combination (or portfolio) of m-v-efficient portfolios is again an m-v-efficient portfolio.
- B) Fix any m-v-efficient portfolio m. Then, for any portfolio p, there is is a linear relationship between the expected return of p and the beta of p with respect to m. This is rather remarkable: the linear relationship between return and beta of portfolios holds with respect to any m-v-efficient portfolio.
So, all one needs for (MC) to hold is above 1., that the market portfolio is an m-v-efficient portfolio (then the linear relationship of return and beta, which holds with respect to any m-v-efficient portfolio (by mathematics B)) holds with respect to the market portfolio). Now, under what circumstances is the market portfolio going to be m-v-efficient? Well, easy, let's introduce the next two assumptions:
- 2) All investors are m-v investors, that is, their preference involves only mean and variance of a portfolio (in particular, the more mean for given variance, the better).
- 3) The market clears, equilibrium prevails.
Now, 2) implies that all investors wish to hold m-v-efficent portfolios. The market clearing assumption 3) means that all investors do indeed hold m-v-efficient portfolios. Then, by the convexity of m-v-efficient portfolios (mathematics A)), the market portfolio is m-v-efficient, so we have 1), thus we have (MC).
The question arises then: Are investors m-v investors? A few things to note:
- m-v preference is sometimes understood to be a special case of expected utility maximisation (EUM). Indeed, it can obtain under certain conditions: one needs to impose conditions on either a) the distribution of returns, or b) the utility function of investors, or c) joint conditions on both (essentially cutting off the Taylor expansion of the expected utility after a few terms).
- a) When returns are normally distributed, m-v preference holds under EUM. This is clearly not a very realistic assumption (it excludes assets with limited liability, for example, and does not allow for large jumps as frequently as they are observed in reality). However, one can generalise this to elliptically distributed returns (such as multivariate normal, student-t, or even Cauchy), as shown by G. Chamberlain in 1983 (these allow both fatter tails, if desired, or limited liability assets).
- b) For arbitrary returns distribution, investors are still m-v investors if the utility function is quadratic, as Harry Markovitz pointed out already in 1952. This is clearly not very realistic, as utility is not monotonically increasing. Even if restricted to the increasing arm of the parabola, quadratic utility displays increasing absolute risk aversion, which is not consistent with empirical results.
- c) The case of joint conditions on returns and distributions was examined in detail by Berk in 1997. It doesn't really allow for more realistic cases though.
- m-v preference has some problems:
- investors are presumed indifferent with respect to higher moments, e.g. the skew of a distribution, which is clearly unrealistic.
- investors might reject the addition of an asset with too high variance, even if it is of limited liability. (Imagine I offer you a free share of Facebook or some other other super volatile asset. It might drop to zero, or it might become quite valuable, but it has massive variance. Clearly, you'd take it for free, as there is only upside. A m-v investor, however, might reject it, if it increases his variance too much without sufficient increase in mean).
- it is not compatible with constant relative risk aversion, which is empirically quite plausible, as shown by Andreas Löffler in 1996.
- m-v preference follows from two fairly innocuous conditions, namely monotony in the risk free asset and variance aversion (the rejection of adding any noise portfolio that has zero mean and zero covariance to the existing portfolio), as shown by Andreas Löffler in 1996.
- All in all, m-v preference is fairly problematic, empirically implausible, and only really used because it is so simple and analytically tractable. Under EUM, one arrives not at the nice CAPM, but at general Arrow-Debreu style equilibrium models, which are hard to handle, and not particularly insightful.
Summary
So, to summarise, the logical structure of the CAPM is something like this:
- For some reason (EUM and elliptic asset distribution, or EUM and quadratic utility, or monotony & variance aversion) all investors have m-v-preference.
- By assumption, we achieve equilibrium, so all investors hold m-v-efficient portfolios.
- Then the market portfolio is m-v-efficient, by convexity of m-v-efficient portfolios (mathematics A,)
- Thus (by mathematics B, property of m-v-efficient portfolios) follows (MC): the expected excess return of any portfolio is its market beta times a constant (namely the expected excess return of the market portfolio)
But, all that is required for the main conclusion of the CAPM to hold is that the market portfolio is m-v-efficient (for whatever reason).
2013-02-20
Milestone: 100 countries
Today, I achieved one of my life sub-goals: Traveling to 100 countries (including the one I was born, which one cannot really categorise as "travel", strictly speaking). I'm using a generous count, in which e. g. China, Taiwan, Hong Kong, Macao, USA, Puerto Rico, Guam, Northern Mariana Islands count as 8 countries (specifically, using the list by the Traveler's Century Club, which incidentally I can now join). Using a strict count (in which for example the territories listed above count as only 2 countries), it's been 80.
Here's a list (with countries falling by the wayside using the stricter count in parentheses):
- Argentina
- Australia
- Austria
- (Balearic Islands (Spain))
- Belgium
- Belize
- Bolivia
- Brazil
- Brunei
- Bulgaria
- Burma (Republic of the Union of Myanmar)
- Cambodia
- Canada
- (Canary Islands (Spain))
- Chile
- China
- (China, Republic of (Taiwan))
- Cook Islands
- (Corsica)
- Costa Rica
- Cuba
- Czech Republic
- Denmark
- Dubai, United Arab Emirates (UAE)
- Ecuador
- Egypt
- England (UK)
- Estonia, Republic of
- Fiji
- Finland, Republic of
- France
- (Galapagos Island)
- Germany, Federal Republic of
- (Guam (US Territory))
- Guatemala
- Honduras
- (Hong Kong)
- Hungary
- India
- Iran, Islamic Republic of
- Ireland (Eire)
- (Ireland (Ulster, UK))
- Italy
- Japan
- (Java (Indonesia))
- (Jersey (UK))
- Kenya
- (Korea, Democratic People’s Republic of (North Korea))
- Korea, Republic of (South Korea)
- Lao People's Democratic Republic (Laos)
- (Lesser Sunda Islands (Indonesia))
- Luxembourg
- (Macao)
- Malawi
- Malaysia
- Mauritius
- Mexico
- Micronesia, Federated States of
- Mongolia
- Morocco
- Namibia
- Nepal
- Netherlands
- New Zealand
- Nicaragua
- (Northern Mariana Island, Commonwealth of)
- Palau
- Paraguay
- Philippines
- Poland
- Portugal
- (Puerto Rico)
- Qatar
- Romania
- Russian Federation
- Rwanda
- (Sabah (Malaysia))
- (Sarawak (Malaysia))
- Saudi Arabia
- (Scotland (UK))
- Singapore
- Slovakia
- South Africa
- Spain
- Sumatra (Indonesia)
- Switzerland
- Tanzania, United Republic of
- Thailand
- Tunisia
- (Turkey (Asia))
- Turkey (Europe)
- Uganda
- Ukraine
- United States
- Uruguay
- Vatican (Holy See)
- Vietnam
- Zambia
- (Zanzibar (Tanzania))
- Zimbabwe
2012-06-25
In Borneo
Just arrived in Kota Kinabalu (Sabah). On my way to Brunei now, then to Sarawak, and back. Photos later!
Fab
2010-02-13
Palau: Water
We went scuba diving in Palau: Daniel, Alma, Marco, Fab, Abda, Deb, Max, Jim.
Palau is a marvelous group of islands in the North Pacific, between the Philippines and Guam. The diving is outstanding, and the natural beauty of the place just adds to the experience. Here are just some of the things we saw:
Turtles
Nemo
Sharks (reef and white tip, I believe). We did a couple of drift dives (i.e., with fairly strong current, where the boat drops you at one end, you just control your buoyancy and let yourself float, and then the boat picks you up at the other end) - one glides over this alien landscape like superman. Very entertaining.
And then, for the sharks, we used reef hooks: a rope that you clip into your dive gear (the BCD) on one end, and hook into the reef on the other end. Then, one just hangs in there while the current flows past. We did this at a drop, where the current came from the deep, and presumably brought up lots of tasty fish food, so lots of fish were there, and that in turn attracts sharks. So, we were just floating there, mesmerized, watching sharks swimming back and forth like on a massive IMAX 3D screen, except that it was even better, because it was in fact real just in front of our eyes. In 3D. Awesome.
Coral.
There is also some wreck diving. Here's a gun, somewhere else we saw some old bottles of rum (or so, the label wasn't legible…)
Cuttlefish. It does change colours.
Caves.
Crazy divers.
Air bubble rings, or whatever you call them.
Awesome sunsets on the way back from the dive sites. That was Palau under and on the water.
2010-02-12
Palau: Land
There's also plenty to do for non-divers. Some of us did a tour inland:
A traditional men's house. Here's the front of it:
Looks like they're mostly discussing seafood. Or so. (Incidentally, Palau has traditionally been a matrilineal society.
The new Capitol building in the capital, "Melekeok", on the charmingly named largest island of Palau: Babeldaob. The whole country has just a bit over 20 000 inhabitants, and an area of 450 km^2, which is less than half that of Hong Kong (including Kowloon and New Territories - HK island itself is just 80 km^2).
Palau was briefly a German colony from 1899 to 1914 (as part of Deutsch-Neuguinea). (Note: Qingdao on the Chinese coast was a German colony during pretty much the same time, and still has the biggest brewery (Tsingtao) in China… ). Anyways, then it came under Japanese control, then during WW II under American, later UN control, and became independent 1994.
This is a Japanese plane wreck from World War II on the beach (visible are the upper part of the propeller and the radial engine). I used the propeller to crack open a coconut. Not easy.
Beautiful beaches. Really.
Sunset. That was Palau: Land.
2010-02-11
Palau: Air
And finally, a few pictures from the air (I took a helicopter ride). Here the natural arch in the Rock Islands, Palau.
More of the rock islands:
Honeymoon beach from above:
Honeymoon beach from below:
German channel:
Beaches:
This is the amazing jellyfish lake. You can see the jellyfish concentrated in the upper right corner of the lake (the slightly yellow tinge); apparently they migrate from east to west of the lake every day. The larger dots are people snorkeling and swimming towards the jellyfish (scuba diving is prohibited, one reason being that the lower layers of the lake contain poisonous gas that can be absorbed through the skin…)
The jellyfish, in the absence of predators, have evolved not to sting (or rather, their sting is not really dangerous or noticeable). It is quite bizarre to float through them. They feel nice and squishy.
More islands and beaches:
The helicopter pilot did a low pass through this "valley". Very remarkable (the passenger in the back seat screamed). It is reminiscent of the landscape in Avatar.
We saw a manta ray from the helicopter.
Here is another remarkable sight: the Milky Way Lagoon. A beautiful small cove with a bottom of white clay/mud, apparently created by snails feeding on limestone.
The water has an amazing color, and it's fun to smear the mud all over yourself (also supposed to be good for your health and your skin...)
This was Palau. Awesome diving and snorkeling and boating and flying. Wonderful holiday.