Scilab code to estimate Asian call option using the control variates method
Hello everyone,
I need to estimate Asian call option based on the arithmetic mean by using the control variates method. Since we have the exacte value of the option with geometric mean (Black-Scholes formula), i choosed the geometric mean as a control variates for the arithmetic mean.
The problem is that i'm getting the same values (graph) for the confidence interval limits and the estimate values.
Please help me to fix it.
Thanks in advance.
clear;
clc;
K = 120;
S0 = 100;
r = 0.04;
sigma = 0.4;
sigma2 = sigma^2;
T = 1;
n = 52;
dt = T/n;
t = 0:dt:T;
Nmax = 100;
z = 1.96;
sigman=(sigma/n)*sqrt(((n+1)*(2*n+1))/6);
sigman2=sigman^2;
rn=(r-0.5*sigma2)*(0.5*(n+1)/n)+0.5*sigman2;
d1 = (log(S0/K)+(rn+0.5*sigman2)*T)/(sigman*sqrt(T));
d2 = d1-sigman*sqrt(T);
ECg = exp(-r*T)*(S0*exp(rn*T)*cdfnor("PQ",d1,0,1)-K*cdfnor("PQ",d2,0,1));
function S=f(x)
S = ones(1,n);
for i = 1:n
u = exp((r-0.5*sigma2)*t(i+1)+sigma*x*sqrt(t(i+1)));
S(i)= u;
end
endfunction
function [CI_low, CI_up, CV]=integralCV(N)
S1 = 0;
S2 = 0;
for i = 1:N
u = grand(Nmax,1,"nor",0,1);
St = S0 * f(u(1));
ht1 = max(mean(St)-K,0);
ht2 = max((prod(St))^(1/n)-K,0);
ht = ht1-ht2;
S1 = S1 + exp(-r*T)*ht;
S2 = S2 + (exp(-r*T)*ht)^2;
end
CV = S1 / N + ECg;
stdev = sqrt((1 / (N-1))*( S2 - N*CV^2 ));
CI_low = CV - z * stdev / sqrt(N) ;
CI_up = CV + z * stdev / sqrt(N) ;
endfunction
D = 10:1:Nmax-9;
for i=1:length(D)
[CI_lowerCV(i), CI_upperCV(i), CV(i)] = integralCV(D(i));
clf();
plot2d(log10(D)', [ CI_lowerCV CI_upperCV CV], [ 3 5 2 ]);
legend([ "Lower Bound (CV)" "Upper Bound (CV)" "CV"]);
title("Estimation of E[Ca] by the control variates method");
- unanswered
- 453 views
- Pro Bono
Related Questions
- General understanding of statistics
- Probability and Statistics Question help please
- Suppose that X is a random variable uniform in (0, 1), and define $M = 2 \max\{X, 1− X\} − 1$. Determine the distribution function of M.
- Probability
- Statistics involving a numerical variable and a nonnumerical variable (date)
- Calculating the Probability of a Varied Selection in Pet Shop Purchases
- Explain how the mean of discrete variables is $\mu = \sum[x P(x)]$
- Statistics- Probability, Hypotheses , Standard Error
This is a very advanced problem...