Tuesday, July 7, 2015

SWOT matrices in LaTeX

In marketing SWOT matrices are the bread and butter, especially in presentations and in market requirement documents. A SWOT matrix is a structured planning method used to evaluate the strengths, weaknesses, opportunities and threats involved in a product or feature. in an 18 October 2013 post I illustrated how colored blocks can be used to set SWOT matrices into type for Beamer.

TeX Live 2015 contains version 3.61 of the tcolorbox package by Thomas Sturm, which provides an environment for producing colored and frame text boxes with fine control of typesetting: the manual is 405 pages long! This provides an alternative method to set into type SWOT matrices.

In the document preamble we add

\usepackage[table]{xcolor}
\definecolor{swotS}{RGB}{226,237,143}
\definecolor{swotW}{RGB}{247,193,139}
\definecolor{swotO}{RGB}{173,208,187}
\definecolor{swotT}{RGB}{192,165,184}
\usepackage[raster]{tcolorbox}

With this, the template for a SWOT matrix is as follows:


\begin{tcbraster}[raster columns=2, boxrule=0mm, arc=0mm]
\begin{tcolorbox}[colback=swotS!60, colframe=swotS!80!black, title=\textsc{strengths}]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[colback=swotW!60, colframe=swotW!80!black, title=\textsc{weaknesses}]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[colback=swotO!60, colframe=swotO!80!black, title=\textsc{opportunities}]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[colback=swotT!60, colframe=swotT!80!black, title=\textsc{threats}]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\end{tcbraster}

If you keep your data in a database, you can write a simple SQL program that can generate a market requirement document using this template and some boilerplate copy. The typeset result looks as follows.

A SWOT matrix set into type with the LaTeX tcolorbox environment

If this it too garish, you can always use a table environment and the following template:

\begin{table}[htbp]
\centering
%\topcaption{Table captions are better up top} % requires the topcapt package
\begin{tabular}{@{} p{0.10\textwidth} p{0.45\textwidth} | p{0.45\textwidth} @{}} % Column formatting, @{} suppresses leading/trailing space
\toprule
& \cellcolor{swotS!50}{\textbf{strenghts}} & \cellcolor{swotW!50}\textbf{weaknesses}\\
\midrule
\multirow{3}{*}{\textbf{business}} & SB1 & WB1 \\\cline{2-3}
& SB2 & WB2 \\\cline{2-3}
& SB3 & WB3 \\
\midrule
\multirow{3}{*}{\textbf{product}} & SP1 & WP1 \\\cline{2-3}
& SP2 & WP2 \\\cline{2-3}
& SP3 & WP3 \\
\toprule
& \cellcolor{swotO!50}\textbf{opportunities} & \cellcolor{swotT!50}\textbf{threats}\\
\midrule
\multirow{3}{*}{\textbf{business}} & OB1 & TB1 \\\cline{2-3}
& OB2 & TB2 \\\cline{2-3}
& OB3 & TB3 \\
\midrule
\multirow{3}{*}{\textbf{product}} & OP1 & TP1 \\\cline{2-3}
& OP2 & TP2 \\\cline{2-3}
& OP3 & TP3 \\
\bottomrule
\end{tabular}
\caption[SWOT template]{SWOT matrix caption.}
\label{tab:swot}
\end{table}

For the following look:

A SWOT matrix set into type with the LaTeX tabular environment

Wednesday, June 10, 2015

rating scales

In color science we sometimes have the need to elicit consensus information about an attribute. This is done with a psychometric scale. Usually we have a number of related questions. The term scale refers to the set of all questions, while the line typically used to elicit the response to a question is called an item. The tick marks on the line for an item are the categories.

When I get manuscripts to review, the endpoint categories are often adjective pairs like dark – bright or cold – warm. Such a scale is called a semantic differential. Essentially people put the term they are evaluating on the right side and on the left side they put an antonym. The common problem is that the antonym – synonym pair does not translate well from one language to another because they are culture dependent. Manuscripts in English reporting on work carried out in a completely different language are often difficult to assess.

The safe approach is to use a Likert scale, where the 'i' in Likert is short and not a diphthong, as it is typically mispronounced by Americans. In the Likert scale the extreme points for all items in the scale are strongly disagree – strongly agree. The question is now how many points the scale should have. When you need a neutral option the number is odd, otherwise it is even.

