Publications by Matt Asher
Fake text generation the wrong way, and a contest
As part of a bigger project, I needed to simulate a text string based on a source document, but at the character level. Just in case people find the code useful, I’ve uploaded it to MCMCtext.r. In my simulated text, each character is chosen based on the transition probabilities in the source text from one character to another. The result is (ne...
1615 sym
Landmine detection revisited; the inverse unicorn problem
A couple weeks ago I wrote about an interesting idea to clear landmines using the power of the wind. A reader asked me to comment more on the value of using these wind-powered “Kafons” to do an initial assay of a suspected minefield, an idea I mentioned at the end of my video on the subject. In particular, how good would the devices be at det...
4856 sym 4 img
Population simulation leads to Valentine’s Day a[R]t
Working on a quick-and-dirty simulation of people wandering around until they find neighbors, then settling down. After playing with the coloring a bit I arrived at the above image, which I quite like. Code below: # Code by Matt Asher for statisticsblog.com # Feel free to modify and redistribute, but please keep this notice maxSettlers = 150000...
633 sym R (1884 sym/1 pcs) 2 img
What’s my daughter listening to? HTML chart gen in R
My daughter, who turns 10 in April, has discovered pop music. She’s been listing to Virgin Radio 99.9, one of our local stations. Virgin provides an online playlist that goes back four days, so I scraped the data and brought it into R. The chart shown at top shows all of the songs played from February 17th through the 20th, listed by frequency....
2176 sym
Statistical computation in JavaScript — am I nuts?
Over the past couple weeks, I’ve been considering alternatives to R. I’d heard Python was much faster, so I translated a piece of R code with several nested loops into Python (it ran an order of magnitude faster). To find out more about Mathematica 9, I had an extended conversation with some representatives from Wolfram Research (Mathematica ...
4514 sym R (563 sym/2 pcs)
Review of Mathematica 9 and R-link
VIDEO TRANSCRIPT: Hello, this is Matt Asher from StatisticsBlog.com. I’m going to be reviewing Mathematica 9, from Wolfram Research. In particular, I’ll be focusing on using it with R and to do Monte Carlo simulations and other statistical work. You can find a full transcript of this video at my blog, including the source code and links to al...
11158 sym R (2572 sym/22 pcs)
High Obesity levels found among fat-tailed distributions
In my never ending quest to find the perfect measure of tail fatness, I ran across this recent paper by Cooke, Nieboer, and Misiewicz. They created a measure called the “Obesity index.” Here’s how it works: Step 1: Sample four times from a distribution. The sample points should be independent and identically distributed (did your mind just...
1412 sym Python (2058 sym/1 pcs) 6 img
Uncovering the Unreliable Friend Distribution
Head down to your local hardware store and pick up a smoke detector. Pop off the cover and look inside. You’ll see a label that mentions Americium 241, a radioactive isotope. Put on your HEV suit, grab a pair of tweezers and a fine-tipped pen, and remove the 0.3 millionths of a gram of Americium. If you need reading glasses, now might be a good...
9473 sym R (2594 sym/1 pcs) 68 img
The hat trick
In his book Quantum Computing Since Democritus, Scott Aaronson poses the following question: Suppose that you’re at a party where every guest is given a hat as they walk in. Each hat has either a pineapple or a watermelon on top, picked at random with equal probability. The guests don’t get to see the fruit on their own hats, but they can se...
4608 sym R (1004 sym/1 pcs) 4 img
Labor day distribution fun
Pinned, entropy augmented, digitally normal distribution, of no particular work-related use and thus perfectly suitable for today. Code in R: iters = 1000 sd = 2 precision = 20 results = rep(0,iters) for(i in 1:iters) { x = floor(rnorm(20,5,sd) %% 10) results[i] = paste(c('.',x),sep="",collapse="") } results = as.numeric(results) plot(densi...
561 sym R (254 sym/1 pcs) 2 img