Class FeynmanKacEx3
Evaluates the price of a European option with two payoff strategies.
This example evaluates the price of a European Option using two payoff strategies: Cash-or-Nothing and Vertical Spread. In the first case the payoff function is $$ p(x)=\left\{ \begin{array}{lr} 0, & x \le K \\ B, & x \gt K \end{array} \right. . $$ The value \(B\) is regarded as the bet on the asset price, see Wilmott et al. (1995, p. 39-40). The second case has the payoff function $$ p(x) = \max(x-K_1)-\max(x-K_2), \, K_2>K_1. $$ Both problems use the same boundary conditions. Each case requires a separate integration of the Black-Scholes differential equation, but only the payoff function evaluation differs in each case. The sets of parameters in the computation are:
- Strike and bet prices \(K_1 = {10.0},\; K_2={15.0}, and B={2.0}.\)
- Volatility \( \sigma = {0.4}\)
- Times until expiration = {1/4, 1/2}
- Interest rate \(r = 0.1\)
- \( x_{\min}=0.0,\, x_{\max}=30.0\)
- \( nx = 61, \, n=3 \times nx = 183\)
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
FeynmanKacEx3
public FeynmanKacEx3()
-
-
Method Details
-
main
- Throws:
Exception
-