For the actual number I often see quoted 5 and 7, maybe in reference to George Miller's 7±2 paper (G. A. Miller. The magical number seven, plus or minus two: Some limits on our capacity for processing information. Psychological Review, 63(2):81–97, 1956). However, as such the answer is incorrect, and it is incorrect to use intervals of the same length between the categories.

The correct way is to do a two-step experiment. In the first step the observers are experts in the subject matter and the scale is a set of blank lines without tick marks or labels. These experts are asked to put a mark on the line to indicate how strongly they agree. You need about 1500 observations: if you have a scale with 10 items, you need about 150 experts. The number depends on the required statistical significance.

On their answers you perform cluster analysis to find the categories. This will give you the number of tick marks and their location. This allows you to produce a questionnaire you can use in a shopping mall or in the cafeteria to obtain the responses from a large number of observers. For more information on the statistics behind this, a good paper is J. H. Munshi. A method for constructing Likert scales. Available at SSRN, April 2014.

After you have evaluated your experiment and produced the table with the results, you need to visualize them graphically. The last thing you want to do is to draw pie charts: they are meaningless! Use a good visualizer like Tableau. If you use R, use the HH package. A good paper is R. M. Heiberger and N. B. Robbins. Design of diverging stacked bar charts for Likert scales and other applications. J. Stat. Softw., 57:1–32, 2014.

Tuesday, May 12, 2015

new green and blue laser sources

The lighting technology in our kitchen comes from Nichia LEDs. It required quite a bit of research, because the main light source in the kitchen is a large skylight oriented to south-east. Therefore, to work in the twilight of dawn and dusk, we needed both high efficiency in terms a luminance and a smooth spectrum compatible with D illuminants.

Recently, Nichia has developed laser technology that could make LCD televisions 25% more energy efficient than LED-based TVs. The major maker of LEDs has created a way to produce laser light that is 1,000 times stronger than laser light created through conventional methods, but which uses less power.

The company implemented semiconductor design changes that made it possible to create a laser system capable of emitting stronger blue and green light. The semiconductor device is made of gallium nitride, the same material used in LEDs. Green and blue laser light has traditionally been relatively weak and therefore is not used in many commercially available products.

Unlike light created by LEDs, laser light does not get diffused and thus can illuminate liquid crystal display TVs and PC monitors with far less power when used as backlighting — up to 50% in the case of PCs. Mitsubishi Electric and other companies have already developed red semiconductor lasers that can emit a strong light, but until now there had been no such system for green and blue lasers.

Nichia's breakthrough means semiconductor laser light is now available in the three primary colors. Nichia has begun shipping samples to consumer electronics makers and aims to commercialize the technology by 2016.

Source: Nikkei

Monday, May 11, 2015

non-locality

Researchers at the University of Tokyo have succeeded for the first time in verifying Einstein’s proposal of the non-locality of a single quantum: the idea that a single photon diffracted by a slit can spread over arbitrarily large distances, but is never detected in two or more places simultaneously.

This elusive phenomenon of non-locality in quantum mechanics, which has been termed “spooky action at a distance,” spurred a hundred years’ debate among physicists with Einstein’s proposal in 1909. Ever since, physicists have been making zealous efforts towards rigorous confirmation by highly efficient measurement devices. However, detection methods used so far have been for detecting photons as particles. In addition to low detection efficiency, since these methods can only detect the presence or absence of photons, it was theoretically impossible to rigorously verify Einstein’s proposal.

Graduate School of Engineering Professor Akira Furusawa, doctoral student Maria Fuwa and their collaborators utilized the wave-like degree of a photon as an electromagnetic wave and used a homodyne measurement technique to measure the photon amplitude and phase with high efficiency. They demonstrate it by splitting a single photon between two laboratories and experimentally testing whether the choice of measurement in one laboratory really causes a change in the local quantum state in the other laboratory.

This enabled the group to successfully verify the non-locality of a single photon with high precision and rigor. The experiment also verifies the entanglement of the split single photon even when one side is untrusted.

M. Fuwa, S. Takeda, M. Zwierz, H. M. Wiseman, and A. Furusawa. Experimental proof of nonlocal wave function collapse for a single particle using homodyne measurements. Nat Commun, 6, 03 2015.

Wednesday, April 22, 2015

Multilayer networks

Monday last week, on the 13th of April 2015, the 1999 Nobel laureate Günter Grass passed away. He grew up in what was then the free city of Danzig. Although Königsberg was farther east in Eastern Prussia, many of the memories of his youth he describes in the Tin Drum are familiar to me from my relatives' reminiscences. In fact, my grandfather emigrated from the Bernese Oberland to Königsberg to work as an agrarian engineer, ending up marrying a local girl.

