Saturday, March 21, 2020

Fun with numbers for March 21, 2020

Recycling some tweets on the third day of California shelter-in-place. Weather is nice:




I really don't like these "flatten the curve" diagrams posing as science



Maybe it’s just me, but this diagram strikes me as a number of unsupported unquantified statements presented as if it’s some sort of quantitative model based on real data
  1. Axes have labels but no scales… so all we can measure is the relative magnitudes. Is that high peak at (D,A) 1%, 10%, 25%, or 90% of the population? Does it happen in a week, a month, or a year?
  2. A/B = 415/110 so this undefined intervention lowers the peak by 73.5%. How many patients is that? Do these measures really slow down infection rates this much? Assuming that there’s no change to recovery speed, that’s a 4-fold reduction from an unidentified intervention.
  3. E/D = 475/280 so this undefined intervention delays the peak by 70%. So if D is a month, this delays the peak a further three weeks, not long enough for a vaccine; if D is a year, that’s another 8 months, presumably enough. 
  4. B is still greater than C, so what happens when the slowed-down process crosses over the health system capacity? Rationing/triage or does this mean bodies littering the streets? That depends on that (B-C)/C = (110-83)/83 or 33% over capacity, but what happens needs absolute numbers, not relative; since there are no numbers, there’s no real meaning.

All the calculations above are just to show that if we’re to take a chart seriously we need to have real numbers and real details, and the above figure is just a qualitative “let’s hope this works to convince people to wash hands and stay away from others” masquerading as a technical models.

BY ALL MEANS, WASH YOUR HANDS, DON’T TOUCH YOUR FACE, AND STAY AWAY FROM OTHERS, because that makes sense. I've been doing it for as far as I can remember.



The information we're getting is preliminary and we're treating it as dogma


From a study of Italian testing:


The internal consistency of this test is 75% (25% of the time the test doesn’t agree with itself in retesting); this doesn’t mean that the test is 75% accurate, because that’s measured relative to the underlying condition. This is an upper bound on the accuracy of the test, since we know that at least 25% of the time it's inaccurate for sure. (Sample size appears small, but for Medicine this is almost their version of "big data.")


A more general point about COVID19 testing


It's easy to show that missing covariates leads to panic-inducing overestimates. The following numbers are not COVID19 data, just an illustration


Sometimes I despair of what people try to do with small amounts of data, and then the sarcasm comes out:
How can anyone deny this calamity?! In less than two months the entire population of the Earth will test positive. 
In 100 days, over 8 trillion people will test positive. That's 5 times the total number of humans who've ever lived!!!! 



TSLA twitter, always good for a laugh



No matter what the stock does or at what price it's trading, Ross always says "buy." One wonders how he charges 2-and-20 to his clients to give advice of this quality.



Richard "Hamster" Hammond drives a Tesla Model X



And gets very excited at adding one mile every few seconds at a Tesla Supercharger. (We can see in the touchscreen that the Supercharger is delivering 65 kW and Tesla claims 310 Wh/mi,* so that would average out at about 16 seconds per mile of range.) Not to be a spoilsport, but a gas pump adds about 26 miles of range per second (3 l/s in a 35 MPG car).

Then there's a small blur fail that reveals Hammond isn't really driving under the speed limit:


That's okay, Mr. Hammond, no one else is either.

- - - - -
* If you believe that number, you're exactly the kind of investor I'm targeting with a new product structured mostly with 2020 pandemic cat bonds; act now, supplies are limited.**

** CYA statement: this is a facetious offer, expressing derision for Tesla's number, not a proffer of a tradable security structured from out-of-the-money cat bonds.



Some videos to watch while the economy tanks around us



Grant Sanderson of 3blue1brown gave a talk at Berkeley about having people engage with math. The gist is that people want relevance and/or a story. That's good advice, but I think 3B1B's problem is that his audience is self-selected. In other words, that's how you engage an audience that's predisposed to look for and watch math videos. Still, good points.



Experimentboy is back, with thermal cameras. Very fun stuff.



PhysicsGirl suggests fun experiments to keep us from losing our minds while we wait to be moved to FEMA camps or be turned into Soylent Green.


