|
WebCab Bonds v2.01 (J2SE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--webcab.lib.finance.pricing.models.StochasticDifferentialModel
|
+--webcab.lib.finance.pricing.core.models.MarkovModel
|
+--webcab.lib.finance.pricing.models.rate.HJM
Heath, Jarrow and Morton is a model of the forward rate curve. It uses
instantaneous forward rates, not discrete ones as is the case with SimplifiedBGM.
Mathematically, the HJM model is an infinite-factor model (it uses infinite-dimensional
Brownian motions). In order to be simulated on a computer the model is discretized -
so in practice only a finite number of forward rates are used.
, where F(t, T) is the forward rate with maturity T at
moment t; m(t, T) is the drift of the forward rate with maturity T and
vol(t, T) is the volatility of the above mentioned rate.
It is proven that if the drifts of forward rates under the risk-neutral probability are entirely determined by their volatility (according to a certain formula) - the model is risk-neutral. You have thus the freedom to choose any volatility structure you want. The HJM specification is so general that almost all models are in fact particular cases of it.
The volatility of the forward rates can be externally specified by the user or can be automatically computed to fit the market data:
ForwardRateVolatilityContext is required to be provided by the compound model
(using for example the DeterministForwardRateVolatilityModel).
| Constructor Summary | |
HJM(String name,
ForwardRate initialForwardRateCurve,
int forwardCurveSteps)
Constructs a HJM model. |
|
HJM(String rateName,
String volatilityName,
double[][] historicZeroCouponBondPrices,
double[] forwardRates,
double[] maturities,
double tol,
int forwardCurveSteps,
int nObservations,
int nPCAVectors,
double dt,
double t0)
Constructs a HJM model using PCA to determine the volatility structure. |
|
HJM(String rateName,
String volatilityName,
double[][] historicZcbPrices,
double[] rates,
double[] zcbMaturities,
double tol,
int forwardCurveSteps,
int nObservations,
int nPCAVectors,
double dt,
double t0,
int internalMemorySteps)
|
|
HJM(String rateName,
String volatilityName,
double[][] historicZcbPrices,
ForwardRate initialForwardRateCurve,
double tol,
int nObservations,
int nPCAVectors,
double dt,
double t0,
int internalMemorySteps)
Constructs a HJM model using Principal Components Analysis to determine the volatility structure. |
|
| Method Summary | |
Context |
dV(Context context,
double t,
double dt,
RandomGenerator generator,
Context partialDelta)
|
double[][] |
getCorrelationMatrix()
|
Context |
getInitialContext()
|
int[] |
getNFactors()
|
int |
getNumeraire()
|
int |
getNVariables()
|
StochasticDifferentialModel |
getUpdatedModel(Context context,
double t)
Sets the initial values of the models' variables to the ones given as parameters. |
| Methods inherited from class webcab.lib.finance.pricing.core.models.MarkovModel |
comp, dV_MarkovModel, dV |
| Methods inherited from class webcab.lib.finance.pricing.models.StochasticDifferentialModel |
compoundModel, compoundModel, compoundModel, compoundModel, compoundModel, compoundModel, dV_StochasticDifferentialModel, getCholeskyMatrix, getContext, getStartVariableForContext, getSuperModel, getTotalFactors, getVariables, resetOnDemand, seekRoot, seekUpwards, setCholeskyMatrix, setSuperModel |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HJM(String rateName,
String volatilityName,
double[][] historicZeroCouponBondPrices,
double[] forwardRates,
double[] maturities,
double tol,
int forwardCurveSteps,
int nObservations,
int nPCAVectors,
double dt,
double t0)
throws BondsException
rateName - The name which will be given to the forward rate model produced by HJMvolatilityName - The name which will be given to the determinist volatility modelproduced by HJM+PCAtol - A tolerance used in the Power method for eigenvalues determination (necessary for
Principal Component Analysis). Recommended value: ........... !!!!!!!!!!!!!!!!!!forwardCurveSteps - The number of maturities; points of interpolation.nPCAVectors - ????????????????dt - The timestep (or average timestep) for the historic observations of the rates/prices.
public HJM(String rateName,
String volatilityName,
double[][] historicZcbPrices,
double[] rates,
double[] zcbMaturities,
double tol,
int forwardCurveSteps,
int nObservations,
int nPCAVectors,
double dt,
double t0,
int internalMemorySteps)
throws BondsException
public HJM(String rateName,
String volatilityName,
double[][] historicZcbPrices,
ForwardRate initialForwardRateCurve,
double tol,
int nObservations,
int nPCAVectors,
double dt,
double t0,
int internalMemorySteps)
throws BondsException
Constructs a HJM model using Principal Components Analysis to determine the volatility structure. If HJM is instantiated using this constructor there is no need for a separate forward rate volatility model.
A context graph will be produced, with the first component being a forward curve context (implements
ForwardRateContext), and the second component a MultifactorForwardRateVolatility context.
As you can see there are two String parameters. The first is the name of
the forward rate context generated; the second is the name of the forward volatility context.
The initial forward rate curve must be supplied. You can do this by instantiating a new ForwardRate class.
You must supply also the historic values of zero coupon bond prices to be used by the PCA algorithm.
rateName - the name of the forward rate curve context produced.volatilityName - the name of the multifactor forward volatility context produced.initialForwardRateCurve - the initial forward rate curvetol - a tolerance used as stopping condition in the Power method for finding
the eigenvectors of a matrix (needed in the PCA algorithm). A recommended value for
this parameter is 1E-12.nObservations - the number of historic values of zero coupon bond prices recorded
for each maturitynPCAVectors - the number of forward volatility stochastic factor you want to
find using PCAdt - the fixed time interval between two consecutive observations of
zero coupon bond pricest0 - the initial momentinternalMemorySteps - this parameter sets the length of an internal cache
used to speed up the computations. Generally it is a good idea to set this
parameter exactly as the number of timesteps in Monte Carlo.
BondsException
public HJM(String name,
ForwardRate initialForwardRateCurve,
int forwardCurveSteps)
throws InvalidParametersException
ForwardCurveContext).
name - the name of the context producedinitialForwardRateCurve - the initial forward curve
InvalidParametersException| Method Detail |
public int getNVariables()
getNVariables in class StochasticDifferentialModelpublic int[] getNFactors()
getNFactors in class StochasticDifferentialModelpublic int getNumeraire()
getNumeraire in class StochasticDifferentialModelpublic Context getInitialContext()
getInitialContext in class StochasticDifferentialModelpublic double[][] getCorrelationMatrix()
getCorrelationMatrix in class StochasticDifferentialModel
public Context dV(Context context,
double t,
double dt,
RandomGenerator generator,
Context partialDelta)
throws BondsException
dV in class MarkovModelBondsException
public StochasticDifferentialModel getUpdatedModel(Context context,
double t)
throws BondsException
StochasticDifferentialModel
getUpdatedModel in class StochasticDifferentialModelcontext - the context which will be the new initial context of the modelt - the initial moment for the model
BondsException
|
WebCab Bonds v2.01 (J2SE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||