A couple of centuries earlier another Swiss—Leonhard Euler from Basel—had also emigrated to Königsberg. Downtown, the river Pregel forms two large islands and seven bridges cross the river. In 1735 Euler posed himself the problem of whether it is possible to follow a path that crosses each bridge exactly once and returns to the starting point. In the process of tackling this problem, Euler invented graph theory.

Back in February 1996, I was given a week to write a blurb on what a company could do in terms of technology to monetize the freshly commercialized Internet. You can make money by making people more efficient, which can be achieved by allowing them to do their own work, or by allowing them to do new more valuable work. My employer lost interest and published the blurb, another company picked up the idea and ran with it.

The idea was that the World Wide Web is based on hypertext and therefore is a graph. You add value by adding weights to the edges of the digraph (Fig. 4 on p. 16). Once you have added the weights, you can build the minimum spanning tree (Fig. 5 on the following page). While it is very easy to get lost in a graph that is not minimally connected, resulting in tedium and frustration, in a tree there is a root (you can always go back to the beginning) and between any two nodes there is just one path. As opposed to a list, you can categorize the nodes by putting them in the same subtree, thus reducing the cognitive load.

At the time, I thought that you would have many instances of the graph, each one with different weights representing different criteria, like reading difficulty, subject matter, detail level, etc. Each one would yield a different minimum spanning tree and depending on what you would want to accomplish, you use one or the other.

In 1998 Brin and Page published their paper on "The Anatomy of a Large-Scale Hypertextual Web Search Engine." Pregel is Google's system for large-scale graph processing. There is an open-source counterpart to Pregel in Apache Giraph, although you would not expect to encounter a giraffe on the Pregel in Königsberg, not even in the zoo opened in 1896.

The following decade, as an associate editor for Optical Engineering, I often read papers where data from various frequency domains was fused to obtain much more useful images from remote sensing. Also in my activities at the Interactive Multimodal Information Management (IM2) Competence Center I learned that when dealing with hidden Markov models, by fusing various modes you could build much more powerful models.

Therefore, forget simple weighted digraphs. What you want is a multiplex network and you want to look at the trajectories of ergodic random walkers on multiplex networks. If you thing this is difficult, go back to the Baltic Sea where at Umeå University on the Gulf of Bothnia (more romantically, Bottnischer Meerbusen in German) they have developed Infomap, which makes it a child's play to reveal community structure by taking random walks.

detail of a visualization created with Infomap

Compared with conventional network analysis, multiplex Infomap applied to multilayer networks uncovers interplay between network layers and reveals smaller modules with more overlap that better capture the actual organization. Shoehorning multiplex networks into conventional community-detection algorithms can obscure important structural information, and earlier attempts at generalizing conventional community detection methods to identify communities across layers have proven problematic. In contrast, thanks to the map equation’s intrinsic ability to capture that sets of nodes across layers represent the very same physical objects in multiplex networks, the framework generalizes straightforwardly.

Monday, March 23, 2015

Deciding what to wear

For those seeking an AI perspective on fashion, Colorful Board Inc.’s Sensy app for smart-phones seeks to determine the optimum outfit based on the user’s tastes. “It’s like a fashion coordinator who chooses clothes for me as I’m too busy to spare time for selection,” said Sachi Okuyama, a 36-year-old company employee in Tokyo.

The Sensy app, launched in November, uses an AI system the Tokyo-based information technology venture developed jointly with researchers at Keio and Chiba universities. Users of the service download the free app and sort out whether they like the images of wear sent to their smart-phones once a day. The AI system analyzes replies from the user in accordance with color, shape, price and 47 other criteria to find out that person’s taste, such as “favoring pin-striped red wear of famous brands at sharp discounts.”

Colorful Board has tied up with more than 2,000 fashion companies and online commercial sites both at home and abroad for women in their 20s and 30s. Out of a huge number of dresses introduced on the Internet, the AI system recommends clothes to each user based on accumulated data. When users purchase recommended clothes, sellers pay commissions to Colorful Board.

Okuyama recently bought a gray one-piece suit using Sensy “The more the Sensy app is used, the better matches it can recommend because it learns every day,” said Yuki Watanabe, president of Colorful Board.

It would be interesting if Sachi Okuyama could try out Kokko's ColorSisters we described a month ago. This would inform us whether machine learning can beat an expert system based on the knowledge of experts. I can imagine that the answer will be culture-dependent: Japanese or Germans prefer to blend in and for them an estimate based on big data would be preferable. Americans like to stand out and Italian like to express their individuality, so I can imagine they would prefer the advice of fashion and cosmetics experts.