YouTube affords the überdorks amongst us the opportunity to watch talks waaaaay above our expertise, something that in real life would be embarrassing, not to mention logistically difficult. So here are some links to:

Caltech. MIT-West, as some people who went to a technical school in Massachusetts call it.

Stanford Institute for Theoretical Physics. Fair warning: Susskind eats cookies when he talks, so there's spraying in some videos (all Susskind videos, really).

Institute for Advanced Studies at Princeton.

Nasa Jet Propulsion Laboratory.

Art talks at Le LouvreMusée D'Orsay, the British Museum, the Smithsonian Institution, and the Museum of Fine Arts in Boston, a small town in a hard-to-spell state




Live long and prosper.

Sunday, March 15, 2020

Fun with geekage while social distancing for March 15, 2020

(I'm trying to get a post out every week, as a challenge to produce something intellectual outside of work. Some* of this is recycled from Twitter, as I tend to send things there first.)


Multicriteria decision-making gets a boost from Covid-19



A potential upside (among many downsides) of the coronavirus covid-19 event is that some smart people will realize that there's more to life choices than a balance between efficiency and convenience and will build [for themselves if not the system] some resilience.

In a very real sense, it's possible that PG&E's big fire last year and follow-up blackouts saved a lot of people the worst of the new flu season: after last Fall, many local non-preppers stocked up on N95 masks and home essentials because of what chaos PG&E had wrought in Northern California.



Anecdotal evidence is a bad source for estimates: coin flips


Having some fun looking at small-numbers effects on estimates or how unreliable anecdotal evidence really can be as a source of estimates.

The following is a likelihood ratio of various candidate estimates versus the maximum likelihood estimate for the probability of heads given a number of throws and heads of a balanced coin; because there's an odd number of flips, even the most balanced outcome is not 50-50:


This is an extreme example of small numbers, but it captures the problem of using small samples, or in the limit, anecdotes, to try to estimate quantities. There's just not enough information in the data.

This is the numerical version of the old medicine research paper joke: "one-third of the sample showed marked improvement; one-third of the sample showed no change; and the third rat died."

Increasing sample size makes for better information, but can also exacerbate the effect of a few errors:


Note that the number of errors necessary to get the "wrong" estimate goes up: 1 (+1/2), 3, 6.



Context! Numbers need to be in context!



I'm looking at this pic and asking myself: what is the unconditional death rate for each of these categories; i.e. if you're 80 today in China, how likely is it you don't reach march 15, 2021, by all causes?

Because that'd be relevant context, I think.



Estimates vs decisions: why some smart people did the wrong thing regarding Covid-19



On a side note, while some people choose to lock themselves at home for social distancing, I prefer to find places outdoors where there's no one else. For example: a hike on the Eastern span of the Bay Bridge, where I was the only person on the 3.5 km length of the bridge (the only person on the pedestrian/bike path, that is).




How "Busted!" videos corrupt formerly-good YouTube channels


Recently saw a "Busted!" video from someone I used to respect and another based on it from someone I didn't; I feel stupider for having watched the videos, even though I did it to check on a theory. (Both channels complain about demonetization repeatedly.) The theory:


Many of these "Busted!" videos betray a lack of understanding (or fake a lack of understanding for video-making reasons) of how the new product/new technology development process goes; they look at lab rigs or technology demonstrations and point out shortcomings of these rigs as end products. For illustration, here's a common problem (the opposite problem) with media portrayal of these innovations:


It's not difficult to "Bust!" media nonsense, but what these "Busted!" videos do is ascribe the media nonsense to the product/technology designers or researchers, to generate views, comments, and Patreon donations. This is somewhere between ignorance/laziness and outright dishonesty.

In the name of "loving science," no less!



Johns Hopkins visualization makes pandemic look worse than it is



Not to go all Edward Tufte on Johns Hopkins, but the size of the bubbles on this site makes the epidemic look much worse than it is: Spain, France, and Germany are completely covered by bubbles, while their cases are
0.0167 % for Spain
0.0070 % for Germany
0.0067 % for France
of the population.



Cumulative numbers increase; journalists flabbergasted!



At some point someone should explain to journalists that cumulative deaths always go up, it's part of the definition of the word "cumulative." Then again, maybe it's too quantitative for some people who think all numbers ending in "illions" are the same scale.



Stanford Graduate School of Education ad perpetuates stereotypes about schools of education


If this is real, then someone at Stanford needs to put their ad agency "in review." (Ad world-speak for "fired with prejudice.")





Never give up; never surrender.


- - - - -
* All.

Friday, March 6, 2020

Fun with numbers (and other geekage) for March 6, 2020

More collected tweeterage and other social media detritus.


MSNBC doesn't care about getting numbers right


And water is wet and fire burns... Okay, this one is particularly egregious. It starts on twitter, with a person who doesn't understand the difference between millions and trillions:


But then, Brian Williams and NYT Editorial Board member Mara Gay put it up in a discussion of Bloomberg's failed presidential bid, and agree with it (video here):


The problem here isn't so much that anchors and producers at MSNBC can't do this basic math, it's that they don't care enough about getting the numbers right to ask a fact-checker to check them. Note that they had the graphic made in advance, and this was a scripted segment, so they didn't just extemporize and made an error. They didn't care enough about the numbers to check them.

And, given their response, they still don't care. This is sad.



A puzzle that's going around, solved correctly


Saw this on Twitter, and a lot of snark with it:


Apparently some people have difficulty with this puzzle, drawing a line in B that's parallel to the bottom of the bottle (perhaps they think the water is frozen?). But many of the people who mock those who draw that parallel line draw a horizontal line that is too low, creating a triangle.

Here's the correct solution:


As with all math problems, even very simple ones like this, the right approach is to do the math, not to try to guess and hand-wave your way to a probably-wrong solution.



In their haste to badmouth Millennials, finance researchers misstate their results


I saw this "Millennials are bad with money" article on Yahoo Finance, got the original report (PDF), and found a glaring problem with their data. (The table notes make it clear they're saying a conjunction, 'AND,' not a 'GIVEN THAT' conditional.)


My guess is that despite the table notes and the 'AND,' what they're measuring is the proportion of people who answered the three questions correctly GIVEN THAT they self-described as having high finance literacy, I.O.W. that's 19% of the 62%, not 19% of the 9041 Millennials. That would make the population in the conjunction 1065, whereas the number of people who got the three right answers is 1447; so about 4% of Millennials are money-smart[ish] but think they aren't.

But if you're going to get snarky about other people's issues with money, maybe write your tables and table notes a bit more carefully…

About the financial literacy of Millennials, these were the three multiple-choice questions:
Suppose you had $\$100$ in a savings account, and the interest rate was 2% per year. After 5 years, how much do you think you would have in the account if you left the money to grow? Answers: a) More than $\$102$; b) Exactly $\$102$; c) Less than $\$102$; d) Do not know; e) Refuse to answer. 
Imagine that the interest rate on your savings account was 1% per year and inflation was 2% per year. After 1 year, how much would you be able to buy with the money in this account? Answers: a) More than today; b) Exactly the same; c) Less than today; d) Do not know; e) Refuse to answer. 
Please tell me whether this statement is true or false. “Buying a single company’s stock usually provides a safer return than a stock mutual fund.” Answers: a) True; b) False; c) Do not know; d) Refuse to answer.
These questions are extremely simple, which makes the low incidence of correct answers troubling.



