Dealing with user cancellation of slow macro

This post is a little different from usual.  It concerns VBA macros for MS Excel. Writing macros is quite easy, but writing efficient macros that run in an acceptable time requires a few tweaks.

Commonly known tweaks include turning off screen updating (see the code below for an example of how this works) and then updating the statusbar to show the user progress (also in the code below).

However, what often frustrates me is the inelegant ways in which a user can exit a macro which could take hours to run. I struggled a little to find the approach demonstrated below so I thought it might be useful for others. Continue reading

Presentation to ACAL on GI Pricing

I gave a presentation on a holistic approach to ratemaking using predictive models yesterday to the Lebanese Insurance Association (ACAL, the acronym for the association in French). Over a hundred people attended, and there certainly seemed to be interest in the topic.

A common response though was that Lebanon isn’t yet ready for that, because rates are so low and nobody is prepared to change their approach. I accept that changing the “way things are done” in a fundamental way takes time and courage, but I expect that some players will start collecting the data, doing the analysis and improving their pricing in the next few years. By 2013, the market here will not be the same. The advantages across general insurance, banking, sales and cross-selling are simply too great. The techniques available are fantastic and can be implemented quite easily.

I’ve given the official press release below, and presentation ACAL GI Pricing 2008 (pdf version) is available under Resources on this site.

Insurance companies can generate a competitive advantage through accurate ratemaking, systematic risk-adjusted pricing, and careful analysis of policyholder price sensitivity at renewal dates. Single variable techniques can provide valuable insights into risk factors, but do not perform well in the presence of multiple drivers of risk.

Generalised Linear Modelling (GLM) is the preferred approach for robust, multivariate analysis of claim severity and frequency modelling. GLM can model several rating factors simultaneously, including interactions between different rating factors on risk. It is used extensively in the UK, the US and other highly competitive and developed insurance markets.

Judgement and experience are required when assessing different models and interpreting the diagnostic tests used to ensure accurate and robust results. A good model can make dramatic improvements in the separation of high and low risk policyholders.

These advanced approaches all have increased data requirements. Companies looking to reap the rewards of improved ratemaking will need to develop the databases and systems to store exposure, claims and rating factor data. There is a range of software available to perform the statistical analysis, from expensive purpose-built systems to freely available, open-source statistical platforms.

Successful implementation of an advanced rating system depends on commitment of key staff to the project and the inclusion of marketing, underwriting, legal, IT and actuarial skills in the project team. Market characteristics and reluctance to change are constraints to the adoption of advanced techniques. These have been faced and overcome in many other markets. It is only a matter of time before insurers must use these techniques even to maintain their competitive position.  Early movers will enjoy an improvement in their competitive position, market share and profitability.

Don’t use Altman’s Z-score for managing a turnaround

I attended workshop presented by the famous credit analyst and model builder, Professor Edward Altman. He is probably most famous for the invention of the seemingly immortal Z score, which is still in use 40 years after its creation in 1968.

During the workshop, Professor Altman recounted a story about how a company managed themselves out of near-failure using his Z score. I’m not denying the facts of the story, and I’m not even saying that use of the Z-score at this company (GTI Corporation) didn’t help the turnaround. I am proposing that using Altman’s Z-score to manage turnaround would be ill-advised.

Download the full Viewpoint below.

Don\'t use the Z-score to manage a turnaround

The first of many BEE deals drowning

Moneyweb’s article on Barlow’s re-striking of BEE options echos my earlier post on the trouble of underwater incentive options.

The sense of the article is that this sets a bad precedent. Of course, the precedent has been set years ago – I’ve personally calculated the additional costs under IFRS2 for BEE deals in danger of expiring worthless because the share price didn’t perform as expected. I’ve also seen deals where performance conditions for BEE partners have been massively relaxed because the performance was massively below the original targets.

But more than that, what choice do companies have? I’ll quote my comments on the Moneyweb article below:

Company’s issue the share options in order to improve their black shareholding for BEE purposes. The cost of this was born by shareholders, presumably because the alternative was more costly. (One can argue “right” and “wrong” but here we are talking economics not politics.)

Now, if the options expire out of the money, then the company loses the BEE points. In that case, providing the cost of issuing new options is still less than the cost of not being appropriately BEE rated, then the rational choice is to issue new options. Re-striking existing options is just a pragmatic approach of achieving the same end.

IFRS2, the accounting standard that governs the measurement of the expenses of issuing share options to employees or BEE partners, will require the increase in the value of the options to be expensed. Thus, the economic cost of issuing the options will be recorded in the income statement as well as being a true economic cost.