But then, Sachi Okuyama could be a rebel, so we need plenty of data.

Source: The Japan Times, Artificial intelligence apps guiding users’ clothing choices, culinary tastes.

Hakone sakimidareru





Hakone sakimidareru



咲き乱れる (click to enlarge; pink azaleas are completely out of gamut)

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 

© 2015 Giordano Beretta. All rights reserved.

 



Friday, February 27, 2015

Illusion of a dress

Earlier this week I wrote about color not being a physical phenomenon, but rather an illusion taking place in our mind. I also wrote about Hunt's problem of completing a wardrobe. Hunt's example is a motivation for colorimetry. When we can keep constant the illuminants and observers, we can use CIE colorimetry and a color management system to closely match color scenes involving ordinary dyes and pigments.

When we can control but not keep constant the illuminants, then we can still do a pretty good job at matching the appearance of colors in a reproduction by using a color appearance model. "Control the illuminant" means we have to know what it is, as Randall Munroe suggests in his xkcd cartoon on the dress.

When we do not know the illuminant, we can estimate it if there is an object in the scene whose color we know. In the dress picture sparking the Internet on 26 February, there is no reference object, no complexion is visible. In this sense, the xkcd cartoon is not a faithful abstraction of the problem at hand because it shows a lot of skin. We would need a second picture were the lady is not wearing the dress. Actually, a nude by itself is not sufficient and the lady should also hold a calibration target, at least the white side of a gray card.

Back in the late 80s and the 90s, Robert Hunt used to teach a course on color science at the RIT. After the course, Roy Berns used to take out Dr. Hunt for a dinner. One year, he took him to a fancy Italo-American restaurant. On the East coast, the fancier a restaurant was, the darker it was, because the cultural understanding was that for a romantic date people would be willing to pay a premium price, but would want a low light level.

As they entered the restaurant, they noticed that the light-bulbs were red and the whole restaurant was imbued in pink. When they sat down at the table, they felt extremely uncomfortable, because they were not able to decide whether the tablecloth was white or pink. After a long discussion and the desperate search for a reference white, Roy Berns finally remembered he had his business card in the wallet and he knew it was white. This allowed them to enjoy their dinner.

In their honor, we should introduce a so-called Hunt-Berns effect: Inability of the cognitive factor to decide on a set. Example: When in an environment with colored illumination the brightest object is not known a priori to be white, the cognitive part of chromatic adaptation fails because it is not possible to establish whether that object is white or has a hue similar to that of the illuminant. This is especially so, if the observer is knowledgeable about the Helson-Judd effect.

This would take care of the illuminant problem by having a second photograph of the lady, this time in the nude and with a white reference target. However, this would not necessarily explain the effect seen in the photograph.

It is pretty obvious from the photograph, that the dress is not Lambertian, therefore the geometric appearance has also to be measured. We would need a spectrogoniometer rather than a simple colorimetric device like a camera, whose white balancing algorithm can get completely duped when confronted with an unexpected target.

As everybody who ever tried to touch up a dent in a car with metallic paint knows, not all surfaces have a color made with a simple dye or pigment based colorant. If for example the color is based on pearlescence or iridescence, you cannot reproduce it on a photograph displayed on a screen. At the very least you need a movie. In this end, you have to examine the original.

Color reproduction is about reproducing an illusion. It will always be hard.

Dorsal view of male batterfly which was captured in Peru and is stored in Muséum de Toulouse. Author: Didier Descouens

Monday, February 23, 2015

Completing a wardrobe with Kokko

Robert Hunt likes to start his color science lessons with the problem of completing a wardrobe. He starts with some observations:

  • If you want to buy a skirt or a pair of slacks to match a jacket, you cannot match the color by memory — you have to take the jacket with you
  • Just matching in the store light is insufficient, you have to match also under the incandescent light in the dressing room and outdoors
  • You always get the opinion of your companion or the store clerk

This leads to the three fundamental components of measuring color:

  • Light sources
  • Samples illuminated by them
  • Observers

When we complete our wardrobe, we are not interested at measuring colors, but into matching colors. This may sound easier than measuring color by making measurements and comparing the above three parameters, but it is not. In fact, color is not a physical phenomenon, so we cannot measure it. Color is an illusion that takes place in our mind. What we really have to do is to predict an illusion based on physical measurements, which is very difficult, because we cannot measure our mind.

