September 26th, 2002, 5:18 pm
Playing around with quick and very dirty VBA code for simple European spread options (Max (Asset1 - Asset2 - Strike, 0), I am sure I have an error here somewhere, but can't quite find it. The Green's output (via numerical integration) is consistently lower than one by Monte Carlo. I have checked with the strike equal to zero using Margrabe (78) as a reference - MC is within bounds, but Green's is still lower. Refining the ganularity of the integration (Q in the code) doesn't make up the difference. Any help is much appreciated in advance.CheersHere goes the VBA code:Function GreenEuroSpreadOption(Asset1, Asset2, Strike, Vol1, Vol2, Rho, riskfree, Expiry) As DoubleDim a, b, c, d, e, f, i, j, Q As DoubleDim m, n, p, oDim Sigma(1 To 2, 1 To 2) As Double For i = 1 To 2 Step 1 For j = 1 To 2 Step 1 If i = j Then Sigma(i, j) = 1 Else Sigma(i, j) = Rho End If Next j Next ib = WorksheetFunction.MDeterm(Sigma())m = WorksheetFunction.MInverse(Sigma())c = (Vol1 * Vol2) ^ -1a = Exp(-riskfree * Expiry) / (2 * Pi() * Expiry) * b * cDim alpha(1 To 2) As DoubleQ = 0.25e = 0For i = 0.0001 To 5 * Asset1 Step Q alpha(1) = (1 / (Vol1 * (Expiry) ^ 0.5)) * (Log(Asset1 / i) + (riskfree - 0.5 * Vol1 ^ 2) * Expiry) For j = 0.0001 To 5 * Asset2 Step Q alpha(2) = (1 / (Vol2 * (Expiry) ^ 0.5)) * (Log(Asset2 / j) + (riskfree - 0.5 * Vol2 ^ 2) * Expiry) n = WorksheetFunction.Transpose(alpha()) p = WorksheetFunction.MMult(alpha(), m) o = WorksheetFunction.MMult(p, n) d = (Max(i - j - Strike, 0) / (i * j)) * Exp(-0.5 * o(1)) * (Q ^ 2) e = e + d Next jNext iGreenEuroSpreadOption = a * eEnd FunctionNB All the variables declared as variants are used to check the matrix multiplication - I know it slows it down.