Record Class RatesOptions.VolModel
java.lang.Object
java.lang.Record
com.quantfinlib.rates.RatesOptions.VolModel
- Enclosing class:
RatesOptions
A vol type together with its displacement (0 unless shifted lognormal).
-
Constructor Summary
ConstructorsConstructorDescriptionVolModel(RatesOptions.VolType type, double shift) Creates an instance of aVolModelrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.doubleforwardValue(BlackScholes.OptionType type, double forward, double strike, double vol, double expiry) Undiscounted option value on a forward under this model.final inthashCode()Returns a hash code value for this object.doubleimpliedVol(BlackScholes.OptionType type, double forwardValue, double forward, double strike, double expiry) Implied vol of this model from an undiscounted value (NaN if unattainable).static RatesOptions.VolModelstatic RatesOptions.VolModelnormal()doubleshift()Returns the value of theshiftrecord component.static RatesOptions.VolModelshiftedLognormal(double shift) final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
VolModel
Creates an instance of aVolModelrecord class.- Parameters:
type- the value for thetyperecord componentshift- the value for theshiftrecord component
-
-
Method Details
-
lognormal
-
shiftedLognormal
-
normal
-
forwardValue
public double forwardValue(BlackScholes.OptionType type, double forward, double strike, double vol, double expiry) Undiscounted option value on a forward under this model. -
impliedVol
public double impliedVol(BlackScholes.OptionType type, double forwardValue, double forward, double strike, double expiry) Implied vol of this model from an undiscounted value (NaN if unattainable). -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
shift
public double shift()Returns the value of theshiftrecord component.- Returns:
- the value of the
shiftrecord component
-