If the BEE partners had been given shares rather than options, then there would be no chance of them expiring out of the money. They would then experience upside and downside just like ordinary shareholders. However, to achieve the same % black ownership, the expense incurred would have been greater.

The company took a gamble that the share price would rise, hoping to save a buck. Market turned against them, and now they have to dip back into their pockets to pay a little more. Does it make sense for a company to gamble on its own share price? Wouldn’t it be better to take the hit upfront, with no fuzzy option-like liabilities floating around, half-hidden on the balance sheet?

The really frustrating thing is that often the utility cost of the issue options (to the current shareholders) is greater than the utility benefit gained by the BEE partners due to the restrictions on sale and concerns around concentration of risk.

Share options issued by companies for various purposes have many hidden dangers. If you’re planning to use them, it might be worthwhile getting a second or third opinion on:

  1. How to structure it
  2. How much it will cost under a range of scenarios
  3. What impact it will have on the financial statements
  4. How much it will cost to be valued for each financial period as well as audited
  5. Whether it will incentivise the desired behaviour
  6. Whether the beneficiaries understand and appreciate the structure, so that utility discounts are limited
  7. How the costs and benefits of the chosen approach compare against alternatives

Each of these 7 points requires careful thought, experience and training. A little consideration and planning can give dramatically better results.

ETFs and gearing, and the property market

Brief introduction to Exchange Traded Funds

An “ETF” is an “Exchange Traded Fund”. In it’s simplest form, it is:

  • a company…
  • with very specific assets (e.g. gold bullion or a portfolio of shares with the exact weights of a particular index)…
  • listed on (and traded on) and exchange
  • in which one can invest to get exposure to the underlying assets…
  • more easily, more cheaply, in smaller amounts and with higher liquidity than purchasing the underlying assets directly

The trick is that specific rules which allow market participants to “swap” appropriate portfolios of the underlying assets for new shares in the ETF, or redeem shares of the ETF for a proportionate share of the portfolio of underlying assets. This forces the price of the ETF very close to the fair value of the underlying assets. Arbitrage handles it.

This is a pretty simplistic descrition of ETFs, but it covers the major characteristics well enough to explain gearing in the context of ETFs and how this relates to the property market.

How ETFs can increase volatility in their chosen assets

ETFs have become very popular. The increasing gold price has meant that many investors want exposure to gold (since the price is going up at the moment, it will always go up, right?… right?). An easy way to get this exposure is to buy shares in the gold ETFs. This requires the ETF to issue new shares, and invest the cash in physical gold.

So the ETFs suddenly become significant purchasers of gold. Only a certain amount of gold enters the market every day. Some from raw production, some from recycling or sold jewellry, some from tightly held supplies with central banks or other investors. If we create a demand shock by introducing a new player (the gold bullion buying ETFs) on the demand side, the price will increase. The full price increase is mitigated through an increase in supply (think central banks in the short term, jewellry in the short to medium term, and gold production from new exporation and reopening of moth-balled mines in the medium to long term).

As the gold price rises, investors in ETFs tell their friends of their success.  More investors want exposure to gold (going up, always going up, can’t lose) and pile further into ETFs. The act of buying in such large amounts forces the prices up.

Hopefully this is sounding much like a bubble to you. And much like a bubble, two things are true:

  1. For a while, prices will continue to rise and there is money to be made selling on to greater fools
  2. Eventually the last fool will purchase and the bubble will deflate. Quickly.

Investors are a fickle bunch. Particularly individual investors who only piled into gold (to continue the example) ETFs because their Uncle Mike was doing so. As the price is on the way down, they sell their ETFs. The ETFs in turn sell gold and the geared effect unwinds in a hurry.

Prices move up more than they should due to feedback into the system and the inability of supply to increase instantaneously to meet demand. Prices move down for exactly the same reasons.

The price of eggs and property

FNB announced that they are withdrawing approvals for home loans on a large scale. This is on top of the banks existing moves to tighten lending criteria, and on top of higher interest rates, higher inflation, economic slowdown and both an increase in emmigration and a decrease in immigration.

So yes, demand for property is down. FNB’s move is both a result of declining property market and will become a driver of it.

The extensive expansion of credit financed a large part of the property boom. Credit expansion was profitable and low risk because “property prices are going up and will always go up”. Banks don’t really mind if you stop paying your home loan if you or they can sell your house easily for more than the outstanding loan balance. Once the sure-thing of rising property prices is found out to be the wolf wearing grandmother’s clothes, the party is over and the risks to lending institutions increase dramatically.

The greater fools have all gone.

Sounds like the sub-prime crisis in the US, doesn’t it? And we wonder why our banking shares are so “cheap”?

