webcab.lib.finance.options.exotic
Class SimpleBoundaries
java.lang.Object
|
+--webcab.lib.finance.options.exotic.Dirichlet
|
+--webcab.lib.finance.options.exotic.SimpleBoundaries
- All Implemented Interfaces:
- Boundaries, DirichletBoundaries, Serializable
- public class SimpleBoundaries
- extends Dirichlet
- implements DirichletBoundaries
This class is an implementation of the Dirichlet abstract classand
provides boundary conditions for vanilla put and call options.
- See Also:
- Serialized Form
|
Constructor Summary |
SimpleBoundaries(int european_american,
int call_put,
int long_short,
double strike_price,
double max_asset_price,
double interest,
double dividend)
Creates a SimpleBoundaries object |
|
Method Summary |
double |
getValueAt(double t,
int i,
boolean i_max,
double[] not_fixed_x,
int m)
Returns the value of the option on the boundary. |
| Methods inherited from class webcab.lib.finance.options.exotic.Dirichlet |
type |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface webcab.lib.finance.options.exotic.Boundaries |
type |
SimpleBoundaries
public SimpleBoundaries(int european_american,
int call_put,
int long_short,
double strike_price,
double max_asset_price,
double interest,
double dividend)
throws Exception
- Creates a SimpleBoundaries object
- Parameters:
european_american - Set this parameter to ExoticOptionsConstants.EUROPEAN or ExoticOptionsConstants.AMERICANcall_put - Set this parameter to ExoticOptionsConstants.CALL or ExoticOptionsConstants.PUTlong_short - Set this parameter to ExoticOptionsConstants.LONG or ExoticOptionsConstants.SHORT
(LONG - means that you buy the option; SHORT means that you are the writer of the option).strike_price - The strike price (expiry price) of the contract.max_asset_price - the asset price corresponding to the last item of the finite differencing gridinterest - the risk-free interest ratedividend - the dividend yield
getValueAt
public double getValueAt(double t,
int i,
boolean i_max,
double[] not_fixed_x,
int m)
- Description copied from interface:
DirichletBoundaries
- Returns the value of the option on the boundary. Must be implemented by the user.
- Specified by:
getValueAt in interface DirichletBoundaries- Specified by:
getValueAt in class Dirichlet
- Parameters:
t - the timei - the index of the asset with fixed price. Counting begins with 0.i_max - if true the method returns the value on the high boundary, otherwise it returns the value on the
low boundary.not_fixed_x - - a vector with m - 1 components - the prices of the remaining (not fixed)
assets. It represents a point in the m - 1 dimensional space which represents the boundary.
(a plane in the m diminsional space). Obs.: if m is 1 (one spatial coordinate <=> unidimensional
<=> uni-asset) then the vector has 0 elements. In this case it will not be used
to compute the result.m - - the number of assets (equal to the number of spatial dimensions).
- Returns:
- the value of the option in the case that the i-th asset price is maximum or minimum,
according to i_max, and the other m - 1 prices are given in not_fixed_i