Tuesday, September 20, 2016

Lemme ask a couple thousand of my friends

I think that crowdsourcing is a really cool idea. Crowdsourcing is where you ask a couple thousand of your closest friends to help you with some project - maybe to answer an important question. Who will win the Superbowl? Should I wear a red tie to the interview? Will FitBit stock go up? Will my doggy iPad be a successful product? And, most important, should I order another strawberry margarita, or move right on to my main course of Maker's Mark on the rocks?

Jimi doing some crowdsourcing on whether is vest was the coolest part of the 60's

Naturally, I have blogged about crowdsourcing before. After all, all great men repeat themselves. I had a blog on recommendation engines, and talked a bit about how Netflix cogitates on all your ratings in order to make sure you have a superlative movie viewing experience. In this Valentine's Day blogpost, I did a bit of crowdsourcing in the name of romance.

Opinion polls are an early form of crowdsourcing. The Nielsen company once solicited my opinion on TV shows and radio stations. I showed them! I didn't watch any TV, and only listened to classical music on the radio through the entire period. That'll show 'em.

As we are in a political season (and when aren't we?), we are inundated with the latest pontifications from pollsters. But can we trust the pollsters? Are they biased? Who rates the raters? I have an answer for that! Nate Silver is a prominent statistician who applies his science to meta-analysis - analyzing the analysis. Have a look at his webpage that rates the survey companies on how well they follow an unbiased protocol and on their accuracy. And check out this page for the latest compilation of presidential polls.

I don't know how I feel about these poll results

Opinion polls have one deficiency. In order to get a statistically significant sample size, you need to ask the opinions of a lot of people, and many of these people don't know or don't care. This is not the most efficient or reliable way to make predictions.

Let's say you had some reason to want to predict the outcome of the NBA playoffs. I dunno... maybe you had some sort of financial stake? (I assume you are like an owner or something... cuz betting on games is naughty.) One way to get a good prediction is to talk to some people who follow the basketball teams closely. Like me, for example. I can tell you, right off the top of my head, how many RBIs Peyton Manning had when he went up against Tiger Woods in the 2015 Stanley Cup. You definitely would want to get my opinions on Michael Phelps before you put money on Yankees to win the Superbowl!

(By the way, I advise against putting money on the Yankees for the Superbowl.)

The problem is... opinion polls don't take into account the expertise of the people being polled. I would argue that the opinion of ten experts is more reliable than the a good random sampling of 1,000 random people who are randomly clueless on the random topic.

You don't want the opinion of this random actor!

But, coming up with a panel of real experts on a random topic is a lot of work. Might there be another way that is almost as good?

Here's an interesting take... how about letting people tell you whether they are an expert? Oh. That's a bad idea. Ok, how about this... ask people to put their money where their mouth is?

Racetracks do this every day. And here is the interesting part: The odds on a horse are not based on the expert opinion of some expert. The odds at the racetrack are based entirely on crowdsourcing. When a lot of money has been bet on a given horse, the odds change. Curiously, the odds change in such a way as to make sure that the track makes money. What are the odds of the track making money!?!


You don't like racetracks and all the shady undesirables lurking around? I have an example of crowdsourcing where people declare their expertise with their checkbook. The stock market. If a lot of people bet on a given stock, the price goes up. If no one likes the company, the stock goes down. Each individual decides how much they are willing to pay to buy a stock, or how much they are willing to sell a stock for. Just like the racetrack, only with a different sort of shady undesirables hanging around.


Now I have set the stage for a clever idea: Let's say that your company is considering whether a given idea for a new product will pay off. You could give one person that job and hope he/she gets it right. You could get a committee on it, and watch the committee form sub-committees, do focus groups, pay for market research, etc. And two years later, one person will finally have to fire the committee and make the decision. Committees are always the best way to get decisions made fast.

Or (get ready for the cool idea!) you could set up a virtual stock market for your employees to invest fake money in a bunch of potential product ideas. By introducing money - even though it's fake - you get people to invest where they feel they have some expertise. And those who actually have that expertise will tend to invest "correctly" and then have more money with which to sway future ideas.

Of course, the details get a bit involved. There is some fancy math under the hood that is needed to simulate how the price of a stock goes up when you put money into it and goes down when you sell or short a stock. This math is called a "Market Maker". It has nothing to do with Maker's Mark, unfortunately.

The domain of mathcanics

There is a company in Milwaukee called IdeaWake that has developed some software to do all this. I'm happy to say that I helped them out, just a little bit.

Tuesday, September 13, 2016

The color of leaves

My burning bush, in the fall of 2009

I have a burning bush. Not the biblical kind, mind you. Euonymus alatus. The kind of bush that looks like a normal green bush for most of the summer, but then turns into a wild thing in the fall. (Discretion tells me this would be a good time to not mention my wife.)

Fall is coming. And my euonymus is doing it's magical chromatic transmogrification.

My burning bush, just starting to warm up

What better time to get out my spectrophotometer? Here are the leaves I measured - several spots on each of the lovely leaves.

Selected leaves from the bush

First step, I show the color in CIELAB values. This is an a*b* plot.

Color values (a*b*) of spots on the leaves

I look at this marvelous plot and it just makes me wonder "why"? What changes in the leaf to make this marvelous color change? I start by look at the reflectance spectra. This makes a cute plot, but I'm not sure I can gather much from it, other than verifying that there was a distinct color change. How about I look at the spectra?

Corresponding reflectance spectra

The reflectance spectra plot is a bit more interesting. From this, I can see three things. First, at the blue end of the spectrum, something is doing a whole lot of absorbing. Why do I say that? Because the reflectance is so low. Someone is stealing most of the blue photons! This is true of all the measurements, so I am going to say this is one pigment.

Second, I see that in the green leaves, there is something that absorbs a lot of light at the red end. It doesn't absorb as much in the green region.  Maybe it absorbs in the blue as well, but I can't tell. I'm going to call this a second pigment, and tentatively give it the clever name "green".

Third, in the red leaves, there is something that absorbs a whole bunch of green, but not much red. I'm going to tentatively name this proposed pigment "red". Again, a clever name choice on my part.

Now... I am going to make a bold assertion here. I think that as the leaf changes from green to red, the pigment "green" leaves the leaf and the pigment that I affectionately named "red" jumps in to replace it. Why do I say that? Note that the reflectance of the red leaves is pretty gosh darn high at 700 nm, but the really green leaves absorb a great deal of the light at 700 nm.  Clearly there isn't much left of whatever absorbs the 700 nm light. 

Despite not being a chemist, I am going to take the analysis one or two steps beyond my skill level. The reflectance spectra show a view that is useful for someone interested in the color of the leaves, since it looks at what the eye sees. But the reflectance view is not so useful to someone analyzing what the leaves is doing. For that, one would want to look at the absorbance spectra, AKA density spectra.

Absorbance spectra of leaves

There is no real magic math here. All I did was ask Excel to take the negative of the logarithm of each reflectance value. And what it gives me is a plot that is a gauge of the absorbed light. So, note that the "red" and "green" have been inverted like an euglena haplessly swimming on a microscope slide, oblivious to the fact that it is being watched.

Another nice feature of the absorbance plot is that it is kinda sorta a little bit additive. In other words, when you cut the concentration of a pigment in half, you kinda sort divide the absorbance in half. And even cooler, when you add two pigments together, you kinda sorta add the two absorbance spectra together. Need a bit more information on that? Check out my post on Beer's law.

With that knowledge in mind, I took a wild stab at what the spectra of three pigments might be, and  went further out on a limb to guess what the actual pigments might be. 

Plausible absorbance spectra of pigments in the leaves

Lignin is the brown pigment that makes grocery bag brown. Lignin is the bane of paper making. Paper mills go to great lengths to ask lignin to leave the pulp, cuz people like their paper to be white.  Did I mention that lignin is brown? I am pretty sure that lignin is in most all leaves, and this would account for the fact that all the leaves reflected very little light at the blue end of the spectrum. The lignin purloined the cerulean photons.

Chlorophyll is a pigment that everyone has heard of. This is what makes leaves green (by absorbing red and blue light) and is the active ingredient in photosynthesis (by using the energy absorbed of the red and blue light). Everything that I remember from elementary school science would be a lie if I didn't find chlorophyll in the leaves. I have proposed that chlorophyll absorbs a bunch of light at the blue end, but not a great deal. But this is just my guess.

And then we come to the red pigment. I am going to take a wild guess and say that the pigment is anthocyananin, mostly cuz I like the sound of it. And it makes it sound like the red leaves of a burning bush might provide you with all the anti-oxidants that keep you from getting into oxidants on the highway. Again, just a guess on my part.

The assignment of colors in the absorbance plot above is likely a bit confusing. I found myself getting confused. This is not an unusual condition for me. So, let's go back to the color scientist view, and show the reflectance plots of the plausible spectra of the three pigments.

Plausible absorbance spectra of pigments in the leaves

So. There you have it. Another discourse where I take a thing of beauty, the burning bush, and turn it into a lousy science lesson.