Buy Adrienne Howley's The Naked Buddha. It's a guide to living, not a guide to theology. There is (almost) no religion in there. For more information, also see the Dalai Lama — and some of his advice on dying.

The Top 3 Movies of The Last 5 Years

All happen to be documentaries or near-documentaries, and all are on netflix and amazon. Don't look it up. Let yourself be surprised.
  1. The People Vs. Fritz Bauer (Der Staat gegen Fritz Bauer)
  2. Icarus
  3. Alphago

free speech

Als die Nazis die Kommunisten holten, habe ich geschwiegen; ich war ja kein Kommunist.
Als sie die Sozialdemokraten einsperrten, habe ich geschwiegen; ich war ja kein Sozialdemokrat.
Als sie die Gewerkschafter holten, habe ich nicht protestiert; ich war ja kein Gewerkschafter.
Als sie die Juden holten, habe ich geschwiegen; ich war ja kein Jude.
Als sie mich holten, gab es keinen mehr, der protestierte.


As an expert, I often opine on whether boycotts have much chance of success. (A: Typically No.) I don't usually opine about the merits of causes.

But I do want to opine on BDS against Israel. If I were Palestinian, I would protest, too. Palestinians should have equal rights in a modern society, but there are laws discriminating against them. (No—it is not even close to Apartheid.) If I were Palestinian, I would protest peacefully and work to win hearts and minds of most Israelis—like Gandhi and King won the hearts and minds of all people. Heck, I would join such a movement myself today. And it escapes me how Hamas thinks that they are helping their people. They have no chance of winning and are only making matters worse. They need to convince the hearts and minds of the Israeli voters. Give them better alternatives. And for the record. I detest the nationalist and racist rhetoric of the Israeli governing coalition, too.

However, the wider BDS movement drips with anti-semitism. I will join the BDS movement just as soon as it prioritizes the treatment of Yazidis in Syria, Baha'i's in Iran, Shia in Saudi Arabia, Ahmadis in Pakistan, Wiegers in China, immigrants from Latin America, and all in North Korea. (And where are the Jews in the Arab countries?) Now, Israel is a fine target...but as #170 out of the 200 countries in the world today, not as #1.

Even in the 21st Century, do the Arabs really still need the Jews as scapegoats to hold themselves together? Don't they have more pressing problems, like womens' rights, independent courts, freedom of religion (and conversion), and free press?


I am a heavy user of ubuntu linux, emacs24, pdflatex, ssh, apache2, and the Google infrastructure (gmail, docs, etc.). I program primarily in perl, C, and R (but am keeping an eye on Julia), occasionally in php, C++, mysql, javascript, and a number of other languages. I use Mathematica. This website was created in jekyll.

I use OSX because I like Apple's iMac 5K. MacOS (OSX) itself is mediocre. Nice GUI, but rotten underpinnings (file system, package manager, etc.). Macs used to be the computer for sophisticated users. This has sadly deteriorated since Snow Leopard. The time will come when I will switch.

I use Android, with a strong preference for vanilla Google Nexus Android. This is because I live in the Google infrastructure. I like the iPad Pro, but not the iPhones. iPhones are ok, but not particularly outstanding or worth the price.

I have written a perl parser for latex called iawltxhtml (download here). It is a good start for a clean parser of latex code into useful html/epub code. It comes in a very large zip file, primarily because it contains the source and results for four example fame jagazines on which I used it (many large images!). iawltxhtml is not documented or supported, but it contains a lot of working code based on days of experimentation of how to successfully parse code into useful html, with css, math, images, flexibility as to whether the resulting file is pdf or html, etc.

A hack for pandoc to work with multicolumn tables and to format numeric input.

one-pass OLS

Used often, here is a <100-line one-pass OLS implementation in C++ for two variables. biols.hh, with standard errors, univariate means and sds, etc. For large data sets, biols could become numerically unstable, but it is very fast. The usage could not be simpler. The code in test() illustrates this. Start with

         #include <biols.h>
         int main() { BIOLS bcalc; bcalc.test(); }


glycohemoglobin (A1C) by age (diabetes and prediabetes)

Glycohemoglobin (A1C) blood levels are often classified as normal below 5.7, as pre-diabetes between 5.7 and 6.5, and as full diabetes above 6.5. From what I have read, coronary diseases are the principal problem caused by high glucose.

Because my own A1C levels are classified as "pre-diabetes," I was interested in how unusual my level was for my age. Fortunately, the CDC offers population statistics on A1C in its National Health and Nutrition Examination Survey (NHANES). There is data on about 60,000 individuals with reported A1C levels. The following plot shows the unconditional distribution of A1C levels by age. Dots are individuals (possibly many), and the lines show the more informative smoothed important percentiles, by age.

plot of a1c levels by age
  • Warning: I am not a medical expert, much less a physician. I am an economist and data scientiest. Do not consider any of the material here as medical advice.
  • By the "fixed doctor cutoffs," one quarter of the population is diagnosed with pre-diabetes by age 40, half just before age 60, and two-thirds by age 70. The fact that this is so common does not negate the potential harmful effects of A1C.
  • Just before age 70, A1C reaches its highest levels among surviving participants in the study. At this age, one in five individuals has full-blown diabetes, and two more have pre-diabetes.
  • With many additional wild assumptions on the nature of these not-so-random samples and how mortality influences dropping out from this sample, we can take a wild guess at the correlation (not causation!) of A1C with life expectancy. For individuals above the 90% level (who often have other health issues, too!), it could be on the order of years. For individuals below the 90% level, it seems more modest, less than a year. But don't get carried away. There is tremendous variation in mortality within all ages regardless of A1C! This is easier to see if you click on the figure to download the a1c.pdf file, which can give you a better idea of where the 60,000 individuals are located in the plot.
  • A simple regression can further show that caucasians have A1C levels of about 0.3 lower than Mexicans and Blacks; and men have A1C levels about 0.1 higher than women. Because of the way the CDC samples, if you want to know where you are in "your" distribution, you can add 0.15 (to your own A1C values) if you are Mexican or Black and subtract 0.15 if you are Caucasian; and add 0.05 if you are male and subtract 0.05 if you are female. If you are all of the above, good for you.
  • The program that generates this plot is a1c.R. The data is in file a1c.csv.gz, which itself was based on NHANES files DEMO.XPT, DEMO_C.XPT, DEMO_E.XPT, DEMO_G.XPT, DEMO_I.XPT, GHB_E.XPT, GHB_G.XPT, GHB_I.XPT, L10_C.XPT, DEMO_B.XPT, DEMO_D.XPT, DEMO_F.XPT, DEMO_H.XPT, GHB_D.XPT, GHB_F.XPT, GHB_H.XPT, L10_B.XPT, LAB10.XPT. Thanks to Bryan Tysinger from USC to help me locate the right data.

avery labels ruler

If you ever need to photograph your moles in order to compare their changes over time, the avery ruler stickers will help you. You need to purchase Avery 58160 stickers for your laser printer, each page of which has 3 times 10 labels. Then just print the avery ruler (or avery ruler w/o copyright) stickers over them, write the location where you attach them, affix them to your skin, and snap your photograph. If you are curious, you can also download the avery-ruler.tex file. You may want to download Avery's copyrighted 58160 template file, too, but it's not necessary. Just remove the overlay pdf.