I embed Maple code in Mobius for test questions. A simple 2-step CRR tree gives significantly different answer from the calculated by hand or by R's fOptions. Here is the piece of Mobius/Maple:
$ct = maple("
with(Finance):
S0:=50; X:=50; Ty:=6./12; r:=0.07; sig:=0.3156; n:=1;
dt := Ty/n;
u := exp(sig*sqrt(dt));
d := 1/u;
pu := (exp(r*dt) - d)/(u - d);
pd := 1 - pu;
BT := BinomialTree(Ty,n,S0,u,pu,d,pd);
cT := ST -> max(ST - $X,0);
Ec := EuropeanOption(cT, $Ty):
LatticePrice(Ec,BT,$r);
");
The answer is: 6.545478168. Exactly the same with BlackScholesBinomialTree
The correct answer should be 6.32
In this case the solution by hand is simply e^(-0.07*05)*0.5236*$12.50
R confirms 6.32:
CRRBinomialTreeOption(TypeFlag = "ce", S=S, X=X, Time=T, r=r, b=b, sigma=sig, n=n)@price
The error decreases with the increase of number of steps. All quantities before LatticePrice are calculated corectly. Any idea of what the reason might be?
Thanks.