当前位置: 首页>>代码示例>>Java>>正文


Java DiscountCurveFromForwardCurve类代码示例

本文整理汇总了Java中net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve的典型用法代码示例。如果您正苦于以下问题:Java DiscountCurveFromForwardCurve类的具体用法?Java DiscountCurveFromForwardCurve怎么用?Java DiscountCurveFromForwardCurve使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DiscountCurveFromForwardCurve类属于net.finmath.marketdata.model.curves包,在下文中一共展示了DiscountCurveFromForwardCurve类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: HullWhiteModelWithShiftExtension

import net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve; //导入依赖的package包/类
/**
 * Creates a Hull-White model which implements <code>LIBORMarketModelInterface</code>.
 * 
 * @param liborPeriodDiscretization The forward rate discretization to be used in the <code>getLIBOR</code> method.
 * @param analyticModel The analytic model to be used (currently not used, may be null).
 * @param forwardRateCurve The forward curve to be used (currently not used, - the model uses disocuntCurve only.
 * @param discountCurve The disocuntCurve (currently also used to determine the forward curve).
 * @param volatilityModel The volatility model specifying mean reversion and instantaneous volatility of the short rate.
 * @param properties A map specifying model properties (currently not used, may be null).
 */
public HullWhiteModelWithShiftExtension(
		TimeDiscretizationInterface			liborPeriodDiscretization,
		AnalyticModelInterface				analyticModel,
		ForwardCurveInterface				forwardRateCurve,
		DiscountCurveInterface				discountCurve,
		ShortRateVolailityModelInterface	volatilityModel,
		Map<String, ?>						properties
		) {

	this.liborPeriodDiscretization	= liborPeriodDiscretization;
	this.curveModel					= analyticModel;
	this.forwardRateCurve	= forwardRateCurve;
	this.discountCurve		= discountCurve;
	this.volatilityModel	= volatilityModel;

	this.discountCurveFromForwardCurve = new DiscountCurveFromForwardCurve(forwardRateCurve);

	numeraires = new ConcurrentHashMap<Integer, RandomVariableInterface>();

	if(properties != null && properties.containsKey("driftFormula")) driftFormula = DriftFormula.valueOf((String)properties.get("driftFormula"));
	else driftFormula = DriftFormula.DISCRETE;
}
 
开发者ID:finmath,项目名称:finmath-lib,代码行数:33,代码来源:HullWhiteModelWithShiftExtension.java

示例2: HullWhiteModelWithConstantCoeff

import net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve; //导入依赖的package包/类
/**
 * Creates a Hull-White model which implements <code>LIBORMarketModelInterface</code>.
 * 
 * @param liborPeriodDiscretization The forward rate discretization to be used in the <code>getLIBOR</code> method.
 * @param analyticModel The analytic model to be used (currently not used, may be null).
 * @param forwardRateCurve The forward curve to be used (currently not used, - the model uses disocuntCurve only.
 * @param discountCurve The disocuntCurve (currently also used to determine the forward curve).
 * @param meanReversion The mean reversion speed parameter a.
 * @param volatility The short rate volatility \( \sigma \).
 * @param properties A map specifying model properties (currently not used, may be null).
 */
public HullWhiteModelWithConstantCoeff(
		TimeDiscretizationInterface			liborPeriodDiscretization,
		AnalyticModelInterface				analyticModel,
		ForwardCurveInterface				forwardRateCurve,
		DiscountCurveInterface				discountCurve,
		double 								meanReversion,
		double								volatility,
		Map<String, ?>						properties
		) {

	this.liborPeriodDiscretization	= liborPeriodDiscretization;
	this.curveModel					= analyticModel;
	this.forwardRateCurve	= forwardRateCurve;
	this.discountCurve		= discountCurve;
	this.meanReversion		= meanReversion;
	this.volatility			= volatility;

	this.discountCurveFromForwardCurve = new DiscountCurveFromForwardCurve(forwardRateCurve);

	numeraires = new ConcurrentHashMap<Integer, RandomVariableInterface>();
}
 
