## Posts

Recent posts

### An Island of Liars is an Ensemble of Experts

In my previous post I looked at how a group of experts may be combined into a single, more powerful, classifier which I call NaiveBoost after the related AdaBoost. I'll illustrate how it can be used with a few examples.

Label a "yes" as +1, and "no" as -1. We ask our question, which has some unknown +1/-1 answer $$L$$, and get back a set of responses (labels) $$S = \{L_i \}$$, where $$L_i$$ is the response from expert $$i$$. Observe we have \Pr(S | L=+1) = \prod_{i} {p_i}^{\frac{L_i+1}{2}} \cdot {(1-p_i)}^\fra… ### Simplified Multinomial Kelly Here's a simplified version for optimal Kelly bets when you have multiple outcomes (e.g. horse races). The Smoczynski & Tomkins algorithm, which is explained here (or in the original paper): https://en.wikipedia.org/wiki/Kelly_criterion#Multiple_horses Let's say there's a wager that, for every 1 you bet, will return a profit of b if you win. Let the probability of winning be $$p$$, and losing be $$q=1-p$$. The original Kelly criterion says to wager only if $$b\cdot p-q > 0$$ (the expected value is positive), and in this case to wager a fraction $$\frac{b\cdot p-q}{b}$$ of your bankroll. But in a horse race, how do you decide which set of outcomes are favorable to bet on? It's tricky, because these wagers are mutually exclusive i.e. you can win at most one. It turns out there's a simple and intuitive method to find which bets are favorable: 1) Look at $$b\cdot p-q$$ for every horse. 2) Pick any horse for which $$b\cdot p-q > 0$$ and mark "bet&quo… ### Notes on Setting up a Titan V under Ubuntu 17.04 I recently purchased a Titan V GPU to use for machine and deep learning, and in the process of installing the latest Nvidia driver's hosed my Ubuntu 16.04 install. I was overdue for a fresh install of Linux, anyway, so I decided to upgrade some of my drives at the same time. Here are some of my notes for the process I went through to get the Titan V working perfectly with TensorFlow 1.5 under Ubuntu 17.04. Old install: Ubuntu 16.04 EVGA GeForce GTX Titan SuperClocked 6GB 2TB Seagate NAS HDD + additional drives New install: Ubuntu 17.04 Titan V 12GB / partition on a 250GB Samsung 840 Pro SSD (had an extra around) /home partition on a new 1TB Crucial MX500 SSD New WD Blue 4TB HDD + additional drives You'll need to install Linux in legacy mode, not UEFI, in order to use Nvidia's proprietary drivers for the Titan V. Note that Linux will cheerfully boot in UEFI mode, but will not load any proprietary drivers (including Nvidia's). You'll need proprietary drivers for Tens… ### Solving IMO 1989 #6 using Probability and Expectation IMO 1989 #6: A permutation $$\{x_1, x_2, \ldots , x_m\}$$ of the set $$\{1, 2, \ldots , 2n\}$$, where $$n$$ is a positive integer, is said to have property $$P$$ if $$| x_i - x_{i+1} | = n$$ for at least one $$i$$ in $$\{1, 2, ... , 2n-1\}$$. Show that for each $$n$$ there are more permutations with property $$P$$ than without. Solution: We first observe that the expected number of pairs $$\{i, i+1\}$$ for which $$| x_i - x_{i+1} | = n$$ is $$E = 1$$. To see this note if $$j$$, $$1 \leq j \leq n$$, appears in position $$1$$ or $$2n$$ it's adjacent to one number, otherwise two. Thus the probability it's adjacent to its partner $$j+n$$ in a random permutation is \[\begin{equation} \eqalign{ e_j &= \frac{2}{2n}\cdot \frac{1}{2n-1} + \frac{2n-2}{2n}\cdot \frac{2}{2n-1} \\ &= \frac{2(2n-1)}{2n(2n-1)} \\ &= \frac{1}{n}. } \end{equation} By linearity of expectation we overall have the expected number of $$j$$ adjacent to its partner $$j+n$$ is $$\sum_{j=1}^{n} e_j = n… ### Poisson Games and Sudden-Death Overtime Let's say we have a game that can be reasonably modeled as two independent Poisson processes with team \(i$$ having parameter $$\lambda_i$$. If one team wins in regulation with team $$i$$ scoring $$n_i$$, then it's well-known we have the MLE estimate $$\hat{\lambda_i}=n_i$$. But what if the game ends in a tie in regulation with each team scoring $$n$$ goals and we have sudden-death overtime? How does this affect the MLE estimate for the winning and losing teams?

Assuming without loss of generality that team $$1$$ is the winner in sudden-death overtime. As we have two independent Poisson processes, the probability of this occurring is $$\frac{\lambda_1}{\lambda_1 + \lambda_2}$$. Thus, the overall likelihood we'd like to maximize is $L = e^{-\lambda_1} \frac{{\lambda_1}^n}{n!} e^{-\lambda_2} \frac{{\lambda_2}^n}{n!} \frac{\lambda_1}{\lambda_1 + \lambda_2}.$ Letting $$l = \log{L}$$ we get \[l = -{\lambda_1} + n \log{\lambda_1} - {\lambda_2} + n \log{\lambda_2} - 2 \log{n!} …