Manual 06 From European to American

Payoffs

A payoff struct holds the terms of a contract: maturity T and, depending on the contract, strike K, barriers and whether it is a call (isCall = true, the default) or a put.

barrierAsianLongstaff–Schwartzsmiles

The Payoff bestiary lists every payoff with what it pays; the families are linear (Spot, Forward), European, barrier, Asian, early exercise (American and Bermudan, by Longstaff-Schwartz) and basket.

EuropeanOption(1.0, 100.0)                # 1y ATM call
EuropeanOption(1.0, 100.0, false)         # 1y ATM put
BarrierOptionDownOut(1.0, 100.0, 90.0)    # down and out call, barrier at 90
DoubleBarrierOption(1.0, 100.0, 80.0, 120.0)
BermudanOption([0.25, 0.5, 0.75, 1.0], 100.0)  # exercise dates

Constructors check that maturities, strikes and barriers are positive.

How payoffs are evaluated

The generic payoff function maps the matrix of simulated paths to the vector of discounted payouts, one per path. Each family has a generic engine implementing it, so a concrete payoff only needs to describe its payout:

  • European payoffs look at the column of the paths at maturity and call payout(S_T, payoff);
  • path dependent payoffs (barriers, Asians) receive the whole path of each simulation;
  • American and Bermudan payoffs are priced with the Longstaff-Schwartz regression, using the exercise value payout(S_t, payoff) at every step (or exercise date). The continuation value is regressed on 1, x, x² over the paths in the money, with x = (St - S0) / S_0 the return from the spot, which keeps the normal equations well conditioned.

Because the paths are shared, several payoffs with different maturities can be priced on the same simulation: the paths go up to the largest maturity and each payoff picks the time steps it needs. For this to be exact, maturities should fall on the time grid 0:T/Nstep:T.

Smiles

A smile groups European (or binary European) options with the same maturity and different strikes:

FinancialMonteCarlo.EuropeanOptionSmile(1.0, [90.0, 100.0, 110.0], [false, true, true])

pricer, variance, confinter, delta and rho return one value per strike, in the order of K. payoff returns a matrix with one row per path and one column per strike, and FinancialMonteCarlo.payout(ST, smile) the undiscounted payouts for one value of the underlying.

In CudaMode, pricer, variance, delta, rho and payoff return a CuArray, so what follows can run on the GPU too; use Array(prices) to read them on the CPU. confinter returns a Vector of tuples. The mode decides where a smile is priced: its strikes are moved to the device of the mode once per metric, whichever device they are on. With the strikes on the GPU already, implied volatilities need no transfer:

smile = FinancialMonteCarlo.EuropeanOptionSmile(T, CuArray(K), CuArray(isCall))
prices = pricer(model, underlying, rfCurve, MonteCarloConfiguration(Nsim, Nstep; mode = FinancialMonteCarlo.CudaMode()), smile)
volatilities = blsimpv.(S0, smile.K, r, T, prices, d, smile.isCall) # FinancialToolbox

Positions

Payoffs can be added, subtracted and multiplied by numbers, giving a FinancialMonteCarlo.Position, which pricer, variance, confinter, delta and rho accept like a payoff; see Portfolios and multivariate.

See Payoffs in the API reference.