Showing posts with label economy. Show all posts
Showing posts with label economy. Show all posts

Wednesday, November 09, 2011

6.66%, the number of the Italian 10-year bond yield



Story thus far:

Fundamentals:
- Italy amassed public debt 120% of GDP
- Berlusconi focused on organizing bunga bunga parties
- Feeble attempts to balance the budget were met with mass demonstrations and political opposition

Market mechanics:
- MF global went bankrupt because their Italian bonds lost too much in mark-to-market value (value, which someone is ready to pay if they sold the Italian bonds now on market). MF used criminal ways and took reckless risks, so without Italian bonds they would have eventually found another tree to hang themselves.
- Jefferies, a financial firm, was suspected to be fatally exposed to Italian bonds. They disclosed information about their Italian bond ownership and also sold them. They turned out fine.
- Fire sales of Italian bonds to avoid scrutiny. Nominal Italian bond yield explodes. At least temporarily, yields are past the point of no return, after which savings and cuts no longer solve the problem, as interest accumulates too fast.

Rejected solutions:
- Italy balances budget - if they could, they would have already done that
- EFSF: European countries just don't have enough money to bail out Italy while staying solvent

Next steps:
- ECB prints money and causes high inflation
OR
- Eurozone turns into nineties depression historical re-enactment society
OR
- Italy converts debt to liras and devaluates

Monday, September 12, 2011

Too lazy to work, too chicken to steal

Summary: This post tells a formula for deciding when to quit your day job.



First we define Enough money. It is the monthly sum, which allows you to buy most things you want, so that not working increases your standard of living more than extra income from your day job.

Mortgage is such a huge factor that we exclude it from Enough and account it separately as Debt Costs. It covers both interest and repayments.

Secondly, we assume that investments are the basis of your new income. Investing is the only way to pay once and get money back for the rest of your life with minimal effort, either as dividends, interest or rent. Historically 4% withdrawal rate has proven robust. Even after you spend 4% each year, your pot still grows enough to resist inflation. We also assume 25% tax rate, which is the average of dividend and capital gains tax rates.

You can quit your day job when:
Debt Costs + Savings / 12 * 0.75 * 0.04 + Side Income >= Enough
Debt Costs + Savings / 400 + Side Income >= Enough

Notes about the formula:
  • You need to own 400 euros to get 1 euro of monthy income. 400 comes from multiplying the constant factors. Only with compound interest and lots of waiting is it realistic to get these kinds of multipliers.
  • To get there quickly, you need side income schemes. For example €100 of monthly ad income from a blog corresponds to €40000 of savings. While writing interesting content is hard, it is probably easier than to save €10000/year for 4 years.
  • Side income schemes also provide cover, if you have to explain, what you did for the past few years.
  • Cheaper apartment speeds up the plan by years. There can be €100000 difference in apartment prices between Helsinki and Oulu city centers. If you value big city life, you probably prefer working to idle life in Oulu. Debt Costs depends very much on your lifestyle.
  • If you are near retiring, you can withdraw more. Multiply your monthly pension by 400 to see how much less you need to own at retirement.
  • If side income raises the sum past Enough, you should save the difference to gradually phase out the necessity of side income schemes. Otherwise, you either are not lazy enough for this plan, or have set Enough sum too low.
  • Enough sum raises with inflation.

Wednesday, August 24, 2011

Still haven't bought any stock

Summary: This post tells a formula for deciding if you should postpone purchases in times of a looming crisis.

Update: Added a paragraph on probabilities.

After I finished reading Saarion sijoituskirja, the Arvopaperi OMXH index showed that Finnish stock prices had moved -10% since 1.1.2011. I postponed purchasing stocks because of the following calculation. It had two scenarios:

(1) Greece crisis becomes acute with probability P(crisis).
(2) Orderly recovery happens with probability P(recovery) = 1 - P(crisis).

Let the change in stock prices be C(crisis) or C(recovery). We should postpone purchases if

P(crisis) * C(crisis) + P(recovery) * C(recovery) < 0

When Lehman Brothers collapsed, the prices decreased by 40%. Let C(crisis) = -40%. By contrast C(recovery) = 10% - 20% since recovery is usually slower.

Avoiding probability estimates


We can pick stock price changes from historical data. Regarding probabilities, let's look at the equation at 0 when it doesn't matter whether we postpone investment or not.

P(crisis) * C(crisis) + (1 - P(crisis)) * C(recovery) = 0
P(crisis) * C(crisis) + C(recovery) - P(crisis) * C(recovery) = 0
P(crisis) ( C(crisis) - C(recovery) ) = - C(recovery)
P(crisis) = C(recovery) / (C(recovery) - C(crisis))

With C(recovery) = 15% and C(crisis) = -40%, the equation gives P(crisis)= 15% / 55% = 27%. This means that we should postpone investment, if we estimate that P(crisis) > 27%. We should invest now if we estimate that P(crisis) < 27%. It doesn't matter if we invest or not if we estimate that P(crisis) = 27%.

How it turned out


What in fact happened was that Greek crisis materialized but it was an orderly restructuring and prices collapsed only by 20%. The debt and the budget deficit are still simmering.

The situation now is almost the same, but the 'risk scenario' is 2008-style banking crisis. Only this time, goverments are part of the problem and no longer part of the solution. I'm still postponing investment.

If stock prices recover from current -30% to -10% in the next 3 months, then I suck at predicting and am better off investing to index funds. Stock traders divide profit to 'alpha' and 'beta'. 'beta' is the profit from market. You get beta profit from index funds, because stock prices on average rise with economic growth. 'Alpha' is the profit from skill. It is negative if you suck at predicting. Finding your own alpha by making successful and failed predictions is called alpha discovery.

Sunday, August 07, 2011

S&P lowers US credit rating



Now Kaalimato has higher credit rating than US.

Sunday, May 29, 2011


Summary: This post compares stock investing to mortgage.

This week I've been reading Saarion Sijoituskirja and considering investing into stock market.

First some background. I can't buy a house now for two reasons. Firstly, I expect to be laid off during the next year into a tight job market filled with 1500 Symbian programmers from Nokia and a comparable amount from subcontractors. This may mean a move to another city or country, creating a "push factor" away from Tampere. Secondly, there is a "pull factor" as my two siblings have recently moved to Helsinki.

My first lesson in investing


In September 2008, HEX index had collapsed 35%. I was going to an offshore assignment. I decided to buy stocks when they are cheap and moved a small apartment nest egg to a stock fund. The next week Lehman Brothers crashed, wiping away 40% of my nest egg.

I concluded that stocks are too volatile way to invest a nest egg, no matter how great average ROI they offer in 20-year timeframe.

In the hindsight, I made the right move for the right reasons, and the nest egg has recovered most of the melted value. Only timing was wrong: I should have spaced the purchases in 6 month intervals instead of trying to guess when the downturn is at the bottom.

Comparing stocks and mortgage


The biggest revealation I've learned from the book is emphasis on dividends. In the long run, the value of the stock is the time-discounted sum of dividends (price is something completely different). Companies pay on average around 5% of their share price in dividends. Dividend perspective also catches growth companies; they typically pay increasing dividends each year. This changes the picture in the following ways:
  • You don't have to sell the stocks to use them to pay mortgage. Instead, you can use dividends for mortgage payments. Typically you want to buy a house during downturn and sell stocks during boom. Dividends can bridge the time gap.

  • Temporary nest egg wipeout is not catastrophical. Debt-free companies continue paying dividends. Others resume after recession. Prices recover. In fact, selling stocks is strictly optional for a long-term buy-and-hold investor who is in for dividends and mortgage-length (20-30 years) timeframe. Of course, it is great for your wealth if you can sell high and buy cheap, outsmarting seasoned professionals, but don't count on it.

  • Both houses and stocks "pay dividends" and "increase in value". In house, the 'dividends' come from lower living costs. Value increases typically in pace with inflation, at good locations faster. Statistically stocks produce a little more in the long run; then again, in the long run we are all dead.

