Loading [MathJax]/jax/output/HTML-CSS/jax.js

20 June, 2015

The Delta Method for a Confidence Interval for Odds

In my previous post, I discussed using Wald theory and maximum likelihood to get a confidence interval for a batting average, θ. What if I want a function of that parameter instead?

Odds


Let's say that instead of a batting average θ, I want the odds of getting a hit. To get the odds of a hit, apply the function

g(θ)=θ1θ

So for example, a batter with a true θ=0.250 will have odds g(0.250)=0.250/0.750=1/3, or one to three odds of getting a hit.

Delta Method


Suppose we have some estimator ˆθ that converges to a normal distribution with variance σ2 - that is,

ˆθN(θ,σ2)

For example, assuming independent and identical at-bats, the sample batting average converges to a normal distribution

ˆθN(θ,θ(1θ)n)

then statistical theory says that any function g(ˆθ), assuming the first derivative exists and is nonzero, has distribution

g(ˆθ)N(g(θ),[g(θ)]2σ2)

This gives us a handy way to calculate confidence intervals for functions of parameters, if we can calculate a confidence interval for the parameter itself.

Back to Odds of Getting a Hit


If we define the odds function as above, then the first derivative is given by

g(θ)=1(1θ)2

and so the distribution of the sample batting odds g(ˆθ) converges to a normal distribution with mean g(θ) and variance

[g(θ)]2σ2=[1(1θ)2]2[θ(1θ)n]=θn(1θ)3

And so a confidence interval for the odds of a hit, given the sample batting average ˆθ, is given by

(ˆθ1ˆθ)±zˆθn(1ˆθ)3

where z is an appropriate quantile from the normal distribution.

Let's take our batter above, and suppose a ˆθ=0.250 batting average in n=40 at-bats. Then a 95% confidence interval for the odds of getting a hit is given by

(0.25010.250)±1.960.25040(10.250)3=(0.095,0.572)

A fairly wide interval - but then again, n=40 at-bats isn't much information to work on. If it were instead n=400 at-bats, the interval would be

(0.25010.250)±1.960.250400(10.250)3=(0.258,0.409)

Which is much smaller, and much more useable.

The code I used to generate these results may be found on my github.

No comments:

Post a Comment