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

net.finmath.montecarlo.process.Process 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 29.02.2008
 */
package net.finmath.montecarlo.process;

import net.finmath.exception.CalculationException;
import net.finmath.montecarlo.model.ProcessModel;
import net.finmath.stochastic.RandomVariable;
import net.finmath.time.TimeDiscretization;

/**
 * The interface for a stochastic process X.
 *
 * @author Christian Fries
 * @version 1.0
 */
public interface Process {

	/**
	 * Returns the model that is used to generate this process, null if no model was used.
	 *
	 * @return The model that is used to generate this process, null if no model was used.
	 */
	default ProcessModel getModel() { return null; }

	/**
	 * This method returns the realization of the process for a given time index.
	 *
	 * @param timeIndex Time index at which the process should be observed
	 * @return The process realizations (given as array of RandomVariable)
	 * @throws net.finmath.exception.CalculationException Thrown if the valuation fails, specific cause may be available via the cause() method.
	 */
	default	RandomVariable[] getProcessValue(int timeIndex) throws CalculationException {
		final RandomVariable[] processValue = new RandomVariable[getNumberOfComponents()];
		for(int componentIndex=0; componentIndexRandomVariableFromDoubleArray)
	 * @throws net.finmath.exception.CalculationException Thrown if the valuation fails, specific cause may be available via the cause() method.
	 */
	RandomVariable getProcessValue(int timeIndex, int componentIndex) throws CalculationException;

	/**
	 * This method returns the weights of a weighted Monte Carlo method (the probability density).
	 *
	 * @param timeIndex Time index at which the process should be observed
	 * @return A vector of positive weights which sums up to one
	 * @throws net.finmath.exception.CalculationException Thrown if the valuation fails, specific cause may be available via the cause() method.
	 */
	RandomVariable getMonteCarloWeights(int timeIndex) throws CalculationException;

	/**
	 * @return Returns the numberOfComponents.
	 */
	int getNumberOfComponents();

	/**
	 * @return Returns the timeDiscretizationFromArray.
	 */
	TimeDiscretization getTimeDiscretization();

	/**
	 * @param timeIndex Time index.
	 * @return Returns the time for a given time index.
	 */
	double getTime(int timeIndex);

	/**
	 * Returns the time index for a given simulation time.
	 * @param time The given simulation time.
	 * @return Returns the time index for a given time
	 */
	int getTimeIndex(double time);

	/**
	 * Create and return a clone of this process. The clone is not tied to any model, but has the same
	 * process specification, that is, if the model is the same, it would generate the same paths.
	 *
	 * @return Clone of the process
	 */
	Process clone();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy