Discourse on Kenya Rebasing to Middle Income Status

Leonida Mutuku: Research Manager
Patrick Costello: Data Scientist
Christine Mahihu: Research Assistant
Chris Orwa : Executive Producer ;)
14860074544_42e0fb1bfa_zImage Courtesy of Jesse McKee


(iHub Coffee bar, everyone having a cup of their favourite stimulant)

Chris Orwa: Hey guys, check out this article

Christine Mahihu: Kenya will become middle-income state by September.

 Leonida Mutuku: Patrick, any thoughts on this rebasing?

 Patrick Costello: Sounds like a useful exercise although the move to middle income status will definitely mean changes for things like donor funding. Should create benefits such as attractiveness for foreign investment – you could measure this via relative impact on Kenyan government funding rate.Might take a few years to show up. Does change in status affect borrowing rates? Is there a pickup in rate of FDI with change in status? How much donor funding, subsidies etc actually gets lost in the move.

Christine Mahihu: I do know, Kenya lost access to funds when it moved from underdeveloped country to a developing country in terms of climate change project financing. We also lost access to the European carbon market. May not be directly related, but this move stalled major projects countrywide and forced involved organization to raise funds elsewhere, something that could also happen in other sectors if this change in status actually happens.

 I like Patrick’s highlight on the benefits of rebasing. The earlier analysis seems to concentrate more on the negative. I also wonder what path other countries took when they were faced with the same situation. I agree, this is a great opportunity to compare the positive and negative effects. With regards to the carbon market, the idea was to provide funding to developing and underdeveloped countries so that they can take a more ‘green’ approach in their path towards development. Unfortunately, China was the biggest beneficiary (and did not necessarily reduce emissions) causing the EU to rethink funding to developing countries, where both China and Kenya fall. The whole thing is big and complicated but no use getting into that.

 Patrick Costello: Hmmm, it’s interesting to note from that bit the rebasing only just squeezes Kenya over the middle income status at $1,036. I think you could make a pretty good argument to hold-off on cancelling donor aid/preferential treatment if cutting that aid pushed you immediately back to down poor country status, and that aid should only be stopped if removing the aid did not push a country back to poor income status.

 Also remember that the downside of loss of donor funding/world bank loans due to increased economic development should be offset by lower risk premiums on loans, hence cheaper loans from regular sources over the longer term. E.g as Kenya is seen to be more stable and a better investment hopefully Kenyan government credit rating goes up and government funding goes down which will lower Kenyan borrowing rates (as most debt will price at a spread to government debt). Will be interesting to see if this happening in practice, but should be easy to track. In fact it would be interesting to look at credit rating vs development status.

 In relation to carbon market access – I don’t think this is development related, rather an EU decision affecting eligibility of all CDM (Clean Development Mechanism) projects across the board post 2012. Not sure why they made it, there’s a pretty opaque description about wanting to develop some new migration scheme.

How Not to Innovate


You have a novelty idea that would take the world by storm, good! What do you do next? Get a couple of friends and begin to hacking it away. Soon you have a minimum-viable-product and ready to meet the market. Everything at this stage is experimental, the budget low and everyone who has anything to do with the product is a brand ambassador. Then lady luck strikes, product sells, gains market share and the idea transforms to a company. What’s wrong with the aforementioned scenario? Read it once again.

Steps taken to create a legal entity, formalize operations, attract investors and have an acceptable product actually inhibit innovation in a company. Chaos theory demands that innovation thrives at the edge of chaos’, an environment that balances the need for order and the pull of change. No one captures the essence of this balance better than Michael Crichton in his book ‘The Lost World’.

We imagine the edge of chaos as a place where there is enough innovation to keep a living system vibrant, and enough stability to keep it from collapsing into anarchy. It is a zone of conflict and upheaval, where the old and new are constantly at war. Finding the balance point must be a delicate matter-if a living system drifts too close, it risks falling over into incoherence and dissolution; but if the system moves too far away from the edge, it becomes rigid, frozen, and totalitarian. Both conditions lead to extinction. By implication, extinction is the inevitable result of too much change or too little.

