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

net.finmath.montecarlo.hybridassetinterestrate.ConvexityAdjustedModel Maven / Gradle / Ivy

Go to download

finmath lib is a Mathematical Finance Library in Java. It provides algorithms and methodologies related to mathematical finance.

There is a newer version: 6.0.19
Show newest version
/*
 * (c) Copyright Christian P. Fries, Germany. Contact: [email protected].
 *
 * Created on 07.05.2013
 */

package net.finmath.montecarlo.hybridassetinterestrate;

import java.util.Map;

import net.finmath.exception.CalculationException;
import net.finmath.montecarlo.model.ProcessModel;
import net.finmath.montecarlo.process.MonteCarloProcess;
import net.finmath.stochastic.RandomVariable;

/**
 * A general convexity adjustment for models.
 *
 * @author Christian Fries
 */
public class ConvexityAdjustedModel {

	private final ProcessModel baseModel;
	private final MonteCarloProcess		measureTransformModel;
	private final Map factorLoadingMap;


	public ConvexityAdjustedModel(ProcessModel baseModel, MonteCarloProcess measureTransformModel, Map factorLoadingMap) {
		super();
		this.baseModel = baseModel;
		this.measureTransformModel = measureTransformModel;
		this.factorLoadingMap = factorLoadingMap;
	}

	public RandomVariable[] getDrift(RandomVariable[] driftUnadjusted, MonteCarloProcess process, int timeIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor) {
		/*
		 * Add convexity adjustment
		 */
		final RandomVariable[] driftAdjusted = new RandomVariable[baseModel.getNumberOfComponents()];

		RandomVariable[] processValueTransformModel = null;
		try {
			processValueTransformModel = measureTransformModel.getProcessValue(timeIndex);

			for(int componentIndex=0; componentIndex




© 2015 - 2024 Weber Informatics LLC | Privacy Policy