Wednesday, September 28, 2016

The Humanization of Robots and Artificial Intelligence

As robots and artificial intelligence (AI) become increasingly prevalent in human society, there is a trend to make them look , talk, think and behave more like us i.e. make them unto our image.  AI software already show some  human traits. Here are a few examples:

One of the latest techniques in AI called Deep Learning Neural Networks [DLNN] (commonly used in machine vision, speech recognition and search) is actually capable of dreaming. While other AI has to be fed data for input, DLNN is also capable of generating some of its own input data and has its own ideas of what an object should look like. This it does by entering into a dream-like state. You can view some artistic/hallucinatory/horror/Salvador Dali-like dreams of DPNN contributed by Google’s AI Group at 

As a one-year old child grows its brain sees and automatically classifies objects according to their likenesses viz number of features and their degree of similarity. For example cars, trucks, cranes, fire engines etc may be classified as vehicles by his brain maybe because they all have wheels, move on roads and people sit in them.. Later on an adult will teach him that this is a truck, this is a fire engine and so on. This is exactly how a DPNN learns. The unsupervised first stage groups objects into clusters based on degree of similarity and the second supervised stage builds upon this foundation to refine and differentiate objects in each cluster.

In Nature, only members of the same species will be capable of reproduction, not to mention breeding with members of the same family is taboo. This is called Speciation. One form of AI called Genetic Algorithms (GA)  ‘breeds’ solutions to problems by having a gene pool and evolving through generations till the best (fittest) solution is output has Speciation rules in its algorithms. Problems are encoded as strings of chromosomes and breeding is by cross-over and mutation of these strings. Simulating evolution of hundreds or thousands of generations, the GA evolves to produce better and better solutions. Some uses of GA are  optimising transportation schedules, work and school time-tables, portfolio creation in financial markets etc

As in humans, the evolutionary process ‘chooses’ the fittest parents to allow them to produce children who will in general be fitter than their parents. GA also fight for the right to reproduce. This they do by fighting in tournaments where the fitness function is defined. And winners will be allowed to reproduce the next generation. Unlike humans however, the defeated will be culled. They can also practice Elitism if this is decided by their programmers. Only a select group with desired characteristics will be classified as elites and allowed to breed. Degree of social mobility can be adjusted from time to time.

Fuzzy Logic is another form of AI which basically tries to make machines  look at the world in a more human way. The human brain can look at a problem or an object in a holistic way that machines can’t. One of the reasons for this is that humans think and see things not as digitally binary or black and white but degrees of truth. Thus a man may be described as somewhat tall or the temperature may be described as cooling-and we will understand it. Fuzzy Logic enables rules to be encoded in degrees of truth by having fuzzy membership functions (see image) where characteristics can overlap. The Japanese use a lot of Fuzzy Logic in their consumer appliances from rice cookers to air conditioners, refrigerators and washing machines. And the reason why your fuzzy logic rice cooker can consistently cook a perfect pot of rice. It can measure the realtime relationship between temperature, moisture, texture, type of rice etc and make its own judgement calls as to when and how much to reduce or increase the cooking time. 

Monday, September 26, 2016

A Common Sense Valuation Comparison of Global Equity Markets

A Common Sense Valuation Comparison of Global Equity Markets
* and the relevance for quantitative (algorithmic) Mean Reversion startegies

# click on image to see bigger Table

Table 1: Worksheet

Table 2: Earnings-based

Table 3: Dividends-based
  • ·         Each country’s financial markets have their own characteristics and peculiarities so comparing them with a global average of Price/Earnings, Price/Book etc  is meaningful.
  • ·         Because of the loose money policy (Quantitative Easing) by the major economies (Eurozone, USA, Japan, even China in some ways) in the recent years, leading to low interest rates, there is a tendency for financial asset bubbles to arise, caused by excess funds chasing yields.
  • ·         The interplay between the Bond market and Equity market is an often underrated  factor in determining the direction of the equity index.
  • ·         Different kinds of analysis are more relevant depending on the current mode and mood of the market viz recessionary vs inflationary times, low growth vs high growth, risk-on vs risk-off mode.
  • ·         In the current low-growth environment, the Dividend factor is more important than the Earnings factor.
  • ·         Instead of Price/Earnings I have used Robert Schiller’s (the man who ‘predicted’ the 2008 US sub-prime mortgage crisis) CAPE (Cyclical Adjusted Price Earnings) which uses moving averages of 10-year earnings adjusted for inflation
  • ·         Unlike Momentum strategies, Mean Reversion strategies MUST be underpinned by Fundamentals. This is especially so in Index Futures which are based on expectations not historical.
  • ·         For Index Futures traders using a Mean Reversion strategy, Dividend Yield/10year-Bond Yield Spread is a better indicator of mid-term reversion to the Mean than the CAPE-10 year Bond Yield Spread.
  • ·         Going by Dividend factor as in Table 3 France, UK and Australia are top three undervalued, instead of China, Singapore and India if we go  by Price/Earnings factor as in Table 2.
  • ·         However, this analysis is just one variable in a quantitative model of global equities and output like direction will depend on degree of cointegration among the various markets