Additional factors attracting me to stock gambling are:
  • They have cute little numbers you can play with. Simple back-of-the-envelope calculations are a second nature to me. I do them almost instinctively. For example I "annualize" all costs by estimating, say, how many times a month I eat out and what is the cost per meal and how large % of monthly income goes to eating out.
  • It is a game of skill and luck. It is possible to raise your net worth faster than the statistical stock market average. For example for J it gives good profit per hours spent researching. Then again, J can invest in companies he has visited in his water engineering projects. I don't visit customer companies. It is unclear if there is any game of skill for me. The only way to find out is to try.
  • It is more leniently taxed than salary income. For dividends, 70% of dividend income is capital income for which you pay capital gains tax. The final tax is 20% of dividend's value. This is less than half my marginal tax rate on salary (if I would get 100e more salary, the tax man would take over 40e). Now you may say that there is double taxation on dividend income: the company paid taxes and you pay taxes. However, there are also side costs for employing people. As a rule of thumb, salary + side costs = 1.6 * salary. The 26% corporate tax is smaller than side cost percentage.
  • It makes you a better writer and person. Both J and Mangan invest, and their investment posts are consistently high quality: betting money on being right makes you consider your opinions. Investors have personal interest to know what happens in the world as it impacts their lives.


Money is a huge taboo, for example not a single person has ever told me his monthly salary. Outside immediate family, only two persons have ever admitted owning stocks. I am aware that writing about money is not necessarily wise in Finland, will be careful about not disclosing anything, and will stop as soon as I start to notice strange remarks in face-to-face discussions.

Sunday, June 20, 2010

Nokia, the next Geoworks?

Summary: Nokia gave a profit warning, because their high-end phones do not sell well. This post compares the problems of Symbian, Nokia's high-end phone OS, to Steve Yegge's analysis of why Geoworks went bankrupt.



What Geoworks?

Geoworks was a software company which wrote a windowing system and applications in assembler. In the end, it went bankrupt in the end of nineties. When Steve Yegge wrote about the benefits of high-level languages, he used Geoworks as an example how using low-level languages takes a toll on business.

His argument is that low-level languages make optimization impossible and implementing features slow. After the system reaches a critical point in complexity, usability starts to suffer. User see sluggishness, bugs and lack of features.


...But it's because we wrote fifteen million lines of 8086 assembly language. We had really good tools, world class tools: trust me, you need 'em. But at some point, man...

The problem is, picture an ant walking across your garage floor, trying to make a straight line of it. It ain't gonna make a straight line. And you know this because you have perspective. You can see the ant walking around, going hee hee hee, look at him locally optimize for that rock, and now he's going off this way, right?

This is what we were, when we were writing this giant assembly-language system. Because what happened was, Microsoft eventually released a platform for mobile devices that was much faster than ours. OK? And I started going in with my debugger, going, what? What is up with this? This rendering is just really slow, it's like sluggish, you know. And I went in and found out that some title bar was getting rendered 140 times every time you refreshed the screen. It wasn't just the title bar. Everything was getting called multiple times.

Because we couldn't see how the system worked anymore!


Which is higher-level language, C or C++?

One benchmark of language level is how many lines of code are needed to implement a feature. In high-level languages, the compiler does more work. The programmer has to write less code. This means that implementation is faster. There are also less bugs, since the lines of code which were not needed don't contain bugs, and because debugging is easier in small haystack.

C language is infamous for being low-level. Therefore it's paradoxical that Symbian Open C is a advertised as a productivity tool. But sadly it really is a productivity tool compared to Symbian C++.

The examples below demonstrate why. The snippets below read a configuration variable from a file. The scenario is that we want to run automatic system tests on a communication protocol and to automate the selection of an access point. It is stored in format "accesspoint=Winsock". The important thing here is the length of the listing, not the exact content.



// Read a configuation variable with 35 lines of code.
_LIT8(KAccessPointId, "accesspoint=");
TBool ReadAccessPointNameL(const TDesC& aFileName, TDes& aResult)
{
RFs fs; // File session
RFile file; // File handle
TBool apNameFound = EFalse;

// Connect to file server
User::LeaveIfError(fs.Connect());
CleanupClosePushL(fs);

// Open file for reading
if (file.Open(fs, aFileName, EFileWrite) == KErrNone)
{
CleanupClosePushL(file);
// Read the file to memory (we can't use line-by-line
// reading with TTextFile, since it can't handle 8-bit text)
TInt size = 0;
User::LeaveIfError(file.Size(size);
HBufC8* content = HBufC8::NewLC(size);
User::LeaveIfError(file.Read(content->Des());

// Find the start and end of the access point name.
TInt start = content.Find(KAccessPointId());
if (start > KErrNotFound)
{
start = start + KAccessPointId.Length();
TInt end = start;

// Find the next newline.
do {
end++
} while(end < content.Length() &&
(*content)[end] != '\r' &&
(*content)[end] != '\n');
}

// Save the result.
aResult.Copy(content.Mid(start, end - start));
apNameFound = ETrue;
}

CleanupStack::PopAndDestroy(content);
CleanupStack::PopAndDestroy(&file);
}

CleanupStack::PopAndDestroy(&fs);
return apNameFound;
}



The same in C:



// Read a configuation variable with 20 lines of code.
const char* access_point_id = "accesspoint=";
char* read_access_point_name(const char* file_name)
{
char* result = NULL;
// Open file for reading.
FILE* file = fopen(file_name, "r");
if (file) {
char line[200];

// Read line by line and search for access point variable.
while(!result && fgets(file, line, 200)) {
if (strstr(line, access_point_id) == line) {

// Remove newline.
int len = strlen(line);
while (line[len - 1] == '\r' || line[len - 1] == '\n') {
line[len--] = 0;
}

// Get the value of the variable.
reuslt = strdup(line + strlen(access_point_id);
}
}
fclose(file);
}
return result;
}



Symbian C++ was written before people really knew how to do object-oriented programing. They completely botched all the APIs. The horrible descriptors were designed to counter memory overflows, which C functions don't check. Nowadays they just clutter the code. Symbian takes pride in being a microkernel OS, so they require the programmer to connect to servers to start sessions. This adds further lines. The exception handling with cleanup stacks vomits more useless lines. And if you think this is ugly, you haven't seen anything, like the use of active objects in the socket interface.

One C++ selling point is the syntax for classes. Well, Symbian has a 68-page coding convetions which gives very explicit rules how to name classes and which functions they should at least have. This nitpicking makes classes heavy structures, and decimates any advantage from syntactic sugar. Virtual functions are the only part of C++ which wasn't assaulted. Even templates were banned as too error-prone.

So Posix C really is a higher-level language. Just for comparison, here is the same in Ruby.



# Read a configuration variable in 9 lines of code.
def readAccessPointName(fileName)
file = File.open(fileName, "r")
file.each_line do |line|
if (line =~ /accesspoint=(.*)/)
# The (.*) in regular expression caught
# the access point name to $1.
return $1.chomp
end
end
raise 'No access point name in file ' + fileName
end



So it is unsurprising that App store contains 225000 appplicaitons while Ovi store contains just thousands.


GeoWorks attempted to get third party developers but was unable to get much support due to expense of the developer kit — which ran $1,000 just for the manuals — and the difficult programming environment, which required a second PC networked via serial port in order to run the debugger. (source)


But it's the user experience that counts...

Symbian phones are famous for having equal features but lower usability than iPhone. To demonstrate how difficult programming is visible in usability, I'll tell you about usging the file browser to read log files. The plain text viewer has several defects. If you open a large log, it announces out of memory error and shuts down. It underlines randomly some content which it thinks might be a link. It can't choose a small font to show lots of content, so you only see a few lines at a time. Luckily, there has been some progress in plain text viewer. Earlier, it used to crash with medium-sized files. Now it either shows it or announces error.

The way I see it, these defects reflect the difficulty of the programming platform. Usually programmers have some professional pride, which makes them fix errors and usability defects with time. What could be stopping it? We can only speculate.
  • Customizing the UI component which shows text would require too much work, since platform doesn't support dynamic loading and presentation.
  • Low level language necessitates big project sizes. This dilutes responsibility so that no one is responsible for the plain text viewer in the "buck stops here" sense.
  • There is a culture of fixing only showstopper bugs and leaving others there, since there isn't time to fix all bugs, as fixing a single bug is slow.

This way, we get "multimedia computers" which can't display plain text.

It doesn't have to be this way

Nokia does fine in low-end phones, which use the closed Series40 OS. Also the Maemo/Meego platform is promising, however the phone in N900 is still fresh software, creating issues in sound quality and usability. They haven't had time to finalize the phone. In compatibility with major desktop operating systems, Maemo's Linux kernel runs circles around Symbian. This will show up in usability sooner or later. You can always strip down the user interface to produce a simpler phone which is easier to use, but you can't put the solid Linux infrastructure to a Symbian phone.

In the long run, I'm optimistic about Nokia's future. Once they finalize the phone on Maemo and scrap the Symbian platform, they'll be fine. If you want to capitalize on this, the right time to buy Nokia shares is just before they start selling their next Meego phone. However, make sure that the press agrees that Meego has good phone, battery life and usability - if they botch them on Meego, they won't recover. However, I'm not putting my money where my mouth is, because I have enough economic Nokia risk in my life already.

Wednesday, May 12, 2010

Euromaiden hallitusten valinta

Kreikan tukitoimien arvioimiseksi pitää muistella, miksi euroalue luotiin. Euro tehtiin ison talousblokin vakaaksi valuutaksi, jotta investoijat olisivat valmiita lainaamaan matalammalla korolla. 5 miljoonan asukkaan Suomi on altis taloudelisille shokeille, kuten Venäjän kaupan romahdus, joka tuhosi 13% bruttokansantuotteesta. 300 miljoonan asukaan euroalue on vakaampi eritysesti, jos maat tukevat toisiaan poikkeustilanteissa. Myös valuuttariski poistuu, kun Suomi voi etsiä isolta alueelta lainoittajia, jotka lainaavat euroissa.

Valtion korkomenot jaettuna velalla. Lähde: Tilastokeskus.



Euron ansiosta Suomen valtionvelan korko on pudonnut n. 7%:stä n. 4%:iin. Vuonna 2009 Suomi maksoi 2.3 miljardia euroa valtion velan korkoja. Jos emme olisi euroalueella, valtion täytyisi verottaa vajaat 2 miljardia euroa enemmän.

Kreikan signalointiongelma


Jos muut euromaat eivät tue Kreikka yhtään, niin sijoittajat katsovat jatkossa pienten eurotalouksien olevan oman onnensa varassa. Tällöin Suomen velalle vaaditaan korkempaa korkoa vastineeksi korkeamasta riskistä. Tämä on huono lopputulos. (Mahdollisesta pankkikriisistä myöhemmin.)

Jos muut euromaat antavat Kreikalle kaiken ja katsovat säästöohjelmasta lipumista sormien läpi, niin särmien maiden rahoille riittää ottajia kunnes ne loppuvat. Tämäkin on huono lopputulos.

EMUn haaste on löytää keino signaloida sisäistä kuria ja ulkoista vakautta. Tällöin euromaat voivat jatkossakin nauttia ison valuutta-alueen vakauden suomista eduista joutumatta maksaman tolkutonta laskua muiden sikailuista. Ongelma on siinä, että jos-suhteiden signalointi on hankalaa, ja signalointi tulee uskottavaksi vasta pitkällä aikavälillä. EMU on uskottava, kun Kreikka on monen vuoden kuluttua leikannut alijäämänsä pois ja alkanut vähentää velkaansa. Se on uskottava myös, jos Kreikka laitetaan monen vuoden elvytysyritysten jälkeen velkasaneeraukseen toivottomana tapauksena. Joka tapauksessa ukottavuuden hankkimiseen menee vuosia.

Suurusluokka


Suomi on hyötynyt eurosta. Jo pelkästän matalammat valtion velan korot ovat maksaneet Kreikan lainasumman moninkertaisesti takaisin.

Toisaalta pelotellaan, että Kreikan velkasaaneerauksesta seuraisi pankkikriisi ja lama. Viime vuonna Suomen bruttokansantuote supistui laman takia 13 miljardia euroa. Tämäkin on paljon Kreikan lainaa suurempi summa.

Kreikan laina on vasta ensimmäinen näytös pitkässä gambiitissa, jossa testataan euromaiden kyky puhaltaa yhteen hiileen ja laittaa sikailijat ruotuun.