Some people may refer to it as organized chaos or chaordic (chaos & order) arrangement, but the bottom line is, innovation requires a degree of randomness to flourish. A factor pushed away by introduction of business processes. Think about tech startup companies in beta phase, normally the companies would recruit volunteer beta testers and also solicit for reviews on product amiability as well as performance. Once revenue starts trickling in they no longer need your opinion.

Let’s get started with Klout, when Twitter was picking up momentum in 2010 Klout managed to convince everyone that their interactions amounted to a measurable level of influence. They had everyone’s attention, and what did they do with it? Ignore pertinent questions about their algorithms as they were busy working out an acquisition plan. But that’s not what irks me, several years later I would wake up to completely different dashboards quiet regularly, no notification, no invitation for beta testing, no nothing. Our mutual relation had ended; we were no longer partners in this innovation business.

This goes for Facebook too, at the formative stage Facebook had a link next to the ads where anyone would sign up to be a beta tester and suggest new features. An ecosystem that crowdsourced ideas but someone thought it was bad for business as it ate up advertisement space. When I get asked which common mistake most startups make, the most obvious one is they focus on product and fail to innovate on their processes.


Tracking An Entrepreneur: Kenya’s 80’s Millionaire

I love rhumba music, that’s how I stumbled on the website Congo in Kenya,  an impressive genealogy of Congolese musicians working in East Africa in the 70’s and 80’s.  But what captured my imagination was a photo (shown below) of a membership ticket to The Starlight Club in Milimani, by then a heaven for performing Congolese artists. To put it into context, in the 80’s, Milimani was (and still is) an upmarket neighborhood in Nairobi. Add that to the explosive nature of rhumba music in the 80’s and you have a millionaire in the form of the club owner.

So, I began the quest to know who owned the club and the story begins on 8th September 1980 when James Njau Njenga gets admitted to the Kenyan bar in Gazette Notice No. 3180. The young lad soon hit the ground running by using his registered P.O Box number 44450 (same as on the membership card) on 22 May 1981 to get a license for the bus number KMA 953 to ply Western, Nyanza, Nairobi, Coast, Eastern and North-Eastern and Rift-Valley provinces. It is in the same period that he must have gained ownership of the club after the demise of JM Kariuki who was the director of the establishment.

With the establishment under his arms, the young entrepreneur now had Kenya’s bright and influential mingling in the club including James Ngugi later changing his name to Ngugi wa Thiongo and Senior Barrack Obama. Practicing as an advocate of the high court (employment number P.105/1150/80 ), Mr. Njenga took home 150,000 Kshs, factoring inflation and the two known businesses he was definitely in the league of millionaires. In 1994, the curtains came down on the infamous Starlight Club as the Kenyan government through the Attorney General acquired the piece of land (LR 209/1069)  it sat and that’s where the magnificent Integrity House sits today.

However, the story doesn’t end there. Mr. Njau through a newly acquired post office number P.O Box 62097 setup a private practice at Shankardass House along Moi Avenue from where he fanned out his new “business empire”. First up is Thuo Investment Company Ltd, an entity dealing in buying and selling of land and estates. Next up is Afcon Ltd, a company providing resources, knowledge and expertise to the development of safe water to the people in East Africa. Mumbi Properties ltd LR 209/4283

Unfortunately, Mr. Njenga died on 17th September 1997 after  his vehicle registration number KAE 125P was hit by a truck belonging to Pelican Haulage Contractors Limited (registration number KXN041) along Langata Road. His wife, Phyllis Wangui Njau was awarded a compensation worth 5,031,760 Kshs on a ruling rendered on 14th December 2012  by Justice Manyanja and each of his 3 children got Kshs 2 million. Since then, two companies using his old P.O Box number 44450 have been registered namely; Bright Homes in Milimani and Pearl Banquets Ltd operating on Argwings Kodhek. Hope it is the entrepreneurial bug passed from father to child.


Afcon. (2013). Contact Us. Retrieved November 27, 2013, from Afcon Ltd: http://www.afconltd.co.ke/contact-us/