Wednesday, August 10, 2016

Machine Learning: The Master Algorithm


Most of the knowledge in the world in the future is going to be extracted by machines and will reside in machines.
– Yann Le Cun, Director of AI Research, Facebook

MACHINE LEARNING is the automated discovery of Knowledge. With the Internet and sensors everywhere flooding the world with data, the ground for machine learning is extremely fertile. Machine Learning is done by learning algorithms.

Pedro Domingos’ book is a discourse on the quest for the Master Algorithm which is able to learn anything and everything anytime.

However, the quest for a Master Algorithm is by default a quest to know the nature of the learning process, and there are five schools of thought here on just what happens when we are learning so that machines can emulate them. (Dominos call’s them the five tribes of machine learning). 

Each of the tribes have their strong and valid points and any master algorithm would have to take a bit from each tribe.  them. Below, the five tribes of machine learning, and what they do:

1.    Symbolists fill in gaps in existing knowledge and use deduction to synthesize new knowledge. Example tools: Algebra, Set Theory, Boolean Logic.

2.    Connectionists strive to emulate the brain. Example tools: Back propagation artificial neural networks, Deep-Learning neural networks.

3.    Evolutionaries simulate evolution and natural selection to search the data space and evolve generations of virtual chromosomes of knowledge using a fitness function as a selection criterion. Example tools: Genetic Algorithm, Particle Swarm and Ant Colony Optimization.

4.    Bayesians systematically reduce uncertainty through changes in the probability of constantly updated data. Example tools: Markov Chain Monte Carlo simulation, Kalman Filter.

5.    Analogizers strive to find patterns and similarities in data to classify them and reduce noise. Example tools: Support Vector Machine, Nearest Neighbour algorithm and Radial Basis functions.

Each of the above is suitable for certain applications in widely different fields and certainly, it would be a challenge to find a Master Algorithm.

Wednesday, July 13, 2016

Book Review :Superintelligence by Nick Bostrom: Scenarios for the rise of a rogue AI (Artificial Intelligence)

SUPERINTELLIGENCE by NICK BOSTROM (non-fiction): This book posts the various scenarios on the topic of an Artificial Intelligence (AI) machine turning into a Superintelligence and taking over the human race. Not science fiction but based on current technology's projected development into the future.
Scary and chilling when you consider that great minds like Bill Gates, Stephen Hawking and Elon Musk have already given warnings on the dangers that can happen when an AI gets out of control.
We have already experienced the great improvement in the intelligence of search engines, translation software, speech recognition and image recognition in recent years. This is just the beginning
The author shows the the various technical scenarios where a machine AI becomes powerful enough to break free from its human programmers, command resources to exponentially improve its own capabilities, destroy other competing AI and go on to plot a takeover of the human race. In this book, the takeover happens at blinding speed- in a few hours- and humans are powerless to stop it.
The AI spreads into the Internet to expand its hardware capacity and knowledge base. It hacks into the weapons systems of States and controls their activation. It manipulates financial markets to gain economic resources with which it buys the collaboration with greedy humans who will assist it. It controls the media(TV, news sites etc) and biases the information flow in its favour. Using its knowledge of molecular biology and nano technology it can produce anything and any material at lightning speed and create an army of slaves to do its bidding.
And what is the timeline for this? Nick Bostrom believes it could happen this century. From a hunter-gatherer society to an agricultural society took Mankind 200,000 years. From agricultural to industrial society took 1,000 years. And now, the Internet Economy has developed beyond all past expectations in a matter of decades. At the rate in which AI research is progressing, Nick Bostrom's scenarios are not impossible.

* Those who have some knowledge or experience of AI applications whether in speech recognition, machine vision, financial markets high frequency trading algorithms, robotic or military applications will appreciate this book.

# If you think how the Singapore Police always get their man (e,g, the Standard Chartered Bank robber), it is most probably through a very efficient image recognition software that matches the CCTV images with a travel document (visa, passport) image). And it is must be a very intelligent system that is able to see through disguises and changes in looks.

Sunday, July 10, 2016

Evolution In Nature: Lessons For Your Life

