Class LocalVolPde
java.lang.Object
com.quantfinlib.pricing.LocalVolPde
Finite-difference pricer for European options under Dupire local
volatility. In x = ln S and time to expiry τ the price solves
V_τ = ½σ²(t, e^x) V_xx + (r − q − ½σ²) V_x − r V, t = T − τ
Crank-Nicolson in τ with Rannacher start (Rannacher 1984; Giles and Carter 2006, "Convergence analysis of Crank-Nicolson and Rannacher time-marching", J. Comp. Finance 9(4)): the first two Crank-Nicolson steps are replaced by four implicit Euler half steps, which damps the oscillation the payoff kink otherwise leaves in the Greeks. Uniform x grid centred on ln K (so the kink sits on a node) with half-width |ln(S/K)| + 8 ATM standard deviations; Dirichlet boundaries at the discounted intrinsic forward values. Local vol is evaluated at the middle of each step. The price at spot is quadratic interpolation over the three nearest nodes. Second order in Δx and Δτ.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleprice(BlackScholes.OptionType type, double strike, double expiry, int spaceNodes, int timeSteps) European option price.
-
Constructor Details
-
LocalVolPde
-
-
Method Details
-
price
public double price(BlackScholes.OptionType type, double strike, double expiry, int spaceNodes, int timeSteps) European option price.- Parameters:
spaceNodes- number of x nodes (≥ 11)timeSteps- number of Crank-Nicolson steps (≥ 2)
-