Economics of piracy at the limit

I was reading the comments on a recent blogpost on the freakonomics blog. Someone suggested (tongue firmly in cheek, I hope) that if libraries were invented today, copyright enforcement bodies (the DMCA was labelled directly) would hunt down anyone who tried to set one up.

The comparison of the lending of books to the piracy of electronic media is disingenuous.

Why pirating books is a limited problem

Books are generally sold under the “licence” that allows them to be resold or loaned. Although there is arguably a different value/cost associated with a book purchased for a single reader versus one for a library, the scalability of a printed book is naturally limited. A physical book can only be read by a single person at a time, and transport and distribution are not costless.

The need for careful agreement between buyer and seller around what is allowed is not critical and probably not worth the cost of having separate licences to cover individual consumers versus libraries.

At the limit, pirating of electronic media implies no production

For electronic media, the scalability of copying and redistribution is, for most practical purposes, limitless if we assume perfect, universal, costless reproduction and distribution.  For impractical purposes (and pedants, you know who you are) there are limitations around the total population of earth, the market for that particular work, and costs of distribution are not zero. While I haven’t gone through the entire process of relaxing these assumptions to understand the impact, this theoretical framework is still instructive.

Thus, without careful agreement between buyer and seller, buyers will be inclined to extract maximum value. Taken to the extreme, this implies that only one copy of the work will be bought. I’ll explain how we get to this now. In the rest of this example, I am assuming no restrictions on copying, which includes no social pressure or stigma attached with using or distributing pirated media.

Once there are two sellers in the market, the market price will be pushed down due to competition between the two sellers. If one seller wants to sell the product at any price above zero, the competition will undercut that price since profit can still be made until the price hits zero. The aggregate supply curve is effectively horizontal at a price of zero since the marginal costs of production are zero.

In this analysis I am implicitly assuming that perfect competition will result even when there are only two suppliers in the market. Ordinarily this would be a poor model for this type of market. However, for two reasons, this is probably a good first order approximation:

  1. The “goods” being supplied, the creative work in this case, are exactly identical in every way. The differences or perceived differences of monopolistic competition and other market forms do not apply.
  2. Every additional buyer instantly becomes a potential supplier. Thus, the number of suppliers in the market grows exponentially by doubling every “turn” of the process. It should be relatively clear that the market will inevitably fall into perfect competition in a relatively short amount of time.

With a typical downward sloping market demand curve, this implies that an infinite amount of the product will be “sold” at a “price” of zero. This is approximated through current distribution and pricing of pirated media.

The creator of the work knows that he or she will only ever be able to make one sale (where I define “sale” to be a transaction with a positive price). All future sales will have zero total revenue. So the price at which that first sale is transacted must be very high if it is to be worthwhile to the creator to produce. However, the first purchaser knows that once he or she has purchased the work, competitive forces mean that he or she will not be able to sell the work for more than 0 in future. Thus, the price paid by the first purchaser will only be equal to the consumptive value to that purchaser.

Any creative work that will cost more to the creator to create than the value that one purchaser places on it (albeit the purchaser who values the item most) will not be created. Not for commercial reasons anyway.

Conclusion?

I am wary to conclude too strongly on an area that is new to me and where I haven’t necessarily thought through all the consequences, or understood the impact of relaxing certain assumptions. However, this little thought experiment naively suggest that, under these strict assumptions, a huge variety of creative works may never see the light of day.

The start of a practical solution

Live concerts cannot be perfectly replicated. If one assumes that a large portion of the value derived from a live performance (or live “creation”) is being there in person, then that “first sale” can be made to many consumers simultaneously. That same instance of creation cannot be resold since a live performance cannot be stored. However, a second, third and Nth live performance could be sold where the creator has pricing power due to the natural monopoly created through their own talent, brand and creative abilities.