EVOLUTION IN NATURE: LESSONS FOR YOUR LIFE. Nature did not have a plan to make a tiger, a horse or Man. It just happened along the way.
Everything in this space-time Universe evolves; including your Life. Evolution is survival of the fittest. But it is not strength or intelligence that determines fitness for survival. It is the ability to adapt to the ever-changing environment.
Those who are able to constantly adapt, survive. Because Evolution has no pre-determined plan nor a targeted path.
Evolution is open-ended. It meanders along adapting to its ever-changing environment. It is affected by, and in turn affects the environment (and its inhabitants). [Coevolution and Feedback Loops].
In the same way, your Life is not pre-determined but meanders along, affected by events and people, and in turn affecting events and people in a feedback loop. What you will be tomorrow depends on what you do today. And what you do tomorrow makes you what you will be the day after tomorrow.

Wednesday, June 15, 2016

Bond Yields and the Stock Market: A Longer Term Perspective

The daily gyrations and noise of the financial markets are these days exacerbated by algorithmic machine-trading. In addition, the high inter-connectedness of global markets and availability of instantaneous information leads to high correlation between all asset classes: equities, bonds, commodities and currencies; leading to higher and higher volatility via feedback loops until it crashes (nothing goes on forever in such Chaos theory models). Like what happens when your electric guitar's signal feedback to the amplifier turns into a howl.
Taking a longer term view helps in taking away the noise to view the fundamentals. The chart below shows US interest rate changes from 1965 to the present, as represented by the yield on 10-tear Treasuries. Superimposed on it, the Dow Jones Industrial Average and Singapore's Straits Times Index. The chart scale is logarithmic and changes are in % for comparability. The second chart shows yields for 5-years so that details can be viewed with greater clarity.
Some observations from the two charts:
- Today's 10-year Treasuries yield of about 1.59 is low but not the lowest. The lowest of 1.35 was sometime in July 2012 when the PIGS (Portugal, Italy, Greece, Spain) had problems with their sovereign debt. (Can't remember whether it was Italy or Ireland. More recently it was Iceland
- But that was temporary and you can see the yields going up rapidly until it reached a peak in 2014.
- However since then it has been on a downward slide except for the period Jan to Jul 2015
- Taking a longer term view. Since 1965, the yields (interest rate) are definitely indisputably dropping. That's a 50 year trend!
- Next thing you may notice is that broadly speaking, stock markets move in opposite direction to bond yields- see the DJIA and STI on the first chart.
- Singapore and its very open economy is vulnerable to all sorts of happenings around the world. See circled 1997 Asian financial crisis and 2008 US sub-prime mortgage crisis.
-As a result of the low interest rate environment,there is economic growth but also asset growth fuelled by debt (asset bubbles)
- China is a such a good example, and many economists expect a day of reckoning soon which will make the impact of Brexit pale in comparison.
Why is a low-interest rate environment so persistent? I don't know the answer. My guess is that it is due to politics and politicians. Every time economic growth slows down for valid structural and cyclical reasons, politicians are afraid that they will loser their votes, or there will be social unrest. And so they prime the pump to let loose the money again.
Scott Lee for you since you seem to be more interested in economics and finance these days.

Tuesday, June 7, 2016


The media, analysts, fund managers and assorted pundits have been increasingly strident about China's huge debt overhang amounting to trillions of dollars; warning that it will trigger a financial and economic crisis not only for China but the world soon. We have seen the effects of the current China slowdown on everything from demand for iron ore to demand for luxury goods, as China's economy forms a larger and larger part of the world economy. The current economic slowdown in China is the result not only of the ongoing Chinese government;s economic structural reforms but also of years of monetary quantitative easing (QE); beginning with the mega economic stimulus of late 2008 which pumped US$600 billion into the economy. This cheap money fuelled the economy, resulting in an overheated real estate sector, over-investment in manufacturing, wasteful projects, underutilised infrastructure. China's demand for commodities such as oil, coal, iron, steel and agricultural commodities triggered an upsurge in the economy of countries that supplied these products.
The current situation is too long to explain but can be summarised by the headline of an article in today's Straits Times " After the Miracle, the Curse of Debt".
Is Doomsday for the world economy coming this year? Economists and analysts are notorious for making wrong forecasts. In this FB post, just for the fun of it I counted the number of articles per month yielded by a Google search of "China Debt Bubble" and "China Debt Crisis". Going by the consensus and Delphi oracle method of statistical forecasting, if anything at all, this chart constructed by me increases the probability of the event mentioned in this post coming true sooner than later.
*** June is an extrapolated figure based on number of posts till 8 June.