WebCab Bonds
v2.01
(J2SE Edition)

webcab.lib.finance.pricing.contracts.standard
Class FloorForward

java.lang.Object
  |
  +--webcab.lib.finance.pricing.contracts.GeneralContractCommon
        |
        +--webcab.lib.finance.pricing.contracts.FixedExchangeMomentsContractCommon
              |
              +--webcab.lib.finance.pricing.contracts.standard.FloorForward
All Implemented Interfaces:
FixedExchangeMomentsContract, GeneralContract, Serializable

public class FloorForward
extends FixedExchangeMomentsContractCommon
implements FixedExchangeMomentsContract

Implements a floor which can be used only with forward curve models. Two such models are presently provided: HJM and SimplifiedBGM

A floor guarantees to the holder that floating interest rates will not exceed a predefined maximum level. If the rates go beyond this level, the holder will be compensated by receiving the fraction that is beneath the minimum from a fixed premium.

Observation: As the payments are made regularly a standard floor uses a floating rate at moment t the forward rate registered at time t - dt with dt maturity. In arrears floors use the current forward rate, not the one registered in the last step. This contract is a standard floor. To evaluate an in arrears floor you should use the CapSpot contract with a suitable model for the forward rate (you can safely use the spot rate models as models for one forward rate). If, for efficiency or convenience, you want to use other models than HJM and SimplifiedBGM, you can use CapSpot also to price standard floors

See Also:
Serialized Form

Field Summary
 
Fields inherited from class webcab.lib.finance.pricing.contracts.GeneralContractCommon
BUYER_INITIATED, NO_EARLY_EXERCISE, SELLER_INITIATED
 
Constructor Summary
FloorForward(double principal, double settlement, double floorRate, double tenor, double expiry)
          Creates a new FloorForwardt contract which uses the first interest rate model found.
FloorForward(String interestRateContextName, double principal, double firstResetDate, double floorRate, double tenor, double expiry)
          Creates a new FloorForward contract which uses a specified interest rate model (identified using the context).
 
Method Summary
 double getExpiry()
          Returns the maturity time for this contract.
 double[] getMoments()
          Returns an array containing the moments of all cash exchanges (payoffs).
 int getNMoments()
          Returns the total number of payoffs for the contract.
 double getPayoff(int moment, ContextGraph contextGraph, Path contextHistory, StochasticDifferentialModel updatedModel)
          Returns the amount exchanged at a moment specified by its index in the payoff moments vector (the vector returned by method getMoments()).
 boolean needsUpdatedModel()
          Returns whether this contract is a multi-order contract.
 
Methods inherited from class webcab.lib.finance.pricing.contracts.FixedExchangeMomentsContractCommon
getAccumulatedCashflow, getFirstMoment
 
Methods inherited from class webcab.lib.finance.pricing.contracts.GeneralContractCommon
getEarlyExercise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface webcab.lib.finance.pricing.contracts.FixedExchangeMomentsContract
getFirstMoment
 
Methods inherited from interface webcab.lib.finance.pricing.contracts.GeneralContract
getAccumulatedCashflow
 

Constructor Detail

FloorForward

public FloorForward(double principal,
                    double settlement,
                    double floorRate,
                    double tenor,
                    double expiry)
Creates a new FloorForwardt contract which uses the first interest rate model found. The payoff of this contract is: principal * max(floorRate - floatingRate, 0).

Parameters:
principal - the sum which is insured against interest rate fluctuations
floorRate - the minimum admissible interest rate without compensation
tenor - the period between two consecutive regular payments
expiry - the maturity time of the contract

FloorForward

public FloorForward(String interestRateContextName,
                    double principal,
                    double firstResetDate,
                    double floorRate,
                    double tenor,
                    double expiry)
             throws InvalidParametersException
Creates a new FloorForward contract which uses a specified interest rate model (identified using the context). The payoff of this contract is: principal * max(floorRate - floatingRate, 0).

Parameters:
interestRateContextName - the context providing the floating interest rate
principal - the sum which is insured against interest rate fluctuations
firstResetDate - the moment when the first payment takes place
floorRate - the minimum admissible interest rate without compensation
tenor - the period between two consecutive regular payments
expiry - the maturity time of the contract
Method Detail

getMoments

public double[] getMoments()
Description copied from interface: FixedExchangeMomentsContract
Returns an array containing the moments of all cash exchanges (payoffs). It is required that this array is sorted in ascending order. The moments are given as absolute times, not time relative to settlement date.

Specified by:
getMoments in interface FixedExchangeMomentsContract
Specified by:
getMoments in class FixedExchangeMomentsContractCommon
Returns:
double[]

getNMoments

public int getNMoments()
Description copied from interface: FixedExchangeMomentsContract
Returns the total number of payoffs for the contract. This number must be equal with the length of the vector returned by the getMoments() method.

Specified by:
getNMoments in interface FixedExchangeMomentsContract
Specified by:
getNMoments in class FixedExchangeMomentsContractCommon
Returns:
int

getPayoff

public double getPayoff(int moment,
                        ContextGraph contextGraph,
                        Path contextHistory,
                        StochasticDifferentialModel updatedModel)
                 throws BondsException
Description copied from interface: FixedExchangeMomentsContract
Returns the amount exchanged at a moment specified by its index in the payoff moments vector (the vector returned by method getMoments()).

Specified by:
getPayoff in interface FixedExchangeMomentsContract
Specified by:
getPayoff in class FixedExchangeMomentsContractCommon
Parameters:
moment - the index of the moment for which the payoff is computed (the current moment)
contextGraph - the context graph produced by the model. The context graph contains a snapshot of the models' variables at the current moment. See ContextGraph for information on how to search for a specific variable on which the contract is dependent.
contextHistory - provides access to previous values of all the models' variables. The full history of the simulation between settlement and the current moment is accessible.
updatedModel - an instance of the model used to price the contract. It can be used with a pricer to evaluate an underlying contract (in case we have a second-order contract like, for example, a bond option). The initial values for this models' variables are implicitly set to the current values. If the higher order contract is path dependent and needs the values for the underlying contract at previous moments of time, you need to set the initial values of the model to the values that existed at that moment of time. You can use the path to find the historic context and then use the updatedModel.setInitialContext() method to set the initial values.
Returns:
double
Throws:
BondsException

getExpiry

public double getExpiry()
Description copied from interface: GeneralContract
Returns the maturity time for this contract.

Specified by:
getExpiry in interface GeneralContract
Specified by:
getExpiry in class GeneralContractCommon
Returns:
double

needsUpdatedModel

public boolean needsUpdatedModel()
Description copied from interface: GeneralContract
Returns whether this contract is a multi-order contract. That is if it must evaluate another contract in order to compute the payoffs. If this is true, the updatedModel parameter of getAccumulatedCashflow() method is needed. This information is used by the pricing algorithm to decide if it is necessary to initialize the above mentioned parameter. The overall efficiency of the algorithm is improved if the initialization is not performed.

Specified by:
needsUpdatedModel in interface GeneralContract
Overrides:
needsUpdatedModel in class GeneralContractCommon
Returns:
if the return value is false the updatedModel parameter is not correctly initialized and must not be used.

WebCab Bonds
v2.01
(J2SE Edition)