开发者ID:finmath,项目名称:finmath-lib,代码行数:33,代码来源:HullWhiteModelWithConstantCoeff.java

示例3: HullWhiteModel

import net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve; //导入依赖的package包/类
/**
 * Creates a Hull-White model which implements <code>LIBORMarketModelInterface</code>.
 * 
 * @param liborPeriodDiscretization The forward rate discretization to be used in the <code>getLIBOR</code> method.
 * @param analyticModel The analytic model to be used (currently not used, may be null).
 * @param forwardRateCurve The forward curve to be used (currently not used, - the model uses disocuntCurve only.
 * @param discountCurve The disocuntCurve (currently also used to determine the forward curve).
 * @param volatilityModel The volatility model specifying mean reversion and instantaneous volatility of the short rate.
 * @param properties A map specifying model properties (currently not used, may be null).
 */
public HullWhiteModel(
		TimeDiscretizationInterface			liborPeriodDiscretization,
		AnalyticModelInterface				analyticModel,
		ForwardCurveInterface				forwardRateCurve,
		DiscountCurveInterface				discountCurve,
		ShortRateVolailityModelInterface	volatilityModel,
		Map<String, ?>						properties
		) {

	this.liborPeriodDiscretization	= liborPeriodDiscretization;
	this.curveModel					= analyticModel;
	this.forwardRateCurve	= forwardRateCurve;
	this.discountCurve		= discountCurve;
	this.volatilityModel	= volatilityModel;

	this.discountCurveFromForwardCurve = new DiscountCurveFromForwardCurve(forwardRateCurve);
}
 
开发者ID:finmath,项目名称:finmath-lib,代码行数:28,代码来源:HullWhiteModel.java

示例4: HullWhiteModelWithDirectSimulation

import net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve; //导入依赖的package包/类
/**
 * Creates a Hull-White model which implements <code>LIBORMarketModelInterface</code>.
 * 
 * @param liborPeriodDiscretization The forward rate discretization to be used in the <code>getLIBOR</code> method.
 * @param analyticModel The analytic model to be used (currently not used, may be null).
 * @param forwardRateCurve The forward curve to be used (currently not used, - the model uses disocuntCurve only.
 * @param discountCurve The disocuntCurve (currently also used to determine the forward curve).
 * @param volatilityModel The volatility model specifying mean reversion and instantaneous volatility of the short rate.
 * @param properties A map specifying model properties (currently not used, may be null).
 */
public HullWhiteModelWithDirectSimulation(
		TimeDiscretizationInterface			liborPeriodDiscretization,
		AnalyticModelInterface				analyticModel,
		ForwardCurveInterface				forwardRateCurve,
		DiscountCurveInterface				discountCurve,
		ShortRateVolailityModelInterface	volatilityModel,
		Map<String, ?>						properties
		) {

	this.liborPeriodDiscretization	= liborPeriodDiscretization;
	this.curveModel					= analyticModel;
	this.forwardRateCurve	= forwardRateCurve;
	this.discountCurve		= discountCurve;
	this.volatilityModel	= volatilityModel;

	this.discountCurveFromForwardCurve = new DiscountCurveFromForwardCurve(forwardRateCurve);

	numeraires = new ConcurrentHashMap<Integer, RandomVariableInterface>();
}
 
开发者ID:finmath,项目名称:finmath-lib,代码行数:30,代码来源:HullWhiteModelWithDirectSimulation.java

示例5: getDiscountCurve

import net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve; //导入依赖的package包/类
@Override
public DiscountCurveInterface getDiscountCurve() {
	if(discountCurve == null) {
		DiscountCurveInterface discountCurveFromForwardCurve = new DiscountCurveFromForwardCurve(getForwardRateCurve());
		return discountCurveFromForwardCurve;
	}

	return discountCurve;
}
 
开发者ID:finmath,项目名称:finmath-lib,代码行数:10,代码来源:LIBORMarketModelStandard.java

示例6: createSingleCurveLIBORMarketModel

