|
WebCab Options and Futures Demo v2.5 (J2SE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--webcab.lib.finance.options.exotic.MonteCarlo
This class evaluates the price and Greeks of Asian and Lookback of Exotic Options in accordance with the Black-Scholes model using Monte Carlo tecnhiques.
Overview
The Monti-Carlo approach can be applied to any options contract for which the payoff function can be specified. With the classical Black-Scholes model the payoff function is the only ingredient required in specifying an options contract. There are other contract parameters that are not included in the payoff, such as updating formulae used in the definition strongly path dependent options such as Asian options. But these parameters will be supplied directly to the method as parameters. The payoff function, on the other hand, must be set prior to calling any of the class's methods.
Remarks:
random_walks parameter. The more simulations considered
the greater the confidence in the accuracy of the returns returned. However, the
desire to obtain greater confidence in the results will need to be balanced
with the computational remands since the time the simulation will take to run
will depend linearly on the number of simulations considered.Note: The Programmer's Guide chapter within the accompanying PDF documentation offers details and examples concerning the passing of functions, in particular the payoff function to the class methods.
| Constructor Summary | |
MonteCarlo()
Creates a new MonteCarlo instance without registering the payoff function. |
|
MonteCarlo(PayoffFunction instanceOfPayoffFunction)
Creates a new MonteCarlo instance and submits the payoff function. |
|
| Method Summary | |
double |
multiMonteCarlo(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double[] asset_prices,
int number_assets,
double[] dividends,
double interest,
double[] volatility,
double[][] correlation,
int time_steps,
BusinessCalendar businessCalendar)
Calcualtes the present value of a multi-asset European Asian or Lookback Exotic options of Asian or Lookbackup type in accordance with the Black-Scholes model via Monte Carlo simulation. |
double |
multiMonteCarlo(int random_walks,
int exotic_type,
double time2Maturity,
double[] asset_prices,
int number_assets,
double[] dividends,
double interest,
double[] volatility,
double[][] correlation,
int time_steps)
Calcualtes the present value of a multi-asset European Asian or Lookback Exotic options of Asian or Lookbackup type in accordance with the Black-Scholes model via Monte Carlo simulation. |
double |
multiMonteCarloWithErrorControl(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double[] asset_prices,
int number_assets,
double[] dividends,
double interest,
double[] volatility,
double[][] correlation,
int time_steps,
double confidenceLevel,
double maxRelativeError,
BusinessCalendar businessCalendar)
Calculates the present value of a multi-asset European Asian or Lookback Exotic options in accordance with the Black-Scholes model via Monte Carlo simulation, keeping the error within specified bounds. |
double |
multiMonteCarloWithErrorControl(int random_walks,
int exotic_type,
double time2Maturity,
double[] asset_prices,
int number_assets,
double[] dividends,
double interest,
double[] volatility,
double[][] correlation,
int time_steps,
double confidenceLevel,
double maxRelativeError)
Calculates the present value of a multi-asset European Asian or Lookback Exotic options in accordance with the Black-Scholes model via Monte Carlo simulation, keeping the error within specified bounds. |
void |
setPayoffFunction(PayoffFunction instanceOfPayoffFunction)
Submits a new payoff function (i.e. |
double |
singleMonteCarlo(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double asset_price,
double dividend,
double interest,
double volatility,
int time_steps,
BusinessCalendar businessCalendar)
Evaluates the present value of a single-asset Asian or Lookback exotic options of European type using Monte Carlo simulation. |
double |
singleMonteCarlo(int random_walks,
int exotic_type,
double time2Maturity,
double asset_price,
double dividend,
double interest,
double volatility,
int time_steps)
Evaluates the present value of a single-asset Asian or Lookback exotic options of European type using Monte Carlo simulation. |
double |
singleMonteCarloDelta(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double asset_price,
double shift_size,
double dividend,
double interest,
double volatility,
int time_steps,
BusinessCalendar businessCalendar)
Evaluates the Delta of an single-asset Asian or Lookback exotic options of European type using Monte Carlo simulation. |
double |
singleMonteCarloDelta(int random_walks,
int exotic_type,
double time2Maturity,
double asset_price,
double shift_size,
double dividend,
double interest,
double volatility,
int time_steps)
Evaluates the Delta of an single-asset Asian or Lookback exotic options of European type using Monte Carlo simulation. |
double |
singleMonteCarloRho(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double asset_price,
double dividend,
double interest,
double shift_size,
double volatility,
int time_steps,
BusinessCalendar businessCalendar)
Evaluates the Rho of an single-asset Asian or Lookback exotic options of European type using Monte Carlo simulation. |
double |
singleMonteCarloRho(int random_walks,
int exotic_type,
double time2Maturity,
double asset_price,
double dividend,
double interest,
double shift_size,
double volatility,
int time_steps)
Evaluates the Rho of an single-asset Asian or Lookback exotic options of European type using Monte Carlo simulation. |
double |
singleMonteCarloTheta(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double shift_size,
double asset_price,
double dividend,
double interest,
double volatility,
int time_steps,
BusinessCalendar businessCalendar)
Evaluates the Theta of an single-asset Asian or Lookback exotic options of European type using Monte Carlo simulation. |
double |
singleMonteCarloTheta(int random_walks,
int exotic_type,
double time2Maturity,
double shift_size,
double asset_price,
double dividend,
double interest,
double volatility,
int time_steps)
Evaluates the Theta of an single-asset Asian or Lookback exotic options of European type using Monte Carlo simulation. |
double |
singleMonteCarloVega(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double asset_price,
double dividend,
double interest,
double volatility,
double shift_size,
int time_steps,
BusinessCalendar businessCalendar)
Evaluates the Vega of an single-asset Asian or Lookback exotic options of European type using Monte Carlo simulation. |
double |
singleMonteCarloVega(int random_walks,
int exotic_type,
double time2Maturity,
double asset_price,
double dividend,
double interest,
double volatility,
double shift_size,
int time_steps)
Evaluates the Vega of an single-asset Asian or Lookback exotic options of European type using Monte Carlo simulation. |
double |
singleMonteCarloWithErrorControl(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double asset_price,
double dividend,
double interest,
double volatility,
int time_steps,
double confidenceLevel,
double maxRelativeError,
BusinessCalendar businessCalendar)
Evaluates present value of a single-asset Asian or Lookback exotic options of European type using Monte Carlo simulation and keeps the error within specified bounds. |
double |
singleMonteCarloWithErrorControl(int random_walks,
int exotic_type,
double time2Maturity,
double asset_price,
double dividend,
double interest,
double volatility,
int time_steps,
double confidenceLevel,
double maxRelativeError)
Evaluates present value of a single-asset Asian or Lookback exotic options of European type using Monte Carlo simulation and keeps the error within specified bounds. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MonteCarlo()
public MonteCarlo(PayoffFunction instanceOfPayoffFunction)
| Method Detail |
public void setPayoffFunction(PayoffFunction instanceOfPayoffFunction)
throws MonteCarloDemoException
MonteCarloDemoException
public double singleMonteCarlo(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double asset_price,
double dividend,
double interest,
double volatility,
int time_steps,
BusinessCalendar businessCalendar)
throws ExoticOptionsException,
MonteCarloDemoException
Supported Options
Four types of exotic options of European type are supported:
exotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDasset_price - the current price of the assetdividend - the continuous dividend yield which the underlying asset paysinterest - the continuously compounded risk-free interest rate in the domestic currencyvolatility - the volatility (in years) of the asset pricetime_steps - the total number of time intervals which the time from now until the expiry time is divided intorandom_walks - the number of Monte-Carlo simulations that is performed before the average of the results is returnedevaluationDate - the date when the zero rate of the bond is being evaluatedmaturityDate - the date when the bond maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
ExoticOptionsException
MonteCarloDemoException
public double singleMonteCarlo(int random_walks,
int exotic_type,
double time2Maturity,
double asset_price,
double dividend,
double interest,
double volatility,
int time_steps)
throws ExoticOptionsException,
MonteCarloDemoException
Supported Options
Four types of exotic options of European type are supported:
exotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDtime2Maturity - the remaining time (in years) until the contract maturesasset_price - the current price of the assetdividend - the continuous dividend yield which the underlying asset paysinterest - the continuously compounded risk-free interest rate in the domestic currencyvolatility - the volatility (in years) of the asset pricetime_steps - the total number of time intervals which the time from now until the expiry time is divided intorandom_walks - the number of Monte-Carlo simulations that is performed before the average of the results is returned
ExoticOptionsException
MonteCarloDemoException
public double singleMonteCarloDelta(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double asset_price,
double shift_size,
double dividend,
double interest,
double volatility,
int time_steps,
BusinessCalendar businessCalendar)
throws ExoticOptionsException,
MonteCarloDemoException
Supported Options
We methods allows us to evaluate of the Delta of one of the four types of exotic options of European type:
Remark: The Delta is the derivative of the price function which respect to the underlying asset. We have approximated the derivative at the given point by using the central differencing improvements or equivalently Ridders' algorithm with one iteration.
exotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDasset_price - the current price of the assetshift_size - the size of the shift of the asset price (up and down) from which the derivative at the present point will be evaluated. A reasonable value for this parameter is 0.01.dividend - the continuous dividend yield which the underlying asset paysinterest - the risk-free interest rate in the domestic currencyvolatility - the volatility (in years) of the asset pricetime_steps - the total number of time intervals which the time from now until the expiry time is divided intorandom_walks - the number of Monte-Carlo simulations that is performed before the average of the results is returnedevaluationDate - the date when the zero rate of the bond is being evaluatedmaturityDate - the date when the bond maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
ExoticOptionsException
MonteCarloDemoException
public double singleMonteCarloDelta(int random_walks,
int exotic_type,
double time2Maturity,
double asset_price,
double shift_size,
double dividend,
double interest,
double volatility,
int time_steps)
throws ExoticOptionsException,
MonteCarloDemoException
Supported Options
We methods allows us to evaluate of the Delta of one of the four types of exotic options of European type:
Remark: The Delta is the derivative of the price function which respect to the underlying asset. We have approximated the derivative at the given point by using the central differencing improvements or equivalently Ridders' algorithm with one iteration.
exotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDtime2Maturity - the remaining time (in years) until the contract maturesasset_price - the current price of the assetshift_size - the size of the shift of the asset price (up and down) from which the derivative at the present point will be evaluated. A reasonable value for this parameter is 0.01.dividend - the continuous dividend yield which the underlying asset paysinterest - the risk-free interest rate in the domestic currencyvolatility - the volatility (in years) of the asset pricetime_steps - the total number of time intervals which the time from now until the expiry time is divided intorandom_walks - the number of Monte-Carlo simulations that is performed before the average of the results is returned
ExoticOptionsException
MonteCarloDemoException
public double singleMonteCarloVega(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double asset_price,
double dividend,
double interest,
double volatility,
double shift_size,
int time_steps,
BusinessCalendar businessCalendar)
throws ExoticOptionsException,
MonteCarloDemoException
Supported Options
This method allows us to evaluate of the Vega of one of the four types of exotic options of European type:
Remark: The Vega is the derivative of the price function which respect to volatility. We have approximated the derivative at the given point by using the central differencing improvements or equivalently Ridders' algorithm with one iteration.
exotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDasset_price - the current price of the assetdividend - the continuous dividend yield which the underlying asset paysinterest - the continuously compounded risk-free interest rate in the domestic currencyvolatility - the volatility (in years) of the asset priceshift_size - the size of the shift of the volatility (up and down) from which the derivative at the present point will be evaluated. A reasonable value for this parameter is 0.01.time_steps - the total number of time intervals which the time from now until the expiry time is divided intorandom_walks - the number of Monte-Carlo simulations that is performed before the average of the results is returnedevaluationDate - the date when the zero rate of the bond is being evaluatedmaturityDate - the date when the bond maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
ExoticOptionsException
MonteCarloDemoException
public double singleMonteCarloVega(int random_walks,
int exotic_type,
double time2Maturity,
double asset_price,
double dividend,
double interest,
double volatility,
double shift_size,
int time_steps)
throws ExoticOptionsException,
MonteCarloDemoException
Supported Options
This method allows us to evaluate of the Vega of one of the four types of exotic options of European type:
Remark: The Vega is the derivative of the price function which respect to volatility. We have approximated the derivative at the given point by using the central differencing improvements or equivalently Ridders' algorithm with one iteration.
exotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDtime2Maturity - the remaining time (in years) until the contract maturesasset_price - the current price of the assetdividend - the continuous dividend yield which the underlying asset paysinterest - the continuously compounded risk-free interest rate in the domestic currencyvolatility - the volatility (in years) of the asset priceshift_size - the size of the shift of the volatility (up and down) from which the derivative at the present point will be evaluated. A reasonable value for this parameter is 0.01.time_steps - the total number of time intervals which the time from now until the expiry time is divided intorandom_walks - the number of Monte-Carlo simulations that is performed before the average of the results is returned
ExoticOptionsException
MonteCarloDemoException
public double singleMonteCarloRho(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double asset_price,
double dividend,
double interest,
double shift_size,
double volatility,
int time_steps,
BusinessCalendar businessCalendar)
throws ExoticOptionsException,
MonteCarloDemoException
Supported Options
This method allows us to evaluate of the Rho of one of the four types of exotic options of European type:
Remark: The Rho is the derivative of the price function which respect to interest rate. We have approximated the derivative at the given point by using the central differencing improvements or equivalently Ridders' algorithm of one iteration.
exotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDasset_price - the current price of the assetdividend - the continuous dividend yield which the underlying asset paysinterest - the continuously compounded risk-free interest rate in the domestic currencyshift_size - the size of the shift of the interest rate (up and down) from which the derivative at the present point will be evaluated. A reasonable value for this parameter is 0.01.volatility - the volatility (in years) of the asset pricetime_steps - the total number of time intervals which the time from now until the expiry time is divided intorandom_walks - the number of Monte-Carlo simulations that is performed before the average of the results is returnedevaluationDate - the date when the zero rate of the bond is being evaluatedmaturityDate - the date when the bond maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
ExoticOptionsException
MonteCarloDemoException
public double singleMonteCarloRho(int random_walks,
int exotic_type,
double time2Maturity,
double asset_price,
double dividend,
double interest,
double shift_size,
double volatility,
int time_steps)
throws ExoticOptionsException,
MonteCarloDemoException
Supported Options
This method allows us to evaluate of the Rho of one of the four types of exotic options of European type:
Remark: The Rho is the derivative of the price function which respect to interest rate. We have approximated the derivative at the given point by using the central differencing improvements or equivalently Ridders' algorithm of one iteration.
exotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDtime2Maturity - the remaining time (in years) until the contract maturesasset_price - the current price of the assetdividend - the continuous dividend yield which the underlying asset paysinterest - the continuously compounded risk-free interest rate in the domestic currencyshift_size - the size of the shift of the interest rate (up and down) from which the derivative at the present point will be evaluated. A reasonable value for this parameter is 0.01.volatility - the volatility (in years) of the asset pricetime_steps - the total number of time intervals which the time from now until the expiry time is divided intorandom_walks - the number of Monte-Carlo simulations that is performed before the average of the results is returned
ExoticOptionsException
MonteCarloDemoException
public double singleMonteCarloTheta(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double shift_size,
double asset_price,
double dividend,
double interest,
double volatility,
int time_steps,
BusinessCalendar businessCalendar)
throws ExoticOptionsException,
MonteCarloDemoException
Supported Options
This method allows us to evaluate of the Theta of the four types of exotic options of European type:
Remark: The Theta is the derivative of the price function which respect to interest rate. We have approximated the derivative at the given point by using the central differencing improvements or equivalently Ridders' algorithm of one iteration.
exotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDshift_size - the size of the shift of the interest rate (up and down) from which the derivative at the present point will be evaluated. A reasonable value for this parameter is 0.01.asset_price - the current price of the assetdividend - the continuous dividend yield which the underlying asset paysinterest - the continuously compounded risk-free interest rate in the domestic currencyvolatility - the volatility (in years) of the asset pricetime_steps - the total number of time intervals which the time from now until the expiry time is divided intorandom_walks - the number of Monte-Carlo simulations that is performed before the average of the results is returnedevaluationDate - the date when the zero rate of the bond is being evaluatedmaturityDate - the date when the bond maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
ExoticOptionsException
MonteCarloDemoException
public double singleMonteCarloTheta(int random_walks,
int exotic_type,
double time2Maturity,
double shift_size,
double asset_price,
double dividend,
double interest,
double volatility,
int time_steps)
throws ExoticOptionsException,
MonteCarloDemoException
Supported Options
This method allows us to evaluate of the Theta of the four types of exotic options of European type:
Remark: The Theta is the derivative of the price function which respect to interest rate. We have approximated the derivative at the given point by using the central differencing improvements or equivalently Ridders' algorithm of one iteration.
exotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDtime2Maturity - the remaining time (in years) until the contract maturesshift_size - the size of the shift of the interest rate (up and down) from which the derivative at the present point will be evaluated. A reasonable value for this parameter is 0.01.asset_price - the current price of the assetdividend - the continuous dividend yield which the underlying asset paysinterest - the continuously compounded risk-free interest rate in the domestic currencyvolatility - the volatility (in years) of the asset pricetime_steps - the total number of time intervals which the time from now until the expiry time is divided intorandom_walks - the number of Monte-Carlo simulations that is performed before the average of the results is returned
ExoticOptionsException
MonteCarloDemoException
public double singleMonteCarloWithErrorControl(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double asset_price,
double dividend,
double interest,
double volatility,
int time_steps,
double confidenceLevel,
double maxRelativeError,
BusinessCalendar businessCalendar)
throws ExoticOptionsException,
MonteCarloDemoException
Supported Options
Four types of exotic options of European type are supported:
exotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDasset_price - the current price of the assetdividend - the continuous dividend yield which the underlying asset paysinterest - the continuously compounded risk-free interest rate in the domestic currencyvolatility - the volatility (in years) of the asset pricetime_steps - the total number of time intervals which the time from now until the expiry time is divided intoconfidenceLevel - the probability that the relative error is less than the maximum tolerable error. Should be a value between 0 and 1.maxRelativeError - the maximum relative error you can tolerate. It is not a percentage (a value of 0.05 signifies an error of 5%, for example).evaluationDate - the date when the zero rate of the bond is being evaluatedmaturityDate - the date when the bond maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
ExoticOptionsException
MonteCarloDemoException
public double singleMonteCarloWithErrorControl(int random_walks,
int exotic_type,
double time2Maturity,
double asset_price,
double dividend,
double interest,
double volatility,
int time_steps,
double confidenceLevel,
double maxRelativeError)
throws ExoticOptionsException,
MonteCarloDemoException
Supported Options
Four types of exotic options of European type are supported:
exotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDtime2Maturity - the remaining time (in years) until the contract maturesasset_price - the current price of the assetdividend - the continuous dividend yield which the underlying asset paysinterest - the continuously compounded risk-free interest rate in the domestic currencyvolatility - the volatility (in years) of the asset pricetime_steps - the total number of time intervals which the time from now until the expiry time is divided intoconfidenceLevel - the probability that the relative error is less than the maximum tolerable error. Should be a value between 0 and 1.maxRelativeError - the maximum relative error you can tolerate. It is not a percentage (a value of 0.05 signifies an error of 5%, for example).
ExoticOptionsException
MonteCarloDemoException
public double multiMonteCarlo(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double[] asset_prices,
int number_assets,
double[] dividends,
double interest,
double[] volatility,
double[][] correlation,
int time_steps,
BusinessCalendar businessCalendar)
throws ExoticOptionsException,
MonteCarloDemoException
Supported Options
Four kinds of exotic options are supported:
random_walks - the number of Monte-Carlo simulations that the class will perform before the result is returnedexotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDasset_prices - a vector containing the current prices of all the assetsnumber_assets - the number of assets involved in the contractdividends - a vector containing the continuous dividend yield each asset paysinterest - the continuously compounded risk-free interest rate in the domestic currencyvolatility - a vector containing the volatilities (per year) of each of the asset pricescorrelation - an N x N matrix of doubles where each element (i,j) represents the correlation coefficient of the ith asset vs the jth asset. The elements on the first diagonal (i.e. when i=j) are all equal to 1, that is an asset is fully correlated with itself. Moreover the correlation matrix is symmetrical since the correlation relation in symmetric.time_steps - the total number of time intervals which the time from now until the expiry time is divided intoevaluationDate - the date when the zero rate of the bond is being evaluatedmaturityDate - the date when the bond maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
ExoticOptionsException
MonteCarloDemoException
public double multiMonteCarlo(int random_walks,
int exotic_type,
double time2Maturity,
double[] asset_prices,
int number_assets,
double[] dividends,
double interest,
double[] volatility,
double[][] correlation,
int time_steps)
throws ExoticOptionsException,
MonteCarloDemoException
Supported Options
Four kinds of exotic options are supported:
random_walks - the number of Monte-Carlo simulations that the class will perform before the result is returnedexotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDtime2Maturity - the remaining time (in years) until the contract maturesasset_prices - a vector containing the current prices of all the assetsnumber_assets - the number of assets involved in the contractdividends - a vector containing the continuous dividend yield each asset paysinterest - the continuously compounded risk-free interest rate in the domestic currencyvolatility - a vector containing the volatilities (per year) of each of the asset pricescorrelation - an N x N matrix of doubles where each element (i,j) represents the correlation coefficient of the ith asset vs the jth asset. The elements on the first diagonal (i.e. when i=j) are all equal to 1, that is an asset is fully correlated with itself. Moreover the correlation matrix is symmetrical since the correlation relation in symmetric.time_steps - the total number of time intervals which the time from now until the expiry time is divided into
ExoticOptionsException
MonteCarloDemoException
public double multiMonteCarloWithErrorControl(int random_walks,
int exotic_type,
Date evaluationDate,
Date maturityDate,
double[] asset_prices,
int number_assets,
double[] dividends,
double interest,
double[] volatility,
double[][] correlation,
int time_steps,
double confidenceLevel,
double maxRelativeError,
BusinessCalendar businessCalendar)
throws ExoticOptionsException,
MonteCarloDemoException
Calculates the present value of a multi-asset European Asian or Lookback Exotic options in accordance with the Black-Scholes model via Monte Carlo simulation, keeping the error within specified bounds. If the number of simulations required to ensure these bounds is larger than the value given in the randomWalks parameter, an exception is thrown.
Supported Options
Four kinds of exotic options are supported:
Remarks:
random_walks parameter. The more simulations considered
the greater the confidence in the accuracy of the returns returned. However, the
desire to obtain greater confidence in the results will need to be balanced
with the computational remands since the time the simulation will take to run
will depend linearly on the number of simulations considered.
exotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDasset_prices - a vector containing the current prices of all the assetsnumber_assets - the number of assets involved in the contractdividends - a vector containing the continuous dividend yield each asset paysinterest - the continuously compounded risk-free interest rate in the domestic currencyvolatility - a vector containing the volatilities (per year) of each of the asset pricescorrelation - an N x N matrix of doubles where each element (i,j) represents the correlation coefficient of the ith asset vs the jth asset. The elements on the first diagonal (i.e. when i=j) are all equal to 1, that is an asset is fully correlated with itself. Moreover the correlation matrix is symmetrical since the correlation relation in symmetric.time_steps - the total number of time intervals which the time from now until the expiry time is divided intoconfidenceLevel - the probability that the relative error is less than maximum tolerable error. Should be a value between 0 and 1.maxRelativeError - the maximum relative error you can tolerate. It is not a percentage (a value of 0.05 signifies an error of 5%, for example).evaluationDate - the date when the zero rate of the bond is being evaluatedmaturityDate - the date when the bond maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
ExoticOptionsException
MonteCarloDemoException
public double multiMonteCarloWithErrorControl(int random_walks,
int exotic_type,
double time2Maturity,
double[] asset_prices,
int number_assets,
double[] dividends,
double interest,
double[] volatility,
double[][] correlation,
int time_steps,
double confidenceLevel,
double maxRelativeError)
throws ExoticOptionsException,
MonteCarloDemoException
Calculates the present value of a multi-asset European Asian or Lookback Exotic options in accordance with the Black-Scholes model via Monte Carlo simulation, keeping the error within specified bounds. If the number of simulations required to ensure these bounds is larger than the value given in the randomWalks parameter, an exception is thrown.
Supported Options
Four kinds of exotic options are supported:
Remarks:
random_walks parameter. The more simulations considered
the greater the confidence in the accuracy of the returns returned. However, the
desire to obtain greater confidence in the results will need to be balanced
with the computational remands since the time the simulation will take to run
will depend linearly on the number of simulations considered.
exotic_type - this parameter specifies the type of exotic (ASIAN_ARITHMETIC, ASIAN_GEOMETRIC, LOOKBACK_MAX or LOOKBACK_MIN). If you want to evaluate an option which is not strongly path dependent then set exotic_type to NON_SPDtime2Maturity - the remaining time (in years) until the contract maturesasset_prices - a vector containing the current prices of all the assetsnumber_assets - the number of assets involved in the contractdividends - a vector containing the continuous dividend yield each asset paysinterest - the continuously compounded risk-free interest rate in the domestic currencyvolatility - a vector containing the volatilities (per year) of each of the asset pricescorrelation - an N x N matrix of doubles where each element (i,j) represents the correlation coefficient of the ith asset vs the jth asset. The elements on the first diagonal (i.e. when i=j) are all equal to 1, that is an asset is fully correlated with itself. Moreover the correlation matrix is symmetrical since the correlation relation in symmetric.time_steps - the total number of time intervals which the time from now until the expiry time is divided intoconfidenceLevel - the probability that the relative error is less than maximum tolerable error. Should be a value between 0 and 1.maxRelativeError - the maximum relative error you can tolerate. It is not a percentage (a value of 0.05 signifies an error of 5%, for example).
ExoticOptionsException
MonteCarloDemoException
|
WebCab Options and Futures Demo v2.5 (J2SE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||