Johnston, A. (2013, November 19). Congo in Kenya. Retrieved November 27, 2013, from Congo in Kenya: http://muzikifan.com/shika.html

Kenya Law. (2012). In the Matter of the Estate of James Njenga Njau. Nairobi: Kenya Law.

Kenya, R. o. (1981). The Kenya Gazette. Nairobi: Republic of Kenya.

Republic of Kenya. (1980). The Kenya Gazette. Nairobi: Republic of Kenya.

Thuo Investment. (2013). Contact Us. Retrieved November 27, 2013, from Thuo Investment: http://www.thuoinvestments.com/index.php?option=com_contact&view=contact&id=1&Itemid=54

Rare Clouds Over Nairobi and Cairo

On the 8th day of January, 2014 the year of our lord, the Gods of Nairobi and Cairo  bequeathed the two cities with a similar and rare morning skyline.



Capturing Tweets with R

Its been a labor of love trying to capture tweets for analysis via R, for starters R is an open source statistical computing software and perhaps best in its league. Leveraging its prowess in analyzing textual data and in particular tweets is a thing to marvel at, so let’s get on how to setup R to capture and analyze tweets. First, register an app with Twitter, it’s pretty simple. Go to https://dev.twitter.com/ and create a new application, of course you have to have Twitter account, if that’s the case you should be seeing the page below.

Create An Application

Good, you are doing well. Key in the details, you can guess the website as well as the Callback URL, they aren’t important at the moment. Next, after successful creation of the app click on My Application and choose you app. This where it starts to get interesting, you should be able to view details of your app with the important facts being below the title OAuth SettingsFor my app, these are the details.

Access level Read-only

Consumer key 8mzRs9PySHKmTcvXBcy5w
Consumer secret ZKNBKniG4ADfyk3tHCWQsj0wowapFpXhqoj8O4OnQQ
Request token URL https://api.twitter.com/oauth/request_token
Authorize URL https://api.twitter.com/oauth/authorize
Access token URL https://api.twitter.com/oauth/access_token
Callback URL None
Sign in with Twitter No

Now you got the feeling you are doing something, time to fire up R. The twitteR package contains the functions for querying Twitter servers, you proceed on by downloading the package (install.packages(“twitteR”)) or if you already have it installed simply call it via require(twitteR) function. Some versions of the package miss the dependency packages ROauth and RCurl, if that’s the case you’ll have to download the packages independently (install.packages(ROauth) and install.packages(RCurl)). Proceed with providing the authentication details provided in your app, keep in my the ROauth package has the authentication function and if it isn’t working the process would halt. Use the code shown below:


That’s pretty much standard code, note the consumer key and consumer secret key should be the one provided for you app (I’m using mine). The next part is the tricky section and gave me some headache. After providing the credentials via the OAuthFactory$new() function a system handshake has to be initiated between you app and Twitter server. A handshake in computing is a prior communication between two systems that sets the rules of communication, in this case it is implemented by digital certificate (SSL certificates) sent from Twitter server acknowledging the app and setting type of information to be communicated. The straight and faster way to go round this is to first download the certificate with the R code:

download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile="cacert.pem")

Then proceed with the code below to initiate the handshake.


Success at this stage should request for a pin in a textual format, copy paste the URL.

To enable the connection, please direct your web browser to:


When complete, record the PIN given to you and provide it here:

This is what I got, punch back the PIN on the prompt in the above reply.

Ingokho PIN

We are almost there, next is to register the credentials, the function returns TRUE when all is well.


At this point I felt home is just a stone throw away only to be hit with the an error while trying to use the search Twitter function.

[1] "SSL certificate problem, verify that the CA cert is OK. Details:\nerror:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed"
Error in twInterfaceObj$doAPICall(cmd, params, "GET", ...) : 
  Error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

If this happened to you too do not worry I have the antidote. Set the SSL globally using the code below.


# Set SSL certs globally
options(RCurlOptions = list(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl")))

Horay!!! we’ve done it. Now we have the power to search, collect and analyze tweets. How about we do something interesting? Let’s download tweets from a trending topic and graph who are the highest contributors to the topic. Download and install the ggplot2 and plyr packages, using the searchTwitter() function in twitteR package I captured 1000 tweets from the trending topic #TvYa13Million and graphed it. Here is the code that did all the magic: [PS: I didn't exit my R sessions, this code is a continuation of the above]


TvTweets = searchTwitter("#TvYa13Million",n=1000)
users <- ldply(TvTweets,function(x) return(x$screenName))
ggplot(users,aes(x=V1))+geom_histogram()+theme(axis.text.x = element_text(angle = 45, hjust = 1))+ylab("Count of tweets using #TvYa13Million")+xlab("Twitter handle")

And there you go:TvYa13Million

Thank you for reading, you now have the power to capture tweets and everything pertaining to analysis.


The Unintended Consequence of Bonga Points

There is no doubt in our minds that bonga points like other loyalty programs is a novelty and contributes towards customer satisfaction and retention. The extent to which only affect micr0-economic factors of a company. However, when Safaricom made bonga points transferable to other subscribers and redeemable phones and computer accessories (elastic goods), they exposed the loyalty program to the law of unintended consequences  as the effects spilled over to the macro-economic stratum. Overnight, the demand of bonga points skyrocket and it becomes a luxury good as it attracts direct convertibility to hard cash.

Today, there is a ‘black market’ for bonga points in exchange for cash, the PMK page on Facebook runs competitions payable via bonga points. When used as a medium of exchange, it becomes a currency, a parallel currency much like Bitcoin.  Safaricom will now be facilitating a currency that the Central Bank of Kenya has no control over. If more people exchange  their Kenyan Shilling for bonga points, the demand of the shilling plummets and bonga points takes over as the dominant currency with Safaricom as our central bank. The question begs, what will Safaricom do with the high demand commodity they created.

Think of the possibilities if online stores decide to accept bonga points,  we have a new currency backed by the cost of making a call. Given the resources availed  to research and development of telecommunication equipment we can safely assume it will be a stable currency. And given the price volatility of elastic goods we expect the demand to fluctuate, the heck it can even be traded at the Nairobi Stock Exchange.

I now understand why Safaricom shutdown the bonga points exchange short code owned by Onfon Media, it would convert it into a financial institution with a dominant unregulated “currency”.  And as it stands, under Article 231 of the Kenyan constitution, the Central Bank of Kenya has the sole responsibility for issuing currency, formulating monetary policy and promoting price stability.

Breaking Safaricom Scratch Card Code

Almost two years ago, Safaricom Ltd extended the scratch card code from 12 digits to 16 in-order to increase the computational time required to break the code thereby making them more secure. However, system theory acknowledges that systems expose their weaknesses at points of change. I set to find out if the move to higher dimensionality introduced a weakness in the scratch card hidden reload number. To begin the analysis I formulated the following assumptions to guide me in the process.

  • The grouping of the hidden reload number into four digits does not reveal the mechanics of the number generator.
  • Increasing the hidden reload number by a factor of four digits provides more data for statistical analysis.
  • The hidden reload numbers are separated into groups of four digits only for the purposes of ease of reading.
  • The hidden reload number represents a 16 digit number generated by a random number generator.

With the assumptions in place I set to curate the data set, my collection of scratch cards came in handy (448 in number). In understanding each digit has relevance with its position, I created a data set with 16 variables each holding the positional value of  the digits as shown below with an additional column of sum of the digits.


Now, here is where everything get’s interesting, mapping the sum of digits produces a near perfect normal distribution as shown below. According to the Central Limit Theorem, the sum of n independent and identically distributed random variables tend to be normally distributed as n becomes sufficiently large. In layman language, it simply means we have proved that the digits are indeed randomly generated which confirms my third and fourth assumptions.

Normal Distribution

Next, I asked the question, what if within the digits there is a pair that is  linearly or otherwise dependent. So, I set my favourite software WEKA to find any rules within the data in a process known as association mining.  Running the Apriori algorithm with default settings produced results shown below:

WEKA Results

From the results I knew I was onto something, there is a relation between the third and sixth digit with a confidence interval of 1 (meaning the rule always works). To better understand the relation I loaded the dataset to R statistical analysis software and used the plot() function to visually inspect the relation between the two variables. The diagram below made me go Bazinga! It is a linear equation.

Three vs Six

If X > 0, Y=X-1, otherwise Y = 9. Simply put, if the third number in the scratch card is greater than 0 then the sixth number is the third number minus one, but if the third number is 0 then the sixth number is 9. Pick up any card and test the formula, in a cryptanalytic sense, I’ve broken part of the code used to generate the hidden reload number of Safaricom scratch cards.

scratch card

Download the dataset here https://db.tt/mPP9LpMb

Trash-sourcing Information: A Case of Dial a Delivery

Your favorite fast food eatery has loads of information about you, especially if you prefer the pizza delivered to your doorstep by Dial a Delivery.  When you order food, they give you the option of paying via Mpesa among other mpay options, once paid, the delivery man comes with a receipt which has your order as well as your transaction particulars/details (name, phone number, residence, e.tc …).  This is where it gets complicated, if these receipts find their way to the trash can, dumpster divers will have a reason to smile all the way to their hacking stations.


The privacy and security threat posed by these receipts is a breeding ground for devising sophisticated fraud attacks out doing the MPESA frauds or stepping them to a whole new very convincing level. With a name and residence wordsmiths can dupe you with an SMS text to actually send them money over MPESA. The amount you spend on food which is indicated on the receipt might also give the ‘hackers’ a rough estimate of how much you may willingly send via MPESA without double checking. This gets weary for ladies; stalkers will know your favorite meal, favorite eat-out spot, when you’re likely home, home address and the precious phone number.

The value of trash-sourcing information has proved very valuable in the US and the bureau is formulating The 2011 FBI Domestic Surveillance Manual, expanding the FBI’s spying power which will turn 14,000 FBI agents into a dumpster diving brigade. Dumpster diving is legal in the United States except where prohibited by local regulation. According to a 1988 Supreme Court Ruling (California vs. Greenwood), when a person throws something out, that item is now in the public domain.

Want to know if you are safe? Innscor Kenya Limited trades in the Quick Service Restaurant, Convenience Retailing, Bakery Retail and Bakery Wholesale sectors of the Kenyan economy owns Chicken Inn, Pizza Inn, Creamy Inn, Baker’s Inn, Galito’s, Dial-A-Delivery and My Shop brands. All the eateries under their banner deliver orders via Dial a Delivery.

Theoretical and Controversial Debates : The Big Bang Theory

The Big Bang theory is the most widely accepted cosmological model that seeks to explain the development of the universe. At the beginning, considerable energies became concentrated at one place thereby producing a reactionary expansion that caused a big explosion now known as the Big Bang. This model explains that matter kept moving away from the center of the explosion and coalescing at different levels to form galaxies.

The Big Bang

To date, celestial bodies are still moving away from each other due to the cosmic forces produced during the big bang. The theory rests upon four fundamental concepts; the hot state of the universe at the beginning, formation and abundance of helium, creation of galaxies and expansion of the universe.Initially, the theory had many skeptics who thought it was far from being infallible.

So much on some scientists who hold on that the Big Bang model is a religious intrusion into the domain of science (Willem, 24). However, overtime scientists were able to make modifications to the tenets that supported the theory in-order to make it consistent with the present state of the universe. The theory of the Big Bang isn’t perfect, and overtime addition and modifications had been made to it in-order to make it more consistent with the universe as it appears to us (John, 5).

The universe is 14 billion years old, over these years of development several cosmological phenomena and forces have shaped the current state of the universe. In-order to predict possible future scenarios of the cosmos it would be pertinent to understand its current and past state. It’s only in its infancy compared to the future. Galaxies are not changing in size or density rather the spacing between galaxies on average is growing (Stephen, 7). We foresee a

future scenario where galaxies would be too far apart to even study or observe them. To mitigate this phenomenon the inter-galactic distances should be monitored to note the drift, angles and distance of separation for purposes of locating galaxies in the future. Another aspect of the universe that is core in discerning its future state is temperature.

During its formation, the universe first experienced very high temperatures that later cooled to form galaxies. A major shift in the scale of the universal temperature is likely to upset the current state of balance and cause and upheaval that would realign the universe structure. The universe was dominated by radiation. The properties of the universe are dependent upon the prevailing temperatures (Abhyankar, 445). The temperatures of the earth crust and other

celestial bodies should be examined periodically to detect irregular patterns in heat fluctuations for purposes of identifying areas of concern.


Abhyankar K.D, Astrophysics: Stars and Galaxies, Universities Press, 2001. Print Backman Dana, Seeds Michael, Horizon: Exploring the Universe, Cengage Learning, 2010. Print.

Breithaupt Jim, New Understanding Physics for Advanced Level: Fourth Edition, Nelson Thornes, 2000. Print

Drees Willem B, Beyond the Big Bang: Quantum Cosmologies and God, Open Court Publishing,1990. Print

Pasachoff Jay M, Filipennko Alexei, The Cosmos: Astronauts in the Moon, Cengage Learning, 2007. Print

Perrenod Stephen, Dark Matter, Dark Gravity, Dark Cosmos, BookBrewer, 2011. Print Scalzi John, The Rough Guide to the Universe, Rough Guides, 2003. Print

A Brief History of British Accents

You may not be aware of the fact that accents come in a huge variety in the British Isles. Now, I don’t know what is the proper name of the accents (perhaps a British friend of mine can tell me), other than I’ve experienced that both in person and on TV (or, in films, and, in theatre productions). All this can be explained historically. So, bear with me for a while. ;)

The British Isles in prehistoric and ancient times were made up of innumerable tribes and societies, with their dialects and languages. The invading Romans (1st to 5th Centuries), with their concept of Pax Romana, logically inspired the notion of Pax Britannia, which was eventually achieved. Now, the kingdom of England did not come into being until after the Romans had left, with the Anglo-Saxon kings (Alfred the Great). After them, the torch of *England* was inherited by the Normans (William I was invited to invade the realm by Edward the Confessor, who did not want the throne to go to Harold), the Angevins and the Plantagenets (which was a branch of the Angevins).

The Normans, the Angevins and the Plantagenets were essentially French. Thus, many French words entered the English language, such as “judge”, “justice”, “soldier” and so on. And, during these periods, the language spoken at the royal court was French (now, the origin of having French as the official diplomatic language started with Louis XIV, who came much later – of course, today, English replaced it, as it is the accepted universal language for commerce and many other things).

With the many different tribes and societies in prehistoric and ancient times, you’d expect different dialects and languages. Later, as larger societies came into being during early Medieval times (i.e. England, Scotland, Wales and Ireland), there was no concensus for spellings (it was not an obsession with them). So, any given word came in many spellings. This makes life *interesting* for historians and linguists.

The Plantagenets met their demise at the end of the 14th Century (all due to the stubborn Richard II). Then, England plunged into a long series of strifes. These are famously known as the Wars of the Roses. The two main branches of the Plantagenets went at each other, the House of Lancaster and the House of York; and, their emblems were stylized roses. This is the reason that the Tudor rose combined the two. Henry VII, who was of Lancastrian descent, married a Yorkist lady (who became the mother of the lengendary Henry VIII), hence the combination-emblem. The Tudor period saw the stabilization of England. England gradually became wealthy through due diligence. Wars were avoided when-ever possible. So, when James I came to the throne (who was also James VI of Scotland), Pax Britannia was achieved.

English language also came into its own during the Tudor period (the English Bible was first printed under Henry VIII, though he persecuted this practice early on (it was strictly in Latin, as England was up till then under the umbrella of Roman Catholicism), before he made the break with Rome, as he needed to divorce his first wife. Now, the consensus of spelling as such (as we know it today) did not start until later, from mid-17th Century onwards and throughout the 18th Century. It was during these times that the first English language dictionaries were conceived.

As Britain became a colonial power, starting in the 17th Century, the English language absorbed a huge number of words from many places in the world. For example, the word “serendipity” originated in Sri Lanka. Naturally, with the many regions throughout the British Isles, you’d expect to hear different accents from different places.

-          Text courtesy of  Andrew Lee