# Monte Carlo - Control Variates & Antithetic method

Supposing $g(x)=\sqrt[3]{x}$, I want to calculate the expected value of g, $E(\sqrt[3]{x})$, using Monte Carlo method, by generating $x_i$ from a Weibull distribution with parameters $(1,5)$.

After that, I want to use the control variates method and the antithetic method in order to to reduce the variance of my estimator, which I found with the simple Monte Carlo. And here is my problem, I do not know how to do these methods.

I would appreciate if someone could help me do that or give any tip/help.Thank you very much for your concern, in advance.

What I have done so far

Supposing $S$ is our estimator, then we know that $S=(\sum \limits_{i=1}^{N} g(x_i))/N$.

Using Matlab, I found the expected value $S$ by generating 1000 random numbers from the weibull(1,5) distribution and calculate the sum. Here, is my algorithm:

N=1000

sum=0;

for i=1:N;

X = wblrnd(1,5);

res(i)=X.^(1/3);

sum=sum+res(i);

end

S=sum/N

-
Probably clearer if you state that $x$ is a random variable with a particular distribution up front, rather than asking us to compute $E(\sqrt[3]{x})$ before we even know that $x$ is random. – Thomas Andrews Dec 9 '11 at 17:34
@ThomasAndrews ok thanks for your observation, don't kill me.... it wasn't so confusing, everyone could understand what i was meant. I didn't ask you to compute anything, I have already done that via algorithm. – johan paul Dec 9 '11 at 17:56
Yeah, I wasn't meaning to attack, I just found reading the beginning of your problem difficult because the first sentence defines what looks like a function, and only late in the sentence do I understand the context. Just a writing note, really. You might start your problem with: I am trying to estimate $E(\sqrt[3]{x})$ where $x$ is a random real variable of Weibull distribution with parameters $(1,5)$. Defining $g$ causes confusion both because you don't use $g$ later in the sentence and because it makes $x$ look like a regular variable rather than a random variable. – Thomas Andrews Dec 9 '11 at 18:06
Maybe this question would get more attention if it was on CrossValidated. – Raskolnikov Dec 10 '11 at 10:58

The wikipedia pages for the control variates method and the antithetic method are a pretty good start to learn about them.

The antithetic method seems the easiest to implement. What you should do is sample random numbers from your distribution (here the Weibull distribution) and for each of those numbers create another number according to a procedure that makes the new numbers be realizations of a random variable with negative covariance with respect to the original Weibull variable that is used for generating the first sequence of numbers. This way, you reduce the total variance on your estimate of the expected value.

Practically, I think the following should do the trick (I'm using R code):

n<-10000;
x<-rweibull(n,1,5); # Generate n random numbers
# distributed according to Weib(1,5)
y<-qweibull(1-pweibull(x,1,5),1,5); # Generate n numbers fom the previous ones
# to be "in the opposite quantile".
z<-c(x,y);
sum(z^(1/3))/(2*n); # Compute the mean


Maybe it's more efficient to generate uniformly distributed random numbers $u_i$, take their complements $1-u_i$ and from these generate the Weibull distributed variables using qweibull. Also this might not be the best choice to minimize the variance.

-
Raskolnikov, thank you very much for you tips. I have read also a few pages about the antithetic and they say that if $U$ comes from $Uniform(0,1)$ then $1-U$ its the antithetic. So simply I have to replace my new variate in g and then do what? I feel so confused... – johan paul Dec 9 '11 at 22:16
As far as control variates concern, I believe that i have to estimate the parameters by doing linear regression on the model $E(g(x))= S-aY$. I have all these things in theoretical level and I have no idea how to use them. The certain thing we know, comparing the two methods, is that with the antithetic we are expecting the highest reduction of the variance – johan paul Dec 9 '11 at 22:22
For the antithetic method: Try applying the inverse weibull cumulative distribution (or weibull quantile function) on uniformly generated numbers $U$ and their antithetic numbers $1-U$. – Raskolnikov Dec 9 '11 at 22:40