# Confidence interval for the product of two parameters

Let us assume we have two parameters, $$p1p_1$$ and $$p2p_2$$. We also have two maximum likelihood estimators $$ˆp1\hat{p}_1$$ and $$ˆp2\hat{p}_2$$ and two confidence intervals for these parameters. Is there a way to build a confidence interval for $$p1p2?p_1p_2?$$

You can use the Delta method to calculate the standard error of $$ˆp1ˆp2\hat{p}_{1}\hat{p}_{2}$$. The delta method states that an approximation of the variance of a function $$g(t)g(t)$$ is given by:
$$Var(g(t))≈k∑i=1g′i(θ)2Var(ti)+2∑i>jg′i(θ)g′j(θ)Cov(ti,tj). \mathrm{Var}(g(t))\approx \sum_{i=1}^{k}g'_{i}(\theta)^{2}\,\mathrm{Var}(t_{i})+2\sum_{i>j}g'_{i}(\theta)g'_{j}(\theta)\,\mathrm{Cov}(t_{i},t_{j}).$$
The approximation of the expectation of $$g(t)g(t)$$ on the other hand is given by:
$$E(g(t))≈g(θ) \mathrm{\mathbf{E}}(g(t))\approx g(\theta)$$
So the expectation is simply the function. Your function $$g(t)g(t)$$ is: $$g(p1,p2)=p1p2g(p_{1}, p_{2})=p_{1}p_{2}$$. The expectation of $$g(p1,p2)=p1p2g(p_{1}, p_{2})=p_{1}p_{2}$$ would simply be: $$p1p2p_{1}p_{2}$$. For the variance, we need the partial derivatives of $$g(p1,p2)g(p_{1}, p_{2})$$:
∂∂p1g(p1p2)=p2∂∂p2g(p1p2)=p1 \begin{align} \frac{\partial}{\partial p_{1}}g(p_{1}p_{2}) & = p_{2} \\ \frac{\partial}{\partial p_{2}}g(p_{1}p_{2}) &= p_{1} \\ \end{align}

Using the function for the variance above, we get:

$$Var(ˆp1ˆp2)=ˆp22Var(ˆp1)+ˆp21Var(ˆp2)+2⋅ˆp1ˆp2Cov(ˆp1,ˆp2). \mathrm{Var}(\hat{p}_{1}\hat{p}_{2})=\hat{p}_{2}^{2}\,\mathrm{Var}(\hat{p}_{1}) + \hat{p}_{1}^{2}\,\mathrm{Var}(\hat{p}_{2})+2\cdot \hat{p}_{1}\hat{p}_{2}\,\mathrm{Cov}(\hat{p}_{1},\hat{p}_{2}).$$
The standard error would then simply be the square root of the above expression. Once you’ve got the standard error, it is straight-forward to calculate a $$95%95\%$$ confidence interval for $$ˆp1ˆp2\hat{p}_{1}\hat{p}_{2}$$: $$ˆp1ˆp2±1.96⋅^SE(ˆp1ˆp2)\hat{p}_{1}\hat{p}_{2}\pm 1.96\cdot \widehat{\mathrm{SE}}(\hat{p}_{1}\hat{p}_{2})$$

To calculate the standard error of $$ˆp1ˆp2\hat{p}_{1}\hat{p}_{2}$$, you need the variance of $$ˆp1\hat{p}_{1}$$ and $$ˆp2\hat{p}_{2}$$ which you usually can get by the variance-covariance matrix $$Σ\Sigma$$ which would be a $$2×22\times 2$$-matrix in your case because you have two estimates. The diagonal elements in the variance-covariance matrix are the variances of $$ˆp1\hat{p}_{1}$$ and $$ˆp2\hat{p}_{2}$$ while the off-diagonal elements are the covariance of $$ˆp1\hat{p}_{1}$$ and $$ˆp2\hat{p}_{2}$$ (the matrix is symmetric). As @gung mentions in the comments, the variance-covariance matrix can be extracted by most statistical software packages. Sometimes, estimation algorithms provide the Hessian matrix (I won’t go into details about that here), and the variance-covariance matrix can be estimated by the inverse of the negative Hessian (but only if you maximized the log-likelihood!; see this post). Again, consult the documentation of your statistical software and/or the web on how to extract the Hessian and on how to calculate the inverse of a matrix.

Alternatively, you can get the variances of $$ˆp1\hat{p}_{1}$$ and $$ˆp2\hat{p}_{2}$$ from the confidence intervals in the following way (this is valid for a $$95%95\%$$-CI): $$SE(ˆp1)=(upper limit−lower limit)/3.92\mathrm{SE}(\hat{p}_{1})=(\text{upper limit} - \text{lower limit})/3.92$$. For an $$100(1−α)%100(1-\alpha)\%$$-CI, the estimated standard error is: $$SE(ˆp1)=(upper limit−lower limit)/(2⋅z1−α/2)\mathrm{SE}(\hat{p}_{1})=(\text{upper limit} - \text{lower limit})/(2\cdot z_{1-\alpha/2})$$, where $$z1−α/2z_{1-\alpha/2}$$ is the $$(1−α/2)(1-\alpha/2)$$ quantile of the standard normal distribution (for $$α=0.05\alpha=0.05$$, $$z0.975≈1.96z_{0.975}\approx 1.96$$). Then, $$Var(ˆp1)=SE(ˆp1)2\mathrm{Var}(\hat{p}_{1}) = \mathrm{SE}(\hat{p}_{1})^{2}$$. The same is true for the variance of $$ˆp2\hat{p}_{2}$$. We need the covariance of $$ˆp1\hat{p}_{1}$$ and $$ˆp2,\hat{p}_{2},$$ too (see paragraph above). If $$ˆp1\hat{p}_{1}$$ and $$ˆp2\hat{p}_{2}$$ are independent, the covariance is zero and we can drop the term.

This paper might provide additional information.