Monday, June 18, 2012

Singularity - how close we are?


Chart: Performance of the top three supercomputers on the TOP 500 list; data

Seems that the Moore's law still holds. At least some version of it and at least in the supercomputing domain.

According to the latest TOP 500 supercomputers list, the fastest of them - IBM BlueGene/Q Sequoia achieved 16.32 petaflop/s on the Linpack benchmark.

That's nearly exactly 100% more than the previous year's result for the most powerful super computer (8.16 petaflop/s) then.

Over the last 5 years, the performance of the super computers was growing on average 135% annually.

What's interesting, the speed of the currently fastest supercomputer on the TOP 500 list is for the first time greater than 10 petaflop/s believed to be the computation power of the human brain.

Combined with the recent developments in machine learning and unstructured problem analysis - as demonstrated by IBM Watson / DeepQ - these suggest that we may be a little bit closer to the technological singularity as envisioned by Vernor Vinge or Ray Kurzweil.

Still, some challenges with creating intelligent software remain unresolved.

However I wouldn't count too much on artificial intelligence closely resembling the human one. It is more probably that we will see some "alternative intelligence" that is able to process human knowledge but does not incorporate all the human traits.

BTW: Any chances some of these TOP 500 systems run distributed R code? ;)

Tuesday, June 12, 2012

Testing multicore cluster parallel computations in R

 
Chart: Comparison of sequential and parallel computations using R; source

R is probably the most versatile computing environment available, but it is definitely not the fastest one.

Some more complex calculations can drag hours or even days.

One of the ways to get the results faster is to utilize all the cores your processor may have.

By using doMC package as the backend for foreach %dopar%, you can usually reduce the computation time proportionally to the number of physical cores you have.

On the chart above you may notice that it was possible to speed up the test computations by a factor of 8.3, on an 8-core / 16-thread dual Intel Xeon processor machine

It is worth mentioning that hyper-threading technology implemented in the tested processor didn't deliver any substantial additional boost. However, all physical cores on the Intel processor were employed, while it was possible to get only a 3.67x performance gain on a 6-core AMD Phenom chip.

When the single machine multicore performance is not enough for your purpose, the next step is to distribute computation on a multicore cluster. Unfortunately you shouldn't expect a linear gain, proportional to the number of nodes in the cluster.

I have recently tested a cluster of four 8-core / 16-thread homogeneous machines running Linux.

Two cluster communication methods were tested: SOCKS and MPI.

The faster of them in this test - SOCKS - delivered a 3x gain over parallel computations on a single multicore system. However, it was "just" 25x better than sequential calculations. Hence 32 physical cores (and 64 threads) comprising the cluster were able to deliver a 25x boost. Some 22% of the potential computation power was "lost" on communication and coordination between cluster components.

Still, it looks like a pretty decent speed gain. I'm not sure how it will scale with the increase of the number of nodes, though.




Wednesday, June 6, 2012

Black Swans vs incompetence

Chart: Investor FIZ vs PBG and WIG20, 1 year, 2012-06-05, source: stooq.com

While the sudden drop in value of the UniWIBID fund may be considered caused by the Black Swan event, you cannot say the same about the recent mouth dropping 24.89% fall of Investor FIZ last month.

From its peak of 2977,05 PLN reached in October 2007, the fund collapsed by 62,34% (which is still better than the -77,85% drawdown of Opera FIZ betwen June 2007 and March 2009).

Chart: Investor FIZ performance, 2006-2012, source: Investor TFI

It is quite amazing, that the fund did actually manage quite successfully through the market turmoil of 2008-2009, although it did not benefited from the significant rally of 2009-2011:

Chart: Investors FIZ performance, 2007-2012, source: stooq.com

One may blame the fund management company - Investors TFI - for losing focus while trying to diversify and expand its product portfolio, instead of  sticking with the management of its flagship fund - Investor FIZ.

