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

net.finmath.montecarlo.assetderivativevaluation.AssetModelMonteCarloSimulationModel 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 24.01.2004
 */
package net.finmath.montecarlo.assetderivativevaluation;

import java.util.Map;

import net.finmath.exception.CalculationException;
import net.finmath.montecarlo.MonteCarloSimulationModel;
import net.finmath.stochastic.RandomVariable;

/**
 * Basic interface which has to be implemented by Monte Carlo models for asset processes.
 *
 * This interface serves as an abstraction layer between models and simulations (providing
 * the implementation of this interface) and products (using an object implementing this interface
 * in its valuation code, without further knowledge of the specific model and simulation technique.
 *
 * @author Christian Fries
 * @version 1.0
 */
public interface AssetModelMonteCarloSimulationModel extends MonteCarloSimulationModel {

	/**
	 * Returns the number of asset price processes.
	 *
	 * @return The number of asset price processes
	 */
	int getNumberOfAssets();

	/**
	 * Returns the random variable representing the asset's value at a given time for a given asset.
	 *
	 * @param timeIndex		Index of simulation time
	 * @param assetIndex	Index of the asset (0 for a single asset model)
	 * @return				The asset process as seen on simulation time
	 * @throws net.finmath.exception.CalculationException Thrown if the valuation fails, specific cause may be available via the cause() method.
	 */
	RandomVariable		getAssetValue(int timeIndex, int assetIndex) throws CalculationException;

	/**
	 * Returns the random variable representing the asset's value at a given time for a given asset.
	 *
	 * @param time			Simulation time
	 * @param assetIndex	Index of the asset (0 for a single asset model)
	 * @return				The asset process as seen on simulation time
	 * @throws net.finmath.exception.CalculationException Thrown if the valuation fails, specific cause may be available via the cause() method.
	 */
	RandomVariable		getAssetValue(double time, int assetIndex) throws CalculationException;

	/**
	 * Returns the numeraire associated with the valuation measure used by this model.
	 *
	 * @param timeIndex The time index (associated with this models time discretization).
	 * @return The numeraire associated with the valuation measure used by this model.
	 * @throws CalculationException Thrown if calculation of numeraire fails.
	 */
	RandomVariable		getNumeraire(int timeIndex) throws CalculationException;

	/**
	 * Returns the numeraire associated with the valuation measure used by this model.
	 *
	 * @param time The time for which the numeraire is requested.
	 * @return The numeraire associated with the valuation measure used by this model.
	 * @throws CalculationException Thrown if calculation of numeraire fails.
	 */
	RandomVariable		getNumeraire(double time) throws CalculationException;

	/**
	 * Create a clone of this simulation modifying some of its properties (if any).
	 *
	 * @param dataModified The data which should be changed in the new model
	 * @return Returns a clone of this model, with some data modified (then it is no longer a clone :-)
	 * @throws net.finmath.exception.CalculationException Thrown if the valuation fails, specific cause may be available via the cause() method.
	 */
	@Override
	AssetModelMonteCarloSimulationModel getCloneWithModifiedData(Map dataModified) throws CalculationException;

	/**
	 * Create a clone of the object implementing AssetModelMonteCarloSimulationModel
	 * using a different Monte-Carlo seed.
	 *
	 * @param seed The seed of the underlying random number generator.
	 * @return Returns a clone of this model except for a modified Monte-Carlo seed.
	 * @throws CalculationException Thrown if cloning failed.
	 */
	AssetModelMonteCarloSimulationModel getCloneWithModifiedSeed(int seed)  throws CalculationException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy