webcab.lib.finance.pricing.models.rate
Class FongVasicek
java.lang.Object
|
+--webcab.lib.finance.pricing.models.StochasticDifferentialModel
|
+--webcab.lib.finance.pricing.core.models.MarkovModel
|
+--webcab.lib.finance.pricing.core.models.SemimartingaleMarkovModel
|
+--webcab.lib.finance.pricing.core.models.RationalSemimartingaleMarkovModel
|
+--webcab.lib.finance.pricing.models.rate.FongVasicek
- public class FongVasicek
- extends RationalSemimartingaleMarkovModel
Fong & Vasicek is a two factor model providing both the spot rate and the
volatility of the spot rate.
The stochastic differential equations are:
dr = a * (spotRateMean - r) * dt + sqrt(e) * dW1
de = b * (varianceRateMean - e) * dt + c * sqrt(e) * dW2
where r is the spot rate and e is the
variance (i.e. the volatility squared)of the spot rate.
The model produces a context that implements both SpotRateContext
and VolatilityContext.
|
Constructor Summary |
FongVasicek(String name,
double spotRateMean,
double sqrVolMean,
double a,
double b,
double c,
double initialSpotRate,
double initialSqrtVolatility)
Creates a new FongVasicek instance. |
| Methods inherited from class webcab.lib.finance.pricing.core.models.SemimartingaleMarkovModel |
addInternalJumpConditions, dV, evaluateNotTradedAbsoluteCoef, evaluateNotTradedTimeCoef, evaluateNotTradedWienerCoef, evaluateTimeCoef, evaluateWienerCoef, getAbsoluteCoef, getExternalCorrelationMatrix, getExternalReferencesInJumpConditions, getFixedVariablesForCondition, getJumpCondition, getJumpValue, getNExternalFactors, getNJumpConditions, getNotTradedAbsoluteCoef, getNotTradedTimeCoef, getNotTradedWienerCoef, getTimeCoef, getTotalExternalFactors, getTotalTradedFactors, getWienerCoef, hasExternalJumpConditions, resetOnDemand |
| Methods inherited from class webcab.lib.finance.pricing.models.StochasticDifferentialModel |
compoundModel, compoundModel, compoundModel, compoundModel, compoundModel, compoundModel, dV_StochasticDifferentialModel, getCholeskyMatrix, getContext, getStartVariableForContext, getSuperModel, getTotalFactors, getVariables, seekRoot, seekUpwards, setCholeskyMatrix, setSuperModel |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FongVasicek
public FongVasicek(String name,
double spotRateMean,
double sqrVolMean,
double a,
double b,
double c,
double initialSpotRate,
double initialSqrtVolatility)
throws BondsException
- Creates a new
FongVasicek instance.
- Parameters:
name - the name of the context produced. It implements both
SpotRateContext and VolatilityContextspotRateMean - the trend around which the spot rate oscillatesa - constant showing the mean-reversion speed of the spot rateb - constant showing the mean-reversion speed of the variancec - the volatility of the varianceinitialSpotRate - the initial value of the spot rate
- Throws:
BondsException
getNFactors
public int[] getNFactors()
- Specified by:
getNFactors in class StochasticDifferentialModel
getNVariables
public int getNVariables()
- Specified by:
getNVariables in class StochasticDifferentialModel
getNumeraire
public int getNumeraire()
- Specified by:
getNumeraire in class StochasticDifferentialModel
getTraded
public int getTraded()
- Specified by:
getTraded in class SemimartingaleMarkovModel
getExternal
public int getExternal()
- Specified by:
getExternal in class SemimartingaleMarkovModel
getExternalVariables
public double[] getExternalVariables(Context context)
- Specified by:
getExternalVariables in class SemimartingaleMarkovModel
getExternalReferences
public String[] getExternalReferences(Context context)
- Specified by:
getExternalReferences in class SemimartingaleMarkovModel
getCategoriesForExternalReferences
public int[] getCategoriesForExternalReferences()
- Specified by:
getCategoriesForExternalReferences in class SemimartingaleMarkovModel
getInitialContext
public Context getInitialContext()
- Specified by:
getInitialContext in class StochasticDifferentialModel
getCorrelationMatrix
public double[][] getCorrelationMatrix()
- Specified by:
getCorrelationMatrix in class StochasticDifferentialModel
getCoef
public IntervalRat getCoef(int nProcess,
int nCoef)
throws BondsException
- Specified by:
getCoef in class RationalSemimartingaleMarkovModel
BondsException
getUpdatedModel
public StochasticDifferentialModel getUpdatedModel(Context context,
double t)
throws BondsException
- Description copied from class:
StochasticDifferentialModel
- Sets the initial values of the models' variables to the ones given as parameters.
- Specified by:
getUpdatedModel in class StochasticDifferentialModel
- Parameters:
context - the context which will be the new initial context of the modelt - the initial moment for the model
- Returns:
- StochasticDifferentialModel
- Throws:
BondsException