Package com.illumon.modelfarm.fitterfarm
Class CoreFitData
java.lang.Object
com.illumon.modelfarm.fitterfarm.CoreFitData
- All Implemented Interfaces:
FitDataBase
,FitDataOptionChain
,FitDataRates
,FitDataUnderlying
,Serializable
- Direct Known Subclasses:
EquityFitData
,FuturesCoreFitData
public abstract class CoreFitData extends Object implements FitDataBase, FitDataUnderlying, FitDataOptionChain, FitDataRates, Serializable
A snapshot of market data needed to fit an equity option model.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Modifier Constructor Description protected
CoreFitData()
Create a new, empty data set.protected
CoreFitData(CoreFitData data)
Copy the data. -
Method Summary
Modifier and Type Method Description protected static double[][]
clone2d(double[][] vals)
DBDateTime[]
getCarryCurveDates()
Gets an array of dates defining the cost-of-carry curve.double[]
getCarryCurveErrors()
Gets an array of rate errors defining the cost-of-carry curve.double[]
getCarryCurveRates()
Gets an array of rates defining the cost-of-carry curve.double[]
getDivCashAmounts()
Gets an array of cash dividend values for the underlying security.DBDateTime[]
getDivExDates()
Gets an array of dividend ex-dates for the underlying security.double[]
getDivProportionalAmounts()
Gets an array of proportional dividend values for the underlying security.String
getFitGroup()
Gets the grouping of the data snapshot.FitScope
getFitScope()
Gets the scope indicating the extent of this data (e.g.String[]
getOptionExerciseTypes()
Gets the type of option exercise (e.g.DBDateTime[]
getOptionExpirations()
Gets an array of expirations associated with the option prices.long[]
getOptionIds()
Gets an array of ids associated with the options.String[]
getOptionPayoffTypes()
Gets the type of option payoff (e.g.String[]
getOptionRoots()
Gets an array of root symbols associated with the options.String[]
getOptionSettlementTypes()
Gets the type of option settlement (e.g.double[]
getOptionStrikes()
Gets an array of strikes associated with the option prices.String[]
getOptionSyms()
Gets an array of symbols associated with the options.DBDateTime
getTimestamp()
Gets the timestamp of the data snapshot.long
getUnderlyingId()
Gets the underlying id.String
getUnderlyingSym()
Gets the underlying symbol.String
getUnderlyingType()
Gets the type of underlying (e.g.DBDateTime[]
getYieldCurveDates()
Gets an array of dates defining the yield curve.double[]
getYieldCurveRates()
Gets an array of rates defining the yield curve.void
setCarryCurveDates(DBDateTime[] carryCurveDates)
Sets an array of dates defining the cost-of-carry curve.void
setCarryCurveErrors(double[] carryCurveErrors)
Sets an array of rate errors defining the cost-of-carry curve.void
setCarryCurveRates(double[] carryCurveRates)
Sets an array of rates defining the cost-of-carry curve.void
setDivCashAmounts(double[] divCashAmounts)
Sets an array of cash dividend values for the underlying security.void
setDivExDates(DBDateTime[] divExDates)
Sets an array of dividend ex-dates for the underlying security.void
setDivProportionalAmounts(double[] divProportionalAmounts)
Sets an array of proportional dividend values for the underlying security.void
setFitGroup(String fitGroup)
Set the grouping of the data snapshot.void
setOptionExerciseTypes(String[] optionExerciseTypes)
Sets the type of option exercise (e.g.void
setOptionExpirations(DBDateTime[] optionExpirations)
Sets the expirations associated with the option prices.void
setOptionIds(long[] optionIds)
Sets an array of ids associated with the options.void
setOptionPayoffTypes(String[] optionPayoffTypes)
Sets the type of option payoff (e.g.void
setOptionRoots(String[] optionRoots)
Sets an array of root symbols associated with the options.void
setOptionSettlementTypes(String[] optionSettlementTypes)
Sets the type of option settlement (e.g.void
setOptionStrikes(double[] optionStrikes)
Sets an array of strikes associated with the option prices.void
setOptionSyms(String[] optionSyms)
Sets an array of symbols associated with the options.void
setTimestamp(DBDateTime timestamp)
Set the timestamp of the data snapshot.void
setUnderlyingId(long underlyingId)
Set the underlying id.void
setUnderlyingSym(String usym)
Set the underlying symbol.void
setUnderlyingType(String underlyingType)
Sets the type of underlying (e.g.void
setYieldCurveDates(DBDateTime[] yieldCurveDates)
Sets an array of dates defining the yield curve.void
setYieldCurveRates(double[] yieldCurveRates)
Sets an array of rates defining the yield curve.String
toString()
protected String
toStringContents()
-
Constructor Details
-
CoreFitData
protected CoreFitData()Create a new, empty data set. -
CoreFitData
Copy the data.- Parameters:
data
- data to copy.
-
-
Method Details
-
getFitScope
Description copied from interface:FitDataBase
Gets the scope indicating the extent of this data (e.g. underlying ID + fit group)- Specified by:
getFitScope
in interfaceFitDataBase
- Returns:
- fit scope
-
getFitGroup
Description copied from interface:FitDataBase
Gets the grouping of the data snapshot.- Specified by:
getFitGroup
in interfaceFitDataBase
- Returns:
- grouping of the data snapshot.
-
setFitGroup
Set the grouping of the data snapshot.- Parameters:
fitGroup
- grouping of the data snapshot.
-
getTimestamp
Description copied from interface:FitDataUnderlying
Gets the timestamp of the data snapshot.- Specified by:
getTimestamp
in interfaceFitDataUnderlying
- Returns:
- timestamp of the data snapshot.
-
setTimestamp
Set the timestamp of the data snapshot.- Parameters:
timestamp
- timestamp of the data snapshot.
-
getUnderlyingId
public long getUnderlyingId()Description copied from interface:FitDataUnderlying
Gets the underlying id.- Specified by:
getUnderlyingId
in interfaceFitDataUnderlying
- Returns:
- underlying id.
-
setUnderlyingId
public void setUnderlyingId(long underlyingId)Set the underlying id.- Parameters:
underlyingId
- underlying id.
-
getUnderlyingSym
Description copied from interface:FitDataUnderlying
Gets the underlying symbol.- Specified by:
getUnderlyingSym
in interfaceFitDataUnderlying
- Returns:
- underlying symbol.
-
setUnderlyingSym
Set the underlying symbol.- Parameters:
usym
- underlying symbol.
-
getUnderlyingType
Description copied from interface:FitDataUnderlying
Gets the type of underlying (e.g. "Equity", "Future").- Specified by:
getUnderlyingType
in interfaceFitDataUnderlying
- Returns:
- type of underlying (e.g. "Equity", "Future").
-
setUnderlyingType
Sets the type of underlying (e.g. "Equity", "Future").- Parameters:
underlyingType
- type of underlying (e.g. "Equity", "Future").
-
getOptionIds
public long[] getOptionIds()Description copied from interface:FitDataOptionChain
Gets an array of ids associated with the options.- Specified by:
getOptionIds
in interfaceFitDataOptionChain
- Returns:
- array of ids associated with the options.
-
setOptionIds
public void setOptionIds(long[] optionIds)Sets an array of ids associated with the options.- Parameters:
optionIds
- array of ids associated with the options.
-
getOptionSyms
Description copied from interface:FitDataOptionChain
Gets an array of symbols associated with the options.- Specified by:
getOptionSyms
in interfaceFitDataOptionChain
- Returns:
- array of symbols associated with the options.
-
setOptionSyms
Sets an array of symbols associated with the options.- Parameters:
optionSyms
- array of symbols associated with the options.
-
getOptionRoots
Description copied from interface:FitDataOptionChain
Gets an array of root symbols associated with the options.- Specified by:
getOptionRoots
in interfaceFitDataOptionChain
- Returns:
- array of root symbols associated with the options.
-
setOptionRoots
Sets an array of root symbols associated with the options.- Parameters:
optionRoots
- array of root symbols associated with the options.
-
getOptionExpirations
Description copied from interface:FitDataOptionChain
Gets an array of expirations associated with the option prices.- Specified by:
getOptionExpirations
in interfaceFitDataOptionChain
- Returns:
- array of expirations associated with the option prices.
-
setOptionExpirations
Sets the expirations associated with the option prices.- Parameters:
optionExpirations
- expirations associated with the option prices.
-
getOptionStrikes
public double[] getOptionStrikes()Description copied from interface:FitDataOptionChain
Gets an array of strikes associated with the option prices.- Specified by:
getOptionStrikes
in interfaceFitDataOptionChain
- Returns:
- array of strikes associated with the option prices.
-
setOptionStrikes
public void setOptionStrikes(double[] optionStrikes)Sets an array of strikes associated with the option prices.- Parameters:
optionStrikes
- array of strikes associated with the option prices.
-
getOptionPayoffTypes
Description copied from interface:FitDataOptionChain
Gets the type of option payoff (e.g. "Put", "Call", etc.) associated with the option prices.- Specified by:
getOptionPayoffTypes
in interfaceFitDataOptionChain
- Returns:
- type of option payoff (e.g. "Put", "Call", etc.) associated with the option prices.
-
setOptionPayoffTypes
Sets the type of option payoff (e.g. "Put", "Call", etc.) associated with the option prices.- Parameters:
optionPayoffTypes
- type of option payoff (e.g. "Put", "Call", etc.) associated with the option prices.
-
getOptionExerciseTypes
Description copied from interface:FitDataOptionChain
Gets the type of option exercise (e.g. "American", "European", etc.) associated with the option prices.- Specified by:
getOptionExerciseTypes
in interfaceFitDataOptionChain
- Returns:
- type of option exercise (e.g. "American", "European", etc.) associated with the option prices.
-
setOptionExerciseTypes
Sets the type of option exercise (e.g. "American", "European", etc.) associated with the option prices.- Parameters:
optionExerciseTypes
- type of option exercise (e.g. "American", "European", etc.) associated with the option prices.
-
getOptionSettlementTypes
Description copied from interface:FitDataOptionChain
Gets the type of option settlement (e.g. "Cash", "Underlying", etc.) associated with the option prices.- Specified by:
getOptionSettlementTypes
in interfaceFitDataOptionChain
- Returns:
- type of option settlement (e.g. "Cash", "Underlying", etc.) associated with the option prices.
-
setOptionSettlementTypes
Sets the type of option settlement (e.g. "Cash", "Underlying", etc.) associated with the option prices.- Parameters:
optionSettlementTypes
- type of option settlement (e.g. "Cash", "Underlying", etc.) associated with the option prices.
-
getDivExDates
Description copied from interface:FitDataRates
Gets an array of dividend ex-dates for the underlying security.- Specified by:
getDivExDates
in interfaceFitDataRates
- Returns:
- array of dividend ex-dates for the underlying security.
-
setDivExDates
Sets an array of dividend ex-dates for the underlying security.- Parameters:
divExDates
- array of dividend ex-dates for the underlying security.
-
getDivCashAmounts
public double[] getDivCashAmounts()Description copied from interface:FitDataRates
Gets an array of cash dividend values for the underlying security.- Specified by:
getDivCashAmounts
in interfaceFitDataRates
- Returns:
- array of cash dividend values for the underlying security.
-
setDivCashAmounts
public void setDivCashAmounts(double[] divCashAmounts)Sets an array of cash dividend values for the underlying security.- Parameters:
divCashAmounts
- array of cash dividend values for the underlying security.
-
getDivProportionalAmounts
public double[] getDivProportionalAmounts()Description copied from interface:FitDataRates
Gets an array of proportional dividend values for the underlying security.- Specified by:
getDivProportionalAmounts
in interfaceFitDataRates
- Returns:
- array of proportional dividend values for the underlying security.
-
setDivProportionalAmounts
public void setDivProportionalAmounts(double[] divProportionalAmounts)Sets an array of proportional dividend values for the underlying security.- Parameters:
divProportionalAmounts
- array of proportinoal dividend values for the underlying security.
-
getYieldCurveDates
Description copied from interface:FitDataRates
Gets an array of dates defining the yield curve.- Specified by:
getYieldCurveDates
in interfaceFitDataRates
- Returns:
- array of dates defining the yield curve.
-
setYieldCurveDates
Sets an array of dates defining the yield curve.- Parameters:
yieldCurveDates
- array of dates defining the yield curve.
-
getYieldCurveRates
public double[] getYieldCurveRates()Description copied from interface:FitDataRates
Gets an array of rates defining the yield curve.- Specified by:
getYieldCurveRates
in interfaceFitDataRates
- Returns:
- array of rates defining the yield curve.
-
setYieldCurveRates
public void setYieldCurveRates(double[] yieldCurveRates)Sets an array of rates defining the yield curve.- Parameters:
yieldCurveRates
- array of rates defining the yield curve.
-
getCarryCurveDates
Description copied from interface:FitDataRates
Gets an array of dates defining the cost-of-carry curve.- Specified by:
getCarryCurveDates
in interfaceFitDataRates
- Returns:
- array of dates defining the cost-of-carry curve.
-
setCarryCurveDates
Sets an array of dates defining the cost-of-carry curve.- Parameters:
carryCurveDates
- array of dates defining the cost-of-carry curve.
-
getCarryCurveRates
public double[] getCarryCurveRates()Description copied from interface:FitDataRates
Gets an array of rates defining the cost-of-carry curve.- Specified by:
getCarryCurveRates
in interfaceFitDataRates
- Returns:
- array of rates defining the cost-of-carry curve.
-
setCarryCurveRates
public void setCarryCurveRates(double[] carryCurveRates)Sets an array of rates defining the cost-of-carry curve.- Parameters:
carryCurveRates
- array of rates defining the cost-of-carry curve.
-
getCarryCurveErrors
public double[] getCarryCurveErrors()Description copied from interface:FitDataRates
Gets an array of rate errors defining the cost-of-carry curve.- Specified by:
getCarryCurveErrors
in interfaceFitDataRates
- Returns:
- array of rate errors defining the cost-of-carry curve.
-
setCarryCurveErrors
public void setCarryCurveErrors(double[] carryCurveErrors)Sets an array of rate errors defining the cost-of-carry curve.- Parameters:
carryCurveErrors
- array of rate errors defining the cost-of-carry curve.
-
toStringContents
-
toString
-
clone2d
protected static double[][] clone2d(double[][] vals)
-