# How to obtain the Standard Deviation of a ratio of independent binomial random variables?

X and Y are 2 independent binomial random variables with parameters (n,p) and (m,q) respectively. (trials, probability parameter)

-
Isn't there positive probability that this ratio is undefined? – guy Aug 27 '11 at 4:30

In essence you are asking for the distribution of the variable Z = X/Y, where Z can take values in $\left\{ 0, \frac{1}{m}, \ldots, \frac{n}{1}, \infty \right\}$, where the fractions are of the form $\frac{k}{l}$ with $0 \leq k \leq n$, and $1 \leq l \leq m$, and I'm assuming the convention $\frac{k}{0} = \infty$, which as Guy pointed out means this will be undefined, and the standard deviation will be infinite. So instead condition that this cannot happen $$\mathbb{P}\left[Z = k/l | Y \neq 0 \right] = \frac{\mathbb{P}[Xl = YK \cap Y \neq 0]}{\mathbb{P}[Y \neq 0]}$$ So then this gives, \begin{align} \mathbb{P}\left[Z = k/l | Y \neq 0 \right] & = (1- (1-q)^m) \mathbb{P}[ Xl = Yk \cap Y \neq 0]\\ & = (1-(1-q)^m) \sum p^i(1-p)^{(n-i)}q^j(1-q)^{(m-j)} \end{align} where the sum is over all pairs $(i,j)$ with $0 \leq i \leq n$, $0 < j \leq m$ such that $i/j = k/l$... All in all it looks like its going to be a messy task to compute this sum, and to find the standard deviation.

-

If $n$ and $m$ go to infinity while $p$ and $q$ are fixed, then the ratio $R=X/Y$ is well defined on an event of probability $1-o(1)$.

On this event (or conditionally on this event, since the two asymptotically equivalent), Edgeworth expansions of $X$ and $Y$ show that the expectation of $R$ behaves like $\dfrac{np}{mq}$ and that its variance behaves like $$\left(\frac{np}{mq}\right)^2\left(\frac{1-p}{np}+\frac{1-q}{nq}\right).$$

-

There probably isn't a closed-form formula for this.

But $X$ has mean $np$ and standard deviation $\sqrt{np(1-p)}$, and $Y$ has mean $mq$ and standard deviation $mq(1-q)$.

Now you need a simple fact: if $X$ has mean $\mu$ and standard deviation $\sigma$, then $\log X$ has mean approximately $\log \mu$ and standard deviation approximately $\sigma/\mu$. This can be derived by Taylor expansion. Intuitively, $X$ "usually" falls in $[\mu-\sigma, \mu+\sigma]$ and so $\log X$ "usually" falls in $[\log (\mu-\sigma), \log (\mu+\sigma)]$. But we have

$$\log (\mu \pm \sigma) = \log (\mu(1 \pm \sigma/mu)) = \log \mu \pm \log(1 \pm \sigma/mu) \approx \log \mu \pm \sigma/mu$$

where the approximation is the first-order Taylor expansion of $\log (1+x)$.

Therefore $\log X$ has mean approximately $\log np$ and standard deviation approximately $\sqrt{(1-p)/np}$; similarly $\log Y$ has mean approximately $\log mq$ and standard deviation approximately $\sqrt{(1-q)/mq}$.

So $\log X - \log Y = \log X/Y$ has mean approximately $\log(np/mq)$ and standard deviation approximately $$\sqrt{{(1-p) \over np} + {(1-q) \over mq}}.$$

But you asked about $X/Y$. Inverting the earlier fact, if $Z$ has mean $\mu$ and standard deviation $\sigma$, then $e^Z$ has mean approximately $e^{\mu}$ and standard deviation approximately $\sigma e^\mu$. Therefore $X/Y$ has mean approximately $np/mq$ (not surprising!) and standard deviation approximately

$$\left( \sqrt{{(1-p) \over np} + {(1-q) \over mq}} \right) {np \over mq}.$$

-
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 1, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "http://math.stackexchange.com/questions/60032/how-to-obtain-the-standard-deviation-of-a-ratio-of-independent-binomial-random-v?answertab=oldest", "fetch_time": 1462480067000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2016-18/segments/1461860127983.53/warc/CC-MAIN-20160428161527-00154-ip-10-239-7-51.ec2.internal.warc.gz", "warc_record_offset": 189472872, "warc_record_length": 19030, "token_count": 1018, "char_count": 3257, "score": 3.984375, "int_score": 4, "crawl": "CC-MAIN-2016-18", "snapshot_type": "latest", "language": "en", "language_score": 0.8369279503822327, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00035-of-00064.parquet"}