Assembly: ImslCS (in ImslCS.dll) Version: 6.5.0.0
Syntax
C# |
---|
[SerializableAttribute] public class FeynmanKac |
Visual Basic (Declaration) |
---|
<SerializableAttribute> _ Public Class FeynmanKac |
Visual C++ |
---|
[SerializableAttribute] public ref class FeynmanKac |
Remarks
Class FeynmanKac solves the generalized Feynman-Kac PDE on a rectangular grid with boundary conditions using a finite element Galerkin method. The generalized Feynman-Kac differential equation has the form
where the initial data satisfies . The derivatives are , etc. Method ComputeCoefficients uses a finite element Galerkin method over the rectangle in to compute the approximate solution. The interval is decomposed with a grid On each subinterval the solution is represented by The values are time-dependent coefficients associated with each interval. The basis functions are given for by By adding the piece-wise definitions the unknown solution function may be arranged as the series where the time-dependent coefficients are defined by re-labeling: The Galerkin principle is then applied. Using the provided initial and boundary conditions leads to an Index 1 differential-algebraic equation for the coefficients .This system is integrated using the variable order, variable step algorithm DDASLX noted in Hanson, R. and Krogh, F. (2008), Solving Constrained Differential-Algebraic Systems Using Projections. Solution values and their time derivatives at a grid preceding time T, expressed in units of time remaining, are given back by methods GetSplineCoefficients and GetSplineCoefficientsPrime, respectively. For further details of deriving and solving the system see Hanson, R. (2008), Integrating Feynman-Kac Equations Using Hermite Quintic Finite Elements. To evaluate f or its partials at any time point in the grid, use method GetSplineValue.
One useful application of the FeynmanKac class is financial analytics. This is illustrated in Example 2, which solves a diffusion model for call options which, in the special case reduces to the Black-Scholes (BS) model. Another useful application for the FeynmanKac class is the calculation of the Greeks, i.e. various derivatives of Feynman-Kac solutions applicable to, e.g., the pricing of options and related financial derivatives. In Example 5, the FeynmanKac class is used to calculate eleven of the Greeks for the same diffusion model introduced in Example 2 in the special BS case. These Greeks are also calculated using the BS closed form Greek equations (see http://en.wikipedia.org/wiki/The_Greeks). The Feynman-Kac and BS solutions are output and compared. Example 5 illustrates that the FeynmanKac class can be used to explore the Greeks for a much wider class of financial models than can BS.