Shortly after establishing a short but notable track record with Investor FIZ, Investors TFI launched first a fund investing in gold-related assets - Investor Gold FIZ (late 2006), then - another fund focusing on CEE Emerging Market assets - Investor CEE FIZ (mid 2007), and later - one investing in non public companies - Investor Private Equity FIZ (not analyzed here). 

Finally, in March 2011 (note this date) Investors TFI acquired fund management company DWS Polska.

The first of them - Investor Gold FIZ - quite successfully rode the gold bull market of 2008-2011:

Chart: Investor GOLD FIZ vs gold, 2007-2012, source: stooq.com

However, for most of the time its performance was a little inferior to gold, and it diverged significantly with the metal in mid 2011.

The second fund - Investor CEE FIZ - was a disaster - it lost 61,16% since inception.

Chart: Investor CEE FIZ vs WIG20, SOFIX, BET and BUMIX, 2007-2012, source: stooq.com

Yes, you can partly blame some of its performance on the unfavorable conditions on the markets it was created to invest on.

Nevertheless, when one compares the performance of the three mentioned above funds (Investor FIZ, Investor GOLD FIZ and Investor CEE FIZ), one can observe the gradual degradation of their results from mid 2011 (reminder: in March 2011, Investors TFI acquired DWS Polska):

Chart: Investors TFI funds performance, 2007-2012, source:

If not for similar performance of the other Polish absolute return investments in 2011, one could suspect the breach of the fiduciary duties by the Investors TFI, by overstretching company resources and removing critical assets and capabilities from the management of some funds in order to develop the new business.

But if it wasn't lack of due care, the results of Investors TFI's funds are simply due to lack of competences...

And I'm not sure which one is the better.

Black Swans and multivariate time series analysis

Chart: UniWIBID performance 1 year, 2012-05-04; source: stooq.com

Turkey doesn't expect Thanksgiving is coming. Therefore its existence is nice and smooth. Until the harsh reality suddenly and painfully hits it.

This analogy can be applied to the UniWIBID fund which invests in fixed income equities. It's value has been very steadily, even a little scarily, growing for the previous eight years. Until it has been hit by the bankruptcy of the Polish Building Group (PBG).

As a result, the fund lost 2.71% in a single day. That moved its value back to November 30th, 2011 or by some 6 months. The fund management predicts that despite this event, the fund should work up the loss before the end of the year. And it seems possible judging on the previous performance. Unless another Black Swan hits...

Black Swans are defined as unpredictable events with serious consequences. This definition implies that you can't foresee such events using historical data for the relevant information is simply not present in the time series being analyzed.

However, it is sometimes possible to infer such possibility from different but connected times series, i.e. by using multivariate time series analysis.

In the case of UniWIBID, you may have potentially used the previous performance of IDEA Premium - another fixed income fund that recently lost 3.26%

Chart: IDEA Premium performance 1 year, 2012-06-05; source: analizy.pl

Therefore, even if Black Swans are not predictable, it is sometimes possible to get some warnings when the analysis is expanded outside the single time series.

This is quite important, since many financial models are based on the assumptions that the future can be predicted based on the past asset performance and they are limited to a single time series.

Take the standard Black-Scholes option pricing model - it assumes the changes in price of the underlying asset can be completely modeled using the past prices and normally distributed random changes of them. Since the Black Swan events are always connected with non-normal jumps, the Black-Scholes model cannot cope with them. And since the model is limited to a single time series, it is also unable to factor in potential shocks propagation that may be already visible in other time series.

PS: I have mentioned above that the sudden drop in value of the UniWIBID fund was caused by the bankruptcy of the PBG.

The shares of the company itself felt by nearly 50% in a single day:

Chart: PBG price, 5 days, 2012-06-05; source: stooq.com

But that was just a culmination of the long process of decline of this stock:


Chart: PBG price vs WIG20 and mWIG40 (log), 3 years, 2012-06-05; source: stooq.com

There was a clear downward trend present in the price of the stock that could be interpreted as a warning sign. Especially when the trajectory of the PBG price was compared against the market.

That is not always the case, though...