Science illustration lie factor: 71 million


How bad can science illustrations get? Let's ask the Daily Express from the UK:


We don't need to calculate to see that that meteor is much larger than 4.1 km, but if we do calculate (I did), we realize they exaggerated the volume of that meteor by just a hair under SEVENTY-ONE MILLION-FOLD:


To put that lie factor into perspective, here's the Harvester Mothership from Independence Day: Resurgence, which has only a lie factor of 50 (linear, because that's the dimensionality of the problem here):




Fun with our brains: the Stroop interference test


From a paper on the effect of HIIT and keto on BDNF production and cognitive performance that intermittent fasting and low carb advocate (and responsible for at least 50% of my fat loss) P.D. Mangan shared on twitter, we learn that people with metabolic syndrome show improvement on their cognitive executive function when on a ketogenic diet and even more if interval training is used.

To measure cognitive executive function they use a Stroop interference test, which is a fun example of our brains' limitations, so here's an example:


The test compares the speed with which participants can state the colors of the words in the columns inside the box: on the left the color and the word are congruent (the word is the name of the color of the text for that word), on the right the color and the word are incongruent (the word is the name of a color, but not the color of the text for that word).

Other than color-blind people, almost everyone takes less time and makes fewer mistakes with the congruent than the incongruent column. That's because the brain CEO (executive function) has to stop the reading and process color in the case of incongruent. This is easy to see if one compares the test with the two extras: speed of the incongruent is about the same as that of reading the words in Extra 1 column, while the speed of stating the colors of the Extra 2 column is much faster (and less error-prone) than that of the incongruent column.

