FeynmanKac Class |
Namespace: Imsl.Math
The FeynmanKac type exposes the following members.
Name | Description | |
---|---|---|
FeynmanKac |
Constructs a PDE solver to solve the Feynman-Kac PDE.
|
Name | Description | |
---|---|---|
ComputeCoefficients |
Determines the coefficients of the Hermite quintic splines that represent
an approximate solution for the Feynman-Kac PDE.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetAbsoluteErrorTolerances |
Returns absolute error tolerances.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetRelativeErrorTolerances |
Returns relative error tolerances.
| |
GetSplineCoefficients |
Returns the coefficients of the Hermite quintic splines that represent an
approximate solution of the Feynman-Kac PDE.
| |
GetSplineCoefficientsPrime |
Returns the first derivatives of the Hermite quintic spline coefficients
that represent an approximate solution of the Feynman-Kac PDE.
| |
GetSplineValue |
Evaluates for time value 0 or a time value in tGrid the derivative
of the Hermite quintic spline interpolant at evaluation points within the
range of xGrid.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
SetAbsoluteErrorTolerances(Double) |
Sets the absolute error tolerances.
| |
SetAbsoluteErrorTolerances(Double) |
Sets the absolute error tolerances.
| |
SetForcingTerm |
Sets the user-supplied method that computes approximations to the forcing term
and its derivative
used in the FeynmanKac PDE.
| |
SetInitialData |
Sets the user-supplied method for adjustment of initial data or as an opportunity
for output during the integration steps.
| |
SetRelativeErrorTolerances(Double) |
Sets the relative error tolerances.
| |
SetRelativeErrorTolerances(Double) |
Sets the relative error tolerances.
| |
SetTimeDependence |
Sets the time dependence of the coefficients, boundary conditions and
function in the Feynman Kac equation.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
GaussLegendreDegree |
The number of quadrature points used in the
Gauss-Legendre quadrature formula.
| |
InitialStepsize |
The starting step size for the integration.
| |
MaximumBDFOrder |
The maximum order of the backward differentiation formulas (BDF).
| |
MaximumStepsize |
The maximum internal step size used by the integrator.
| |
MaxSteps |
The maximum number of internal steps allowed.
| |
Method |
The step control method used in the integration of the
Feynman-Kac PDE.
| |
TimeBarrier |
Sets or returns the barrier used for integration in the time direction.
|
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.