
r     = 0.05;
sigma = 0.2;
T     = 2.5;
S     = 4;

eps = 1e-20;

delta = lookback_call(r,sigma,T,S,'delta');
V     = lookback_call(r,sigma,T,S+i*eps,'value');

disp(sprintf('delta (analytic) = %g',delta))
disp(sprintf('delta (CVT)      = %g',imag(V)/eps))

gamma = lookback_call(r,sigma,T,S,'gamma');
delta = lookback_call(r,sigma,T,S+i*eps,'delta');

disp(sprintf('gamma (analytic) = %g',gamma))
disp(sprintf('gamma (CVT)      = %g',imag(delta)/eps))

vega  = lookback_call(r,sigma,T,S,'vega');
V     = lookback_call(r,sigma+i*eps,T,S,'value');

disp(sprintf('vega (analytic)  = %g',vega))
disp(sprintf('vega (CVT)       = %g',imag(V)/eps))


%
% plot price versus S(0)
%

S = linspace(0,5);
K = 3;

V = lookback_call(r,sigma,T,S,'value');

figure(1)
plot(S,V)
xlabel('S'); ylabel('V')