import net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve; //导入依赖的package包/类
public static LIBORModelMonteCarloSimulationInterface createSingleCurveLIBORMarketModel(int numberOfPaths, int numberOfFactors, double correlationDecayParam) throws CalculationException {

		// Create the forward curve (initial value of the LIBOR market model)
		ForwardCurveInterface forwardCurve = ForwardCurve.createForwardCurveFromForwards(
				"forwardCurve"								/* name of the curve */,
				new double[] {0.5 , 1.0 , 2.0 , 5.0 , 40.0}	/* fixings of the forward */,
				new double[] {0.05, 0.05, 0.05, 0.05, 0.05}	/* forwards */,
				0.5											/* tenor / period length */
				);

		// No discount curve
		DiscountCurveInterface discountCurve = new DiscountCurveFromForwardCurve(forwardCurve);

		return createLIBORMarketModel(numberOfPaths, numberOfFactors, correlationDecayParam, discountCurve, forwardCurve);
	}
 
开发者ID:finmath,项目名称:finmath-lib,代码行数:16,代码来源:SwaptionAnalyticApproximationTest.java

示例7: getParSwaprate

import net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve; //导入依赖的package包/类
private static double getParSwaprate(LIBORModelMonteCarloSimulationInterface liborMarketModel, double[] swapTenor, String tenorCode) throws CalculationException {
	DiscountCurveInterface modelCurve = new DiscountCurveFromForwardCurve(liborMarketModel.getModel().getForwardRateCurve());
	ForwardCurveInterface forwardCurve = new ForwardCurveFromDiscountCurve(modelCurve.getName(), liborMarketModel.getModel().getForwardRateCurve().getReferenceDate(), tenorCode);
	return net.finmath.marketdata.products.Swap.getForwardSwapRate(new TimeDiscretization(swapTenor), new TimeDiscretization(swapTenor),
			forwardCurve,
			modelCurve);
}
 
开发者ID:finmath,项目名称:finmath-lib,代码行数:8,代码来源:HullWhiteModelTest.java

示例8: getValue

import net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve; //导入依赖的package包/类
/**
 * This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
 * Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
 * Cashflows prior evaluationTime are not considered.
 * 
 * @param evaluationTime The time on which this products value should be observed.
 * @param model The model used to price the product.
 * @return The random variable representing the value of the product discounted to evaluation time
 * @throws net.finmath.exception.CalculationException Thrown if the valuation fails, specific cause may be available via the <code>cause()</code> method.
 */
