Choosing the Optimal Control Variate Coefficient in Monte Carlo
Summary
This discussion derives the coefficient that minimizes variance when estimating an expectation with a control variate. For an adjusted estimator of the form X plus θ times the difference between the known mean of Y and Y, the constant mean contributes no variance and has zero covariance with random variables. The remaining variance terms depend on Var(X), θ²Var(Y), and the covariance between X and Y.
Using the stated control variance of 2 and covariance of 1, differentiation gives an optimal coefficient of one half. The value of Var(X) is not needed to select it. The procedure then simulates X and Y consistently, constructs the adjusted observations using the coefficient and the mean of Y, and averages them to estimate the mean of X. The explanation is an elementary derivation; it assumes the supplied moments apply and does not discuss estimating the coefficient from data or the effects of finite simulation samples.
Key ideas
- A control variate adjusts each simulated X observation using the deviation of Y from its known mean.
- The optimal coefficient minimizes the variance of the adjusted estimator.
- A constant expectation has zero variance and zero covariance with random variables.
- With the stated variance and covariance, the minimizing coefficient is one half.
- The adjusted observations should be averaged after simulating X and Y consistently.
Tags
Full text
# Calculate control variate for monte carlo simulation
# Calculate control variate for monte carlo simulation
For an exercise I need to calculate $\mathbb{E}[X]$ with a Monte Carlo simulation. I need to use control variate $Y$ with $\text{Var}(Y)=2$ and $\text{Cov}(X,Y)=1$.
I am asked to give the optimale choice for $\theta$ in the following formula:
$Z_{\theta}=X+\theta(\mathbb{E}[Y]-Y)$ by making the variance of the stochast $Z_{\theta}$ as small as possible.
I assume you start by rewriting $\text{Var}(Z_{\theta})$, this is what I did:
$\text{Var}(X+\theta(\mathbb{E}[Y]-Y))$
$=\text{Var}(X)+\text{Var}(\theta(\mathbb{E}[Y]-Y)) + 2\text{Cov}(X,\theta(\mathbb{E}[Y]-Y))$
$= \text{Var}(X) +\theta^2\text{Var}(\mathbb{E}[Y]-Y) +2\theta \text{Cov}(X,\mathbb{E}[Y]) -2\theta\text{Cov}(X,Y) $
$= \text{Var}(X) +\theta^2\text{Var}(\mathbb{E}[Y]) +\theta^2\text{Var}(Y) -\theta^2\text{Cov}(\mathbb{E}[Y], Y) +2\theta \text{Cov}(X,\mathbb{E}[Y]) -2\theta\text{Cov}(X,Y) $
Since I can't rewrite the formula any further, I inserted the variables. This gave:
$= \text{Var}(X) +\theta^2\text{Var}(\mathbb{E}[Y]) +2 \theta^2 -\theta^2\text{Cov}(\mathbb{E}[Y], Y) +2\theta \text{Cov}(X,\mathbb{E}[Y]) -2\theta $
I don't know however how to go on from here, without the value of $\mathbb{E}[X]$. Am I doing something wrong?
## Answer by Olaf (score 1, accepted)
https://quant.stackexchange.com/a/22751
The first objective is to minimize the variance by choosing a proper control variate.
First note that an expectation value is just a constant, so the covariance between an expectation value and a random variable is zero:
$$\text{Cov}\left(\mathbb{E}[Y], X\right) = 0$$
Similarly for the variance of an expectation value, $\text{Var}(\mathbb{E}[Y])=0$. The variance of $Z_{{\theta}}$ is therefore given by
$$\text{Var}(\mathbb{E}[Z_{{\theta}}]) = \text{Var}(\mathbb{E}[X])+2\theta^2 - 2\theta$$
You don't need to know what this variance is. What you are interested in is picking a $\theta$ such that this variance is as low as possible. Put differently, you want to minimize this variance which is accomplished by setting the derivative with respect to $\theta$ equal to zero. The derivative is given by
$$\frac{d\text{Var}(\mathbb{E}[Z_{\theta}])}{d\theta} = 4\theta -2$$
Setting this to zero gives $\theta = \frac{1}{2}$.
So now you have determined the optimal $\theta$. Next, you need to run a Monte Carlo simulation and simulate $X$ and $Y$ consistently. From these simulations you can estimate $\mathbb{E}[Y]$ using the sample mean of $Y$ (or, better, the true mean if you happen to know this analytically). With this expectation you can construct the variable $Z_{\theta}$ with $\theta = 1/2$ for each of your $N$ simulations.
Finally, you compute the sample mean of $Z_{\theta}$, which is an estimate of the expectation value of $X$.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.