With this, color science has more to do with art than with physics: color scientists have to develop a deep intuition of color perception, otherwise they are not able to interpret the values delivered by their instruments. This is even more so, when instead of just matching colors we need to assess things like the readability of colored text on colored background, or when we need to create a palette of colors that go well together.

Even such a mundane task as determining the best foundation for one's complexion requires a lot of science and intuition. Cosmetologists can do it almost completely with intuition, but it takes them a long time to develop this intuition. What scientists and engineers can do, is to try to put the cosmetologist or color consultant in a box, viz. into a mobile device.

This is what Nina Bhatti has set out to do with her new company Kokko. Kokko's scientifically developed color matching technology enables brands and retailers to revolutionize ways to shop online—specifically when color selection matters the most.

Kokko's solution for demystifying online purchasing of color cosmetics is called ColorSisters. By using the camera on any smart-phone with the specially printed color chart, Kokko's proprietary software can precisely measure skin tone and offer personalized makeup recommendations—proven to be as accurate as professional makeup artists' recommendations.

Sunday, January 4, 2015

International Year of Light

Here in Switzerland the weather tends to be bad and we have a Zwinglian/Calvinistic Leitkultur, which might explain our tendency towards pessimism and feeling more unlucky than lucky: it is customary to first look at the negative side of things and then to let us be surprised and feel lucky when things turn out to be positive. In this context, nobody is surprised when the newspapers announce the new year by listing negative anniversaries: 700 years Morgarten, 500 years Marignano, 70 years end of World War II.

Today's Zürich is home to many computer science labs and the city has as many nerds as gnomes (the equivalent persona in banking). They may see 2015 as the year of the palindrome, because 201510 = 111110111112. Or the many mathematicians in Zürich will see 2015 as a Japanese cube, because in the Japanese calendar it is 平成27年 or Heisei 27 = 33. For movie buffs, this year is MMXV.

For color scientists, 2015 is the International Year of Light and Light-based Technologies, a United Nation observance that aims to raise awareness of the achievements of light science and its applications, and its importance to humankind. The IYL 2015 will launch at the UNESCO headquarters in Paris on 19 January 2015, with the unveiling of 1001 Inventions and the World of Ibn Al-Haytham.

Indeed, 2015 marks the anniversaries of several events related to light, optics, and vision:

  • 1015, a millennium ago, the Iraqi scientist Ibn Al-Haytham published his Book of Optics
  • 1815 Augustin-Jean Fresnel proposed the notion of light as a wave
  • 1865 James Clerk Maxwell proposed the electromagnetic theory of light propagation
  • 1915 Albert Einstein embedded his 1905 theory of the photoelectric effect into cosmology through general relativity
  • 1965 Arno Penzias and Robert Woodrow Wilson discovered the cosmic microwave background
  • 1965 Charles Kao theorized and proposed to use glass fibers to implement optical broadband communication

In ancient Greece, there where two competing theories of vision. One theory was called the emission theory (Euclid, Ptolemy) and claimed that vision worked by little flame exiting the eye, traveling on rays, scanning the objects in the visual field, and traveling back to the eye reporting what they detected. In the intromission theory (Aristotle), when an object is looked at, it replicates itself and the replica travels along a ray into the viewer's eye, where it is seen.

For a millennium, there was a raging discussion of whether the emission theory or the intromission theory was the correct one. This discussion was based purely on theoretical considerations and heuristics. In his 1015 book, Ibn Al-Haytham introduced the modern concept of scientific research based on experimentation and controlled testing that we still use today: a hypothesis is formulated, an experiment is conducted varying the parameters, the results of the experiment are discussed, and the conclusions are drawn. Because of this, Ibn Al-Haytham is often referred to as the first scientist.

Using the scientific method, Ibn Al-Haytham developed the first plausible theory of vision. Among other contributions, he also explained the camera obscura and catoptrics. He has strongly influenced later scientists like Averroes, Leonardo da Vinci, Galileo Galilei, Christian Huygens, René Descartes, and Johannes Kepler.

Ibn Al-Haytham's full name was Abū ʿAlī al-Ḥasan ibn al-Ḥasan ibn al-Haytham. His Latinized name was originally Alhacen; since 1572, when Friedrich Risner misspelled his name, in the West he has been known as Alhazen. He was born and raised in Basra, where he initially worked. Later he worked in Baghdad and Cairo.

For more information on the International Year of Light see here.