Several performers (including Madonna) have signed huge financial deals with concert promoters (e.g. Live Nation, suggesting that the real world is already tackling the changing economics of artistic creation in an electronic media world.

This is unlikely to be the only solution that is tested, but it will be interesting to see how this section of the economy develops through this testing phase.

In this post I haven’t expressed an idealogical view on whether piracy is “good” or “bad” according to some normative standard. The hope is that we can follow the logical, economic arguments to their conclusion rather than be sidetracked by emotion and politics.

5 Mistakes you make when you leave the science out of marketing

Marketing is naively thought to be mostly art and very little science. While it is true that there is are elements of inspiration and creativity and passion involved, the balance of an effective strategic marketing role is heavily in favour of science.

As a further point to consider, I put forward the proposition that much of really great science involves inspiration and creativity in passion in more than equal measures to a successful marketing decision. Newton’s development of the laws of motion and gravity, Copernicus’ solar-centered world, Pasteur’s painstaking experiments to support and understand germ theory are all well known examples of brilliance and flair combined with method and rigour.

But where does science contribute to marketing? Is it possible to reap the benefits of logic and analysis and rigour without damaging the creative process?

The answer is “absolutely without a doubt” for numerous reasons. I will touch on just one in the next few paragraphs to demonstrate the idea.

Introducing analytics

The most commonly thought of analytics when it comes to marketing is customer analytics. Better understanding of customer behaviour, preferences and ultimately buying decisions is enormously valuable. Take what was done in the past, compare the success rates of the different initatives, and stop doing the ones that don’t work.

Any organisation can benefit from understanding what works and what doesn’t, and shifting resources to those functions that work. Good organisations also understand the value of play and experimentation, and will continue to allow an element of trial and error. Truly excellent organisations combine experimentation with analytics to truly understand on a measurable level which experiments work and which should be tossed.

A real life example of the place of analytics

Let’s consider a very specific example. An old university friend of mine has started a new venture with a unique offering that clearly means a great deal to him. He has the passion, and presumably the product, to make his idea a success. He also had the good sense to plug into social networking platforms such as Facebook to spread the word of his new website and associated content. So far we have an excellent platform for success.

Mistake #1: Ignoring pre-existing science and analytical results

However, the design of the website appears to have been performed without understanding the hard, measurable evidence from a range of pre-existing studies and material. The website makes it difficult to buy. A long slide-show intro precedes access to the main page, frustrating regular visitors to the page (the intro cannot be skipped) and severaly damaging the ability of his site to be spidered and highly ranked by search engines.

So several mistakes have been made by disregarding the clear evidence that has been accumulated through analysing customer behaviour on similar projects.

Mistakes #2: Not performing analytics on web page at the outset

An excellent first step in understanding how customers will interact with your sales channel is to watch customers interact with your sales channel. Before a site goes live, invite some representatives from your target market (friends and family will do in a pinch if budget is tight, as long as you are confident they will give honest feedback).

Watch them interact with your website (or other sales and information channel). Where are they confused? Do they ask many questions? You won’t be there in person for most of your customers. What do they say is good, what do they say is ugly. If one guinea pig says something doesn’t work, that could be personal preference. If all 3 or 4 give similar feedback, the scientific evidence is mounting and a wise marketer would make changes.

This can be a very quick and easy, but amazingly valuable way to understand the strengths and weaknesses of your approach. Don’t assume you are just like your customers.

Mistakes #4: Not starting to collect analytics and data from the start

It is so easy to collect useful information, if you plan it in from the start. Once the system is set up and the process is working, invaluable information will flow with every visit, every call, every surf and every purchaser.

Not setting up to collect data is usually the first sign that the marketer doesn’t understand the value of understanding the customer.

Mistake #5: Thinking science cheapens the experience

Perhaps this should be mistake #1. Many people with great ideas feel that their ideas should sell on their own merit. They view logical, analytical understanding of customers to be beneath them. If the product is good, if customers will benefit from purchasing the good or service from you, then you owe it to them to make it as easy as possible for as many as possible of them to effortlessly find their way from oblivious potential customer to satisfied repeat customer.

If your aim is to build the perfect mousetrap, perhaps it is worth finding out what customers want in a mousetrap, where they like to buy it and how they like to buy it.

Actuarial consulting career part 2 – system development

This is a continuation ofa post considering the relevance of an individual investment product development position to a career in actuarial consulting.

An old contact mailed me a couple of days ago asking my view on two possible actuarial positions. He was interested in whether either would be suitable preparation for a consulting or actuarial consulting role in future. I thought the answer might be of broader interest, so I’m copying it, with a little editing to protect the innocent into a couple of blog posts.

Please note this shouldn’t be taken as categorical always applicable advice – just some thoughts:

In-depth knowledge of policy systems and admin is a tremendously useful skill-set in its own right. Companies are always struggling with legacy systems, and the speed, efficiency and flexibility of current systems can generate a competitive advantage in getting new products to market, improving customer service and reducing costs. Although this role would introduce depth rather than breadth to your skills and experience, it could potentially be a stepping stone into a solo consulting career focussed on these areas. Alternatively, if you enjoy that sort of work, there is probably a long-term future for you at the potential employer moving up from coding to systems analysis and improvement.

All insurers struggle with these issues, and I can’t see how this will ever change. As insurance takes off in other developing markets (rest of Africa, Middle East and so on) there will be a range of new companies selling new products to new customers with new designs and special features. This role will always be in demand.