(The paper also measures BDNF, the chemical usually associated with better executive function, directly, by drawing blood and doing an ELISA test; but it's interesting to know that diet and exercise may make you a more disciplined thinker and to see that in the numbers for an actual executive function test, not just the serum levels.)




Technically, Target isn't lying, it's 4 dollars off



But I've never seen that $\$$11.99 'regular' price for this coffee, which would make it the only coffee in the entire aisle not to have a regular price of $\$$9.99. All the other sale signs say 'Save $\$$2,' for what it's worth…



Destin 'Smarter Every Day' Sandlin visits a ULA rocket factory



And, on twitter, ULA CEO Tory Bruno gets a dig into SpaceX's Texas operations:




Live long and prosper!

Sunday, March 1, 2020

Fun with COVID-19 Numbers for March 1, 2020

NOTA BENE: The Coronavirus COVID-2019 is a serious matter and we should be taking all reasonable precautions to minimize contagion and stay healthy. But there's a lot of bad quantitative thinking that's muddling the issue, so I'm collecting some of it here.


Death Rate I: We can't tell, there's no good data yet.


This was inspired by a tweet by Ted Naiman, MD, whose Protein-to-Energy ratio analysis of food I credit for at least half of my weight loss (the other half I credit P. D. Mangan, for the clearest argument for intermittent fasting, which convinced me); so this is not about Dr Naiman's tweet, just that his was the tweet I saw with a variation of this proposition:

"COVID-19 is 'like the flu,' except the death rate is 30 to 50 times higher."

But here's the problem with that proposition: we don't have reliable data to determine that. Here are two simple arguments that cast some doubt on the proposition:

⬆︎ How the death rate could be higher: government officials and health organizations under-report the number of deaths in order to contain panic or to minimize criticism of government and health organizations; also possible that some deaths from COVID-19 are attributed to conditions that were aggravated by COVID-19, for example being reported as deaths from pneumonia.

⬇︎ How the death rate could be lower: people with mild cases of COVID-19 don't report them and treat themselves with over-the-counter medication (to avoid getting taken into forced quarantine, for example), hence there's a bias in the cases known to the health organizations, towards more serious cases, which are more likely to die.

How much we believe the first argument applies depends on how much we trust the institutions of the countries reporting, and... you can draw your own conclusions!

To illustrate the second argument, consider the incentives of someone with flu-like symptoms and let's rate their seriousness or aversiveness, $a$, as a continuous variable ranging from zero (no symptoms) to infinity (death). We'll assume that the distribution of $a$ is an exponential, to capture thin tails, and to be simple let's make its parameter $\lambda =1$.

Each sick patient will have to decide whether to seek treatment other than over-the-counter medicine, but depending on the health system that might come with a cost (being quarantined at home, being quarantined in "sick wards," for example); let's call that cost, in the same scale of aversiveness, $c$.

What we care about is how the average aversiveness that is reported changes with $c$. Note that if everyone reported their $a$, that average would be $1/\lambda = 1$, but what we observe is a self-selected subset, so we need $E[a | a > c]$, which we can compute easily, given the exponential distribution, as

\[
E[a | a > c]
=
\frac{\int_{c}^{\infty} a \, f_A(a) da }{1 - F_A(c)}
=
\frac{\left[ - \exp(-a)(a+1)\right]^{\infty}_{c}}{\exp(-c)}
= c + 1
\]
Note that the probability of being reported is $\Pr(a>c) = \exp(-c)$, so as the cost of reporting goes up, a vanishingly small percentage of cases are reported, but their severity increases [linearly, but that's an artifact of the simple exponential] with the cost. That's the self-selection bias in the second argument above.

A plot for $c$ between zero (everyone reports their problems) and 5 (the cost of reporting is so high that only the sickest 0.67% risk reporting their symptoms to the authorities):


Remember that for all cases in this plot the average aversiveness/seriousness doesn't change: it's fixed at 1, and everyone has the disease, with around 63% of the population having less than the average aversiveness/seriousness. But, if the cost of reporting is, for example, equal to twice the aversiveness of the average (in other words, people dislike being put in involuntary quarantine twice as much as they dislike the symptoms of the average seriousness of the disease), only the sickest 13.5% of people will look for help from the authorities/health organizations, who will report a seriousness of 3 (three times the average seriousness of the disease in the general population).*

With mixed incentives for all parties involved, it's difficult to trust the current reported numbers.


Death Rate II: Using the data from the Diamond Princess cruise ship.


A second endemic problem is arguing about small differences in the death rate, based on small data sets. Many of these differences are indistinguishable statistically, and to be nice to all flavors of statistical testing we're going to compute likelihood ratios, not rely on simple point estimate tests.

The Diamond Princess cruise ship is as close as one gets to a laboratory experiment in COVID-19, but there's a small numbers problem. In other words we'll get good estimates when we have large scale, high-quality data. Thanks to @Clarksterh on Twitter for the idea.

Using data from Wikipedia for Feb 20, there were 634 confirmed infections (328 asymptomatic) aboard the Diamond Princess and as of Feb 28 there were 6 deaths among those infections. The death rate is 6/634 = 0.0095.

(The ship's population isn't representative of the general population, being older and richer, but that's not what's at stake here. This is about fixating on the point estimates and small differences thereof. There's also a delay between the diagnosis and the death, so these numbers might be off by a factor of two or three.)

What we're doing now: using $d$ as the death rate, $d = 0.0095$ is the maximum likelihood estimate, so it will give the highest probability for the data, $\Pr(\text{6 dead out of 634} | d = 0.0095)$. Below, we calculate and plot the likelihood ratio between that probability and the computed probability of the data for other candidate death rates, $d_i$.**

\[LR(d_i) = \frac{\Pr(\text{6 dead out of 634} | d = 0.0095)}{\Pr(\text{6 dead out of 634} | d = d_i)}\]


We can't reject any rates between 0.5% and 1.5% with any confidence (okay, some people using single-sided point tests with marginal significance might narrow that a bit, but let's not rehash old fights here), and that's a three-fold range. And there are still a lot of issues with the data.

On the other hand...

It's easy to see that the COVID-19 death rate is much higher than that of the seasonal flu (0.1%): using the data from the Diamond Princess, the $LR(0.001) =  3434.22$, which should satisfy both the most strong-headed frequentists and Bayesians that these two rates are different. Note that $LR(0.03) = 510.01$, which also shows that with the data above the Diamond Princess invalidates the 3% death rate. (Again, noting that the numbers might be off by a factor of two or three in either direction due to the delay in diagnosing the infection and between diagnosis and recovery or death.)

As with most of these analyses, disaggregate clinical data will be necessary to establish these rates, which we're estimating from much less reliable [aggregate] epidemiological data.



Stay safe: wash hands, don't touch your face, avoid unnecessary contact with other people. 



- - - - - 

* A friend pointed out that there are some countries or subcultures where hypochondria is endemic and that would lead to underestimation of the seriousness of the disease; this model ignores that, but anecdotally I've met people who get doctor's appointments because they have DOMS and want the doctor to reassure them that it's normal, prescribe painkillers and anti-inflammatories, and other borderline psychotic behavior...


** We're just computing the binomial here, no assumptions beyond that:

$\Pr(\text{6 dead out of 634} | d = d_i) = C(634,6) \, d_i^6 (1-d_i)^{628}$,

and since we use a ratio the big annoying combinatorials cancel out.