@Override
public RandomVariableInterface getValue(double evaluationTime, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {
	/*
	 * Calculate value of the swap at exercise date on each path (beware of perfect foresight - all rates are simulationTime=exerciseDate)
	 */
	RandomVariableInterface valueOfSwapAtExerciseDate	= model.getRandomVariableForConstant(/*fixingDates[fixingDates.length-1],*/0.0);

	// Calculate the value of the swap by working backward through all periods
	for(int period=fixingDates.length-1; period>=0; period--)
	{
		double fixingDate	= fixingDates[period];
		double paymentDate	= paymentDates[period];
		double swaprate		= swaprates[period];

		if(paymentDate <= evaluationTime) break;

		double periodLength	= periodLengths != null ? periodLengths[period] : paymentDate - fixingDate;

		// Get random variables - note that this is the rate at simulation time = exerciseDate
		RandomVariableInterface libor	= model.getLIBOR(exerciseDate, fixingDate, paymentDate);

		// Calculate payoff
		RandomVariableInterface payoff = libor.sub(swaprate).mult(periodLength);

		// Calculated the adjustment for the discounting curve, assuming a deterministic basis
		// @TODO: Need to check if the model fulfills the assumptions (all models implementing the interface currently do so).
		double discountingDate = Math.max(fixingDate,exerciseDate);
		double discountingAdjustment = 1.0;
		if(model.getModel().getDiscountCurve() != null) {
			AnalyticModelInterface analyticModel = model.getModel().getAnalyticModel();
			DiscountCurveInterface discountCurve = model.getModel().getDiscountCurve();
			ForwardCurveInterface forwardCurve = model.getModel().getForwardRateCurve();
			DiscountCurveInterface discountCurveFromForwardCurve = new DiscountCurveFromForwardCurve(forwardCurve);

			double forwardBondOnForwardCurve = discountCurveFromForwardCurve.getDiscountFactor(analyticModel, discountingDate) / discountCurveFromForwardCurve.getDiscountFactor(analyticModel, paymentDate);
			double forwardBondOnDiscountCurve = discountCurve.getDiscountFactor(analyticModel, discountingDate) / discountCurve.getDiscountFactor(analyticModel, paymentDate);
			discountingAdjustment = forwardBondOnForwardCurve / forwardBondOnDiscountCurve;
		}

		// Add payment received at end of period
		valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.add(payoff);

		// Discount back to beginning of period
		valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.discount(libor, paymentDate - discountingDate).mult(discountingAdjustment);
	}

	/*
	 * Calculate swaption value
	 */
	RandomVariableInterface values = valueOfSwapAtExerciseDate.floor(0.0);

	RandomVariableInterface	numeraire				= model.getNumeraire(exerciseDate);
	RandomVariableInterface	monteCarloProbabilities	= model.getMonteCarloWeights(exerciseDate);
	values = values.div(numeraire).mult(monteCarloProbabilities);

	RandomVariableInterface	numeraireAtZero					= model.getNumeraire(evaluationTime);
	RandomVariableInterface	monteCarloProbabilitiesAtZero	= model.getMonteCarloWeights(evaluationTime);
	values = values.mult(numeraireAtZero).div(monteCarloProbabilitiesAtZero);

	return values;
}
 
开发者ID:finmath,项目名称:finmath-lib,代码行数:72,代码来源:Swaption.java

示例9: getNumeraire

import net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve; //导入依赖的package包/类
/**
 * Return the numeraire at a given time.
 * The numeraire is provided for interpolated points. If requested on points which are not
 * part of the tenor discretization, the numeraire uses a linear interpolation of the reciprocal
 * value. See ISBN 0470047224 for details.
 * 
 * @param time Time time <i>t</i> for which the numeraire should be returned <i>N(t)</i>.
 * @return The numeraire at the specified time as <code>RandomVariable</code>
    * @throws net.finmath.exception.CalculationException Thrown if the valuation fails, specific cause may be available via the <code>cause()</code> method.
 */
@Override
public RandomVariableInterface getNumeraire(double time) throws CalculationException {
	int timeIndex = getLiborPeriodIndex(time);
	
	if(timeIndex < 0) {
		// Interpolation of Numeraire: linear interpolation of the reciprocal.
		int lowerIndex = -timeIndex -1;
		int upperIndex = -timeIndex;
		double alpha = (time-getLiborPeriod(lowerIndex)) / (getLiborPeriod(upperIndex) - getLiborPeriod(lowerIndex));
		return getNumeraire(getLiborPeriod(upperIndex)).invert().mult(alpha).add(getNumeraire(getLiborPeriod(lowerIndex)).invert().mult(1.0-alpha)).invert();
	}

	// Calculate the numeraire, when time is part of liborPeriodDiscretization

	// Get the start of the product
	int firstLiborIndex		= getLiborPeriodIndex(time);
	if(firstLiborIndex < 0) {
		throw new CalculationException("Simulation time discretization not part of forward rate tenor discretization.");
	}

	// Get the end of the product
	int lastLiborIndex 	= liborPeriodDiscretization.getNumberOfTimeSteps()-1;

	if(measure == Measure.SPOT) {
		// Spot measure
		firstLiborIndex	= 0;
		lastLiborIndex	= getLiborPeriodIndex(time)-1;
	}

	/*
	 * Calculation of the numeraire
	 */

	// Initialize to 1.0
	RandomVariableInterface numeraire = new RandomVariable(time, 1.0);

	// The product 
	for(int liborIndex = firstLiborIndex; liborIndex<=lastLiborIndex; liborIndex++) {
		RandomVariableInterface libor = getLIBOR(getTimeIndex(Math.min(time,liborPeriodDiscretization.getTime(liborIndex))), liborIndex);

		double periodLength = liborPeriodDiscretization.getTimeStep(liborIndex);

		if(measure == Measure.SPOT) {
			numeraire = numeraire.accrue(libor, periodLength);
		}
		else {
			numeraire = numeraire.discount(libor, periodLength);
		}
	}

	/*
	 * Adjust for discounting
	 */
	if(discountCurve != null) {
		DiscountCurveInterface discountcountCurveFromForwardPerformance = new DiscountCurveFromForwardCurve(forwardRateCurve);
		double deterministicNumeraireAdjustment = discountcountCurveFromForwardPerformance.getDiscountFactor(time) / discountCurve.getDiscountFactor(time);
		numeraire = numeraire.mult(deterministicNumeraireAdjustment);
	}
	return numeraire;
}
 
开发者ID:finmath,项目名称:finmath-lib,代码行数:71,代码来源:LIBORMarketModelStandard.java

示例10: createLIBORMarketModel

import net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve; //导入依赖的package包/类
public static  LIBORModelMonteCarloSimulationInterface createLIBORMarketModel(
		AbstractRandomVariableFactory randomVariableFactory,
		int numberOfPaths, int numberOfFactors, /*ForwardCurve forwardCurve,*/ double correlationDecayParam) throws CalculationException {

	/*
	 * Create the libor tenor structure and the initial values
	 */
	double liborPeriodLength	= 0.5;
	double liborRateTimeHorzion	= 30.0;
	TimeDiscretization liborPeriodDiscretization = new TimeDiscretization(0.0, (int) (liborRateTimeHorzion / liborPeriodLength), liborPeriodLength);

	
	// Create the forward curve (initial value of the LIBOR market model). This curve is still double!
	ForwardCurve forwardCurve = ForwardCurve.createForwardCurveFromForwards(
			"forwardCurve"								/* name of the curve */,
			new double[] {0.5 , 1.0, 2.0, 5.0, 30.0}	/* fixings of the forward */,
			new double[] {0.01, 0.02, 0.02, 0.03, 0.04}	/* forwards */,
			liborPeriodLength							/* tenor / period length */
			);
	

	/*
	 * Create a simulation time discretization
	 */
	double lastTime	= 30.0;
	double dt		= 0.125;

	TimeDiscretization timeDiscretization = new TimeDiscretization(0.0, (int) (lastTime / dt), dt);

	/*
	 * Create a volatility structure v[i][j] = sigma_j(t_i)
	 */
	double a = 0.0 / 20.0, b = 0.0, c = 0.25, d = 0.3 / 20.0 / 2.0;
	//LIBORVolatilityModel volatilityModel = new LIBORVolatilityModelFourParameterExponentialFormIntegrated(timeDiscretization, liborPeriodDiscretization, a, b, c, d, false);		
	volatilityModel = new LIBORVolatilityModelFourParameterExponentialForm(randomVariableFactory, timeDiscretization, liborPeriodDiscretization, a, b, c, d, false);
	double[][] volatilityMatrix = new double[timeDiscretization.getNumberOfTimeSteps()][liborPeriodDiscretization.getNumberOfTimeSteps()];
	for(int timeIndex=0; timeIndex<timeDiscretization.getNumberOfTimeSteps(); timeIndex++) Arrays.fill(volatilityMatrix[timeIndex], d);
	volatilityModel = new LIBORVolatilityModelFromGivenMatrix(randomVariableFactory, timeDiscretization, liborPeriodDiscretization, volatilityMatrix);

	/*
	 * Create a correlation model rho_{i,j} = exp(-a * abs(T_i-T_j))
	 */
	LIBORCorrelationModelExponentialDecay correlationModel = new LIBORCorrelationModelExponentialDecay(
			timeDiscretization, liborPeriodDiscretization, numberOfFactors,
			correlationDecayParam);


	/*
	 * Combine volatility model and correlation model to a covariance model
	 */
	LIBORCovarianceModelFromVolatilityAndCorrelation covarianceModel =
			new LIBORCovarianceModelFromVolatilityAndCorrelation(timeDiscretization,
					liborPeriodDiscretization, volatilityModel, correlationModel);

	// Set model properties
	Map<String, String> properties = new HashMap<String, String>();

	// Choose the simulation measure
	properties.put("measure", LIBORMarketModel.Measure.SPOT.name());

	// Choose log normal model
	properties.put("stateSpace", LIBORMarketModel.StateSpace.LOGNORMAL.name());

	// Empty array of calibration items - hence, model will use given covariance
	LIBORMarketModel.CalibrationItem[] calibrationItems = new LIBORMarketModel.CalibrationItem[0];

	/*
	 * Create corresponding LIBOR Market Model
	 */
	LIBORMarketModelInterface liborMarketModel = new LIBORMarketModel(liborPeriodDiscretization, null, forwardCurve, new DiscountCurveFromForwardCurve(forwardCurve), randomVariableFactory, covarianceModel, calibrationItems, properties);

	BrownianMotionInterface brownianMotion = new net.finmath.montecarlo.BrownianMotion(timeDiscretization, numberOfFactors, numberOfPaths, 3141 /* seed */);

	ProcessEulerScheme process = new ProcessEulerScheme(brownianMotion, ProcessEulerScheme.Scheme.EULER_FUNCTIONAL);

	return new LIBORModelMonteCarloSimulation(liborMarketModel, process);
}
 
开发者ID:finmath,项目名称:finmath-lib,代码行数:78,代码来源:TestCurvesFromLIBORModel.java

示例11: createLIBORMarketModel

import net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve; //导入依赖的package包/类
public static LIBORModelMonteCarloSimulationInterface createLIBORMarketModel(
		int numberOfPaths, int numberOfFactors, double correlationDecayParam) throws CalculationException {

	/*
	 * Create the libor tenor structure and the initial values
	 */
	double liborPeriodLength	= 0.5;
	double liborRateTimeHorzion	= 20.0;
	TimeDiscretization liborPeriodDiscretization = new TimeDiscretization(0.0, (int) (liborRateTimeHorzion / liborPeriodLength), liborPeriodLength);

	// Create the forward curve (initial value of the LIBOR market model)
	ForwardCurve forwardCurve = ForwardCurve.createForwardCurveFromForwards(
			"forwardCurve"								/* name of the curve */,
			new double[] {0.5 , 1.0 , 2.0 , 5.0 , 40.0}	/* fixings of the forward */,
			new double[] {0.05, 0.05, 0.05, 0.05, 0.05}	/* forwards */,
			liborPeriodLength							/* tenor / period length */
			);

	/*
	 * Create a simulation time discretization
	 */
	double lastTime	= 20.0;
	double dt		= 0.5;

	TimeDiscretization timeDiscretization = new TimeDiscretization(0.0, (int) (lastTime / dt), dt);

	/*
	 * Create a volatility structure v[i][j] = sigma_j(t_i)
	 */
	double a = 0.2, b = 0.0, c = 0.25, d = 0.3;
	LIBORVolatilityModel volatilityModel = new LIBORVolatilityModelFourParameterExponentialForm(timeDiscretization, liborPeriodDiscretization, a, b, c, d, false);		

	/*
	 * Create a correlation model rho_{i,j} = exp(-a * abs(T_i-T_j))
	 */
	LIBORCorrelationModelExponentialDecay correlationModel = new LIBORCorrelationModelExponentialDecay(
			timeDiscretization, liborPeriodDiscretization, numberOfFactors,
			correlationDecayParam);


	/*
	 * Combine volatility model and correlation model to a covariance model
	 */
	LIBORCovarianceModelFromVolatilityAndCorrelation covarianceModel =
			new LIBORCovarianceModelFromVolatilityAndCorrelation(timeDiscretization,
					liborPeriodDiscretization, volatilityModel, correlationModel);

	// BlendedLocalVolatlityModel (future extension)
	//		AbstractLIBORCovarianceModel covarianceModel2 = new BlendedLocalVolatlityModel(covarianceModel, 0.00, false);

	// Set model properties
	Map<String, String> properties = new HashMap<String, String>();

	// Choose the simulation measure
	properties.put("measure", LIBORMarketModel.Measure.SPOT.name());

	// Choose log normal model
	properties.put("stateSpace", LIBORMarketModel.StateSpace.LOGNORMAL.name());

	// Empty array of calibration items - hence, model will use given covariance
	LIBORMarketModel.CalibrationItem[] calibrationItems = new LIBORMarketModel.CalibrationItem[0];

	/*
	 * Create corresponding LIBOR Market Model
	 */
	LIBORMarketModelInterface liborMarketModel = new LIBORMarketModel(liborPeriodDiscretization, forwardCurve, new DiscountCurveFromForwardCurve(forwardCurve), covarianceModel, calibrationItems, properties);

	BrownianMotionInterface brownianMotion = new net.finmath.montecarlo.BrownianMotion(timeDiscretization, numberOfFactors, numberOfPaths, 3141 /* seed */);

	ProcessEulerScheme process = new ProcessEulerScheme(brownianMotion, ProcessEulerScheme.Scheme.PREDICTOR_CORRECTOR);

	return new LIBORModelMonteCarloSimulation(liborMarketModel, process);
}
 
开发者ID:finmath,项目名称:finmath-lib,代码行数:74,代码来源:LIBORMarketModelValuationTest.java

示例12: LIBORMarketModel

import net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve; //导入依赖的package包/类
/**
 * Creates a LIBOR Market Model for given covariance.
 * 
 * @param liborPeriodDiscretization The discretization of the interest rate curve into forward rates (tenor structure).
 * @param forwardRateCurve The initial values for the forward rates.
 * @param covarianceModel The covariance model to use.
 * @throws net.finmath.exception.CalculationException Thrown if the valuation fails, specific cause may be available via the <code>cause()</code> method.
 */
public LIBORMarketModel(
		TimeDiscretizationInterface		liborPeriodDiscretization,
		ForwardCurveInterface			forwardRateCurve,
		AbstractLIBORCovarianceModel	covarianceModel
		) throws CalculationException {
	this(liborPeriodDiscretization, forwardRateCurve, new DiscountCurveFromForwardCurve(forwardRateCurve), covarianceModel, new CalibrationItem[0], null);
}
 
开发者ID:finmath,项目名称:finmath-lib,代码行数:16,代码来源:LIBORMarketModel.java

示例13: getSwapAnnuity

import net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve; //导入依赖的package包/类
/**
 * Function to calculate an (idealized) single curve swap annuity for a given schedule and forward curve.
 * The discount curve used to calculate the annuity is calculated from the forward curve using classical
 * single curve interpretations of forwards and a default period length. The may be a crude approximation.
 * 
 * Note: This method will consider evaluationTime being 0, see {@link net.finmath.marketdata.products.SwapAnnuity#getSwapAnnuity(double, ScheduleInterface, DiscountCurveInterface, AnalyticModelInterface)}.
 * 
 * @param schedule The schedule discretization, i.e., the period start and end dates. End dates are considered payment dates and start of the next period.
 * @param forwardCurve The forward curve.
 * @return The swap annuity.
 */
static public double getSwapAnnuity(ScheduleInterface schedule, ForwardCurveInterface forwardCurve) {
	DiscountCurveInterface discountCurve = new DiscountCurveFromForwardCurve(forwardCurve.getName());
	double evaluationTime = 0.0;	// Consider only payment time > 0
	return getSwapAnnuity(evaluationTime, schedule, discountCurve, new AnalyticModel( new CurveInterface[] {forwardCurve, discountCurve} ));
}
 
开发者ID:finmath,项目名称:finmath-lib,代码行数:17,代码来源:SwapAnnuity.java


注:本文中的net.finmath.marketdata.model.curves.DiscountCurveFromForwardCurve类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。