Showing posts with label Note in passing. Show all posts
Showing posts with label Note in passing. Show all posts

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

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)

E[ r(p) ] = r0 + beta(p) * ( E[ rm ] - r0 )

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: CAPM: beta(p) = cov( p, m ) / var( m ) = rho( p, m ) * sigma( p ) / sigma( m )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:

  1. For some reason (EUM and elliptic asset distribution, or EUM and quadratic utility, or monotony & variance aversion) all investors have m-v-preference.
  2. By assumption, we achieve equilibrium, so all investors hold m-v-efficient portfolios.
  3. Then the market portfolio is m-v-efficient, by convexity of m-v-efficient portfolios (mathematics A,)
  4. 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).

2009-05-13

Taxes, Sailing, and some edifying links

Just finished my Hong Kong tax return in under 18 minutes. You copy over a few numbers from your pay slip, apply a few deductions, and that's it. The top tax rate for salary tax in HK is 15% this year (last year it was 16%, but hey, the government made too much money, so they just returned everyone half of the tax they had collected (subject to a cap)). No taxes on capital gains, interest, etc. Can't complain, really.

(US citizens and green card holders pay US taxes, of course... (unless they're lucky enough to be dual citizens, and reside outside the US). And, if give up your US citizenship, or give up your green card (or the government rescinds your gree ncard!), you are subject to an exit tax of some 40% or so on your net wealth...)

On a different note, I've just completed sailing class (HKSF, level 1&2), that was a lot of fun. And great people, too. I'll carry on with it. The first two days the weather was awful, but the last two days it was brilliant. Mediterranean. Really nice.

Finally, a couple of good links (or, to be more precise, first two links to boring virtual presences representing good real places, then three links to good websites representing no real place):

Enoteca - my favourite restaurant in HK (well, it's just across the road, too, but the pizza and tapas are tasty, and the staff very friendly, and they have a good selection of wines open, as the name implies).

Chilli Fagara - Sichuan food. Spicy. Good for Western visitors (and me), in my opinion, in that it gets the spices and taste right (as far as I can tell), but has (what Westerners would consider) proper meat, rather than the mix of bones and skin and tendons that seem to be characteristic of authentic Sichuan food.

Kiva - Allows you extend a micro credit to a borrower in a developing country.

CouchSurfing - Allows a traveller to stay on someone else's couch, on a reciprocal basis.

Stickk - Allows you to enter a binding contract to help you fulfill a commitment to yourself, e. g. to lose weight, quit smoking, etc.

2008-04-25

My first computer :-)


Just found an old bill from the Vobis Data Computer GmbH: I bought my first computer, a wonderful Sinclair ZX81, on 11 Oct 1983 (when I was 11 years old). It cost 148 DM, or about 75 EUR.

It had 1 KB of RAM, a membrane keyboard, and a graphical resolution of 44 x 64 pixels. I computed Mandelbrot sets on it (Apfelmännchen) - it would plot one pixel every few seconds. The CPU (a Zilog Z80 running at 3.25 MHz) had to render the screen, and there was a FAST mode that would disable screen rendering and run computations 4 times as fast. Storage was on a MC tape recorder.

The 16KB RAM extension cost 85 DM. The MacBook Pro I'm writing this on, 25 years later, has about 125000 times as much RAM (a compound growth rate of about 47% p.a. - remarkably close to Moore's law!).

2007-09-14

Back in HK

Monday had Thai/Malaysian food and then drinks in LKF with Ling and a couch surfer, including some fun live music by a South African band.
Tuesday, I finally met Neil - we had been playing telephone ping-pong for a while. We ended up in the Gecko just under the escalator - great live jazz, really enjoyable, and this rather unique Irish Whiskey, Connemara. It's peated (that is, the malt is dried over a peat (Torf) fire), and as such somewhat of a hybrid between Irish and Scotch. Now, I'm a big fan of pure pot still (that's what a year in Ireland does to you), but this Connemara is really rather intriguing. (Ironically, the only distillery in Ireland that produces "Scotch" type Whiskey is the only one that's actually Irish owned. Go figure.) A very pleasant evening. Wednesday went to the grand opening of Q bar in LKF with Paul - swish club, then pizza close to home.
Thursday some random hedge fund function in the Dragon-I ("Overrated, bad drinks and lots of people with attitude (bankers and too-skinny models)" - indeed. The next quote captures the spirit of the place perfectly - I think the irony is not intended: "People always say they don't like Dragon-I and that it's superficial and full of vapid people, but I always seem to have fun there!"). Then, however, great simple dinner with Ling and Neil in the Enoteca. To top it off, we had a quick drink at home: some Calvados and some 1994 Middleton Very Rare - now we're talking pot still (mostly). And from there, it went all downhill... :-)

Notes in passing:
  1. One hour after I landed in Paris CDG recently, I was still at the luggage belt waiting for my, well, luggage. One hour after I landed in HKG on Sunday, I was at home (with my luggage).
    To get home, I had taken the Airport Express (around EUR 10) and then a cab (around EUR 2).

  2. In the week since arriving from the airport, doing all of the above and working full time, I haven't had to use any form of transport at all (except walking and the escalator). No cars, busses, nothing. It's all just around the corner. Another reason I like HK.



Friday, then, was dedicated to work and sleep. Saturday a junk trip with some colleagues (including my excellent ex-colleague Philip) and friends. Visibility was rather bad, but jumping from the boat and (attempts at) wakeboarding were great fun nevertheless. Afterwards with Ling to the FCC ball - black tie, cocktails, dinner, and fantastic live music with Sérgio Mendes . He played his classic hits, and some newer stuff ("Bossa-Hop"). The keyboard did collapse on his knees at one point, and lamentably he walked out during the encore, leaving the (great) band to finish the song. 5am the guys had to catch a plane back. A fun night. Then to Hardys in LKF, where Ling's uncle Rudy performed on stage. And from there, it went all downhill... :-)

2007-08-29

Qingdao (青岛)

Last weekend I was in Qīngdǎo (青岛, "green island" - very original. Note that while it's reasonably green, it (like man) is no island) in Shāndōng province (山东, "Mountain East").

In 1897, two German missionaries were hacked to pieces in Shāndōng. So, Kaiser Wilhelm II sent the German navy to occupy the area. Next year, the Chinese government leased the bay to Germany for 99 years (same year it leased Hong Kong to Britain for 99 years), but canceled the lease in 1914 (but not the HK lease).

So, anyway, the area was under German administration for some 15 years, and, needless to say, has since been home to China's largest brewery, Tsingtao Brewery (very original), which, incidentally, held the Qingdao International Beer Festival in Qingdao that very weekend I happened to be there with my good friend Ling to study Mandarin.

Here, I'm practicing how to order a beverage in Mandarin (普通话):

Here, I'm practicing how to consume a beverage in China:

They had quite a number of huge beer tents there, Paulaner, Weihenstephaner, Erdinger, with wooden benches, beer, barbecue, and a stage with singers and entertainers of dubious quality - just like the Oktoberfest. Of course, they also provided equally attractive non-alcoholic beverages (EANABs) for teetotalers, such as Bud Light. (Note: EANAB is not a term I made up. Every year the Stanford German Student Association organizes an Oktoberfest. When submitting the 3 or 4 party application forms one has to submit in Stanford to have a party, we have to agree to provide EANABS (that is, not just water or Bud Light, but juice, smoothies, et cetera. For the excruciating details, see this "party" planning document, appropriately hosted by Stanford's risk management department. Another note, while we're at it: We also organized an annual "Feuerzangenbowle" in December. We'd watch the movie (a fun old film with Heinz Rühmann), and prepare and drink the eponymous traditional Christmas drink. Until, well, one year the administration realized that the Feuerzangenbowle is an alcoholic (!!) drink. Now, there is a guideline that events at Stanford may not be promoted with alcohol, and in particular not contain references to alcohol in the title. So, we had to rename our traditional Feuerzangenbowle where we watched "Feuerzangenbowle" and drank Feuerzangenbowle from "Feuerzangenbowle" to "Traditional German Pre-Christmas Movie Evening" or something like that. Land of the free.)

I wasn't sure what food I'd get here (note the 2nd picture):
so I bought a lamb (I hope) kebab with wonderful cumin from this very funny guy instead.


Next to all the beer tents there was a fun fair, and they had the "Ranger" there, which I fondly remember from the annual autumn fun fair in Moers, Germany, years ago. It got stuck occasionally up-side-down. This one here did, in fact, display warning signs in stern German.


Next day, we braved some more dangers,

including

  • an incredibly hot (as in spicy) Sichuan (四川) dinner. (Note: surely no accident that the language of England has no word for hot (as in spicy), and has to resort to "hot" (as in warm) instead to describe the somewhat similar sensation). Anyway, this food was seriously hot; in fact, I experienced the tingling numbness in my mouth caused by Sichuan pepper (the "ma" in málà (麻辣)). (The dish was called "Kung Fu Beef".) All Sichuan food I had previously eaten (in the USA, HK, and mainland China itself) was just a weak knockoff. Fun Fun. Another Sichuan food experience.

  • an evening in a Karaoke Bar. Not necessarily my cup of tea - nothing against Black Label with Green Tea, but this whole singing thing is not my thing.

  • Some sailing the next day. The 2008 Olympic Sailing Regatta will be held in Qingdao. So, we rented a 6m boat from a local club, and went out for two hours with Teddy, the lovely Bulgarian from the club, and Xiaoqin, the Chinese instructor. A good morning. It was relaxing and peaceful, and we were tempted to jump in the water for some swimming, but then saw some huge jellyfish. Not so appetizing.

  • Oh, and we also missed our initial flight with Dragonair to Qingdao Friday morning, as we were both out late on Thursday evening. So, survived a flight with China Eastern instead.


Beethoven.


One more thing: Ling speaks Cantonese very well, but Mandarin less so (he grew up in England). Now, when the cab drivers talked to us and realized that there were a few select phrases I (foreign devil) could utter (after lots of practice), while Ling spoke freely, but hesitantly with a Cantonese accent, they'd berate him without end how on earth it was possible that my Mandarin was better than his. Very entertaining, and certainly gave my study motivation a boost :-)

2007-06-12

When I have a question, I ask the bears.

I have arranged this charming set of figurines in my office cubicle (ok, it's not a cubicle, it's "the floor"). The scene is an allegory on War and Peace.

Anyway, when I have a question, I ask them. Often, by the time I've described the problem, it has vanished. Otherwise, I ask my excellent colleague Philip.

Next weekend I am in Korea.

2006-12-25

What every man ought to do

So, I finally succumbed and did what every man does in his life (except quiche-eaters): Get a remote-controlled helicopter.

It really is rather difficult to get the hang of it - helicopters are inherently unstable (while fixed wing aircraft are mostly inherently stable). The salesman demonstrated it to me briefly, and flew and controlled it effortlessly - I dare say he had practiced quite a bit. I've crashed it several times already, but so far it survives (I've fractured a few blades, but it does come with spares). Great fun.

In case you're interested: It has two rotors rotating in opposite directions (hence rendering unnecessary the tail rotor, which has to counteract the torque generated in a conventional helicopter with one main rotor (the Sikorsky Layout)). The remote control has 4 channels: You control altitude (up/down) and yaw (turn left/right) with the left stick, and pitch (forward/back) and roll (move left/right) with the right stick. So, the left stick combines collective and anti-torque control, while the right stick corresponds to the cyclic control. It's harder than it sounds...

Oh, and merry Christmas!
Or, as quiche eaters say (no offence, Achim):
Please accept with no obligation, implied or implicit, my best wishes for an environmentally conscious, socially responsible, low stress, non-addictive, gender neutral, celebration of the winter solstice holiday(tm), practiced within the most enjoyable traditions of the religious persuasion of your choice, or secular practices of your choice, with respect for the religious/secular persuasions and/or traditions of others, or their choice not to practice religious or secular traditions at all.

Furthermore, I wish you a fiscally successful, personally fulfilling, and medically uncomplicated recognition of the onset of the generally accepted calendar year 2007, but not without due respect for the calendars of choice of other cultures and without regard to the race, creed, colour, age, physical ability, religious faith, choice of computer platform, or sexual orientation of the wishes.

By accepting this greeting, you are accepting these terms:
This greeting is subject to clarification or withdrawal. It is freely transferable with no alteration to the original greeting. It implies no promise by the wisher to actually implement any of the wishes for her/himself or others, and is void where prohibited by law, and is revocable at the sole discretion of the wisher. This wish is warranted to perform as expected within the usual application of good tidings for a period of one year, or until the issuance of a subsequent holiday greeting, whichever comes first, and warranty is limited to replacement of this wish or issuance of a new wish at the sole discretion of the wisher.

2004-10-20

Land of Big Sheep

In Mandarin Chinese, America is called "美国", land of beauty, while Germany is "德国", land of virtue. Now, these names are flattering at first; but then, "美“, beauty, is pronounced měi as in America, and "德" is as in Deutschland. The suspicion that these names are phonetic rather than meaningful is driven home by the fact that the translation of "France" is "法国", land of law/order (Fǎguó), and of "England" "英国", land of heros (Yīngguó).

Other nice phonetic names are "意大利" (Yīdàlì) for Italy and "加拿大" (Jiānádà) for Canada.

Intriguingly, the character for beauty, "美", is composed of "羊", meaning sheep, and "大", big, so (at least at some point in Chinese History), big + sheep = beautiful.

Hence one could argue that in Chinese, America is the land of big sheep.