All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.finmath.montecarlo.interestrate.modelplugins.HullWhiteLocalVolatilityModel Maven / Gradle / Ivy

/*
 * (c) Copyright Christian P. Fries, Germany. Contact: [email protected].
 *
 * Created on 26.05.2013
 */
package net.finmath.montecarlo.interestrate.modelplugins;

import net.finmath.stochastic.RandomVariableInterface;

/**
 * Special variant of a blended model (or displaced diffusion model)
 * build on top of a standard covariance model
 * using the special function corresponding to the Hull-White local volatility.
 * 
 * The model constructed for the i-th factor loading is
 * 
* (1+Li(t) d) Fi(t) *
* where d is a constant (the period length), Li is * the realization of the i-th component of the stochastic process and * Fi is the factor loading from the given covariance model. * * If this model is combined with an exponential decay volatility model * LIBORVolatilityModelTwoParameterExponentialForm, then * the resulting LIBOR Market model corresponds to a Hull-White short rate model * (with constant short rate volatility and mean reversion). * * The parameter of this model is the parameter vector of the given base covariance model. * * @author Christian Fries */ public class HullWhiteLocalVolatilityModel extends AbstractLIBORCovarianceModelParametric { private static final long serialVersionUID = -4182083344704425769L; private final AbstractLIBORCovarianceModelParametric covarianceModel; private final double periodLength; /** * The model constructed for the i-th factor loading is *
* (1+Li(t) d) Fi(t) *
* where d is a constant (the period length), Li is * the realization of the i-th component of the stochastic process and * Fi is the factor loading from the given covariance model. * * The parameter of this model is the parameter vector of the given base covariance model. * * @param covarianceModel The given covariance model specifying the factor loadings F. * @param periodLength The parameter d in the formula above. */ public HullWhiteLocalVolatilityModel(AbstractLIBORCovarianceModelParametric covarianceModel, double periodLength) { super(covarianceModel.getTimeDiscretization(), covarianceModel.getLiborPeriodDiscretization(), covarianceModel.getNumberOfFactors()); this.covarianceModel = covarianceModel; this.periodLength = periodLength; } @Override public Object clone() { return new HullWhiteLocalVolatilityModel((AbstractLIBORCovarianceModelParametric) covarianceModel.clone(), periodLength); } /** * Returns the base covariance model, i.e., the model providing the factor loading F. * * @return The base covariance model. */ public AbstractLIBORCovarianceModelParametric getBaseCovarianceModel() { return covarianceModel; } @Override public double[] getParameter() { return covarianceModel.getParameter(); } @Override public AbstractLIBORCovarianceModelParametric getCloneWithModifiedParameters(double[] parameters) { return new HullWhiteLocalVolatilityModel((AbstractLIBORCovarianceModelParametric) covarianceModel.getCloneWithModifiedParameters(parameters), periodLength); } @Override public RandomVariableInterface[] getFactorLoading(int timeIndex, int component, RandomVariableInterface[] realizationAtTimeIndex) { RandomVariableInterface[] factorLoading = covarianceModel.getFactorLoading(timeIndex, component, realizationAtTimeIndex); if(realizationAtTimeIndex != null && realizationAtTimeIndex[component] != null) { RandomVariableInterface localVolatilityFactor = realizationAtTimeIndex[component].mult(periodLength).add(1.0); for (int factorIndex = 0; factorIndex < factorLoading.length; factorIndex++) { factorLoading[factorIndex] = factorLoading[factorIndex].mult(localVolatilityFactor); } } return factorLoading; } @Override public RandomVariableInterface getFactorLoadingPseudoInverse(int timeIndex, int component, int factor, RandomVariableInterface[] realizationAtTimeIndex) { throw new UnsupportedOperationException(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy