public abstract class FinanceUtils extends Object
Modifier and Type | Method and Description |
---|---|
static double |
calculateValueAtRisk(double expRet,
double stdDev,
double confidence,
double time) |
static GeometricBrownianMotion |
estimateExcessDiffusionProcess(CalendarDateSeries<?> priceSeries,
CalendarDateSeries<?> riskFreeInterestRateSeries,
CalendarDateUnit timeUnit) |
static CalendarDateSeries<RandomNumber> |
forecast(CalendarDateSeries<? extends Number> series,
int pointCount,
CalendarDateUnit timeUnit,
boolean includeOriginalSeries) |
static CalendarDateSeries<BigDecimal> |
makeCalendarPriceSeries(double[] prices,
Calendar startCalendar,
CalendarDateUnit resolution) |
static <V extends Number> |
makeCovarianceMatrix(Collection<CalendarDateSeries<V>> timeSeriesCollection) |
static <N extends Number> |
makeCovarianceMatrix(List<CalendarDateSeries<N>> listOfTimeSeries,
boolean mayBeMissingValues) |
static CalendarDateSeries<BigDecimal> |
makeDatePriceSeries(double[] prices,
Date startDate,
CalendarDateUnit resolution) |
static SampleSet |
makeExcessGrowthRateSampleSet(CalendarDateSeries<?> priceSeries,
CalendarDateSeries<?> riskFreeInterestRateSeries) |
static CalendarDateSeries<Double> |
makeNormalisedExcessPrice(CalendarDateSeries<?> priceSeries,
CalendarDateSeries<?> riskFreeInterestRateSeries) |
static double |
toAnnualReturnFromGrowthFactor(double growthFactor,
CalendarDateUnit growthFactorUnit)
GrowthRate = ln(GrowthFactor)
|
static double |
toAnnualReturnFromGrowthRate(double growthRate,
CalendarDateUnit growthRateUnit)
AnnualReturn = exp(GrowthRate * GrowthRateUnitsPerYear) - 1.0
|
static PrimitiveMatrix |
toCorrelations(Access2D<?> covariances) |
static PrimitiveMatrix |
toCorrelations(Access2D<?> covariances,
boolean clean)
Will extract the correlation coefficients from the input covariance matrix.
|
static PrimitiveMatrix |
toCovariances(Access1D<?> volatilities,
Access2D<?> correlations)
Vill constract a covariance matrix from the standard deviations (volatilities) and correlation
coefficient,
|
static double |
toGrowthFactorFromAnnualReturn(double annualReturn,
CalendarDateUnit growthFactorUnit)
GrowthFactor = exp(GrowthRate)
|
static double |
toGrowthRateFromAnnualReturn(double annualReturn,
CalendarDateUnit growthRateUnit)
GrowthRate = ln(1.0 + InterestRate) / GrowthRateUnitsPerYear
|
static PrimitiveMatrix |
toVolatilities(Access2D<?> covariances) |
static PrimitiveMatrix |
toVolatilities(Access2D<?> covariances,
boolean clean)
Will extract the standard deviations (volatilities) from the input covariance matrix.
|
public static double calculateValueAtRisk(double expRet, double stdDev, double confidence, double time)
public static GeometricBrownianMotion estimateExcessDiffusionProcess(CalendarDateSeries<?> priceSeries, CalendarDateSeries<?> riskFreeInterestRateSeries, CalendarDateUnit timeUnit)
public static CalendarDateSeries<RandomNumber> forecast(CalendarDateSeries<? extends Number> series, int pointCount, CalendarDateUnit timeUnit, boolean includeOriginalSeries)
public static CalendarDateSeries<BigDecimal> makeCalendarPriceSeries(double[] prices, Calendar startCalendar, CalendarDateUnit resolution)
public static <V extends Number> BasicMatrix makeCovarianceMatrix(Collection<CalendarDateSeries<V>> timeSeriesCollection)
timeSeriesCollection
- public static <N extends Number> PrimitiveMatrix makeCovarianceMatrix(List<CalendarDateSeries<N>> listOfTimeSeries, boolean mayBeMissingValues)
listOfTimeSeries
- An ordered collection of time seriesmayBeMissingValues
- Individual series may be missing some values - try to fix this or notpublic static CalendarDateSeries<BigDecimal> makeDatePriceSeries(double[] prices, Date startDate, CalendarDateUnit resolution)
public static SampleSet makeExcessGrowthRateSampleSet(CalendarDateSeries<?> priceSeries, CalendarDateSeries<?> riskFreeInterestRateSeries)
priceSeries
- A series of pricesriskFreeInterestRateSeries
- A series of interest rates (risk free return expressed in %, 5.0
means 5.0% annualized risk free return)public static CalendarDateSeries<Double> makeNormalisedExcessPrice(CalendarDateSeries<?> priceSeries, CalendarDateSeries<?> riskFreeInterestRateSeries)
priceSeries
- A series of pricesriskFreeInterestRateSeries
- A series of interest rates (risk free return expressed in %, 5.0
means 5.0% annualized risk free return)public static double toAnnualReturnFromGrowthFactor(double growthFactor, CalendarDateUnit growthFactorUnit)
growthFactor
- A growth factor per unit (day, week, month, year...)growthFactorUnit
- A growth factor unitpublic static double toAnnualReturnFromGrowthRate(double growthRate, CalendarDateUnit growthRateUnit)
growthRate
- A growth rate per unit (day, week, month, year...)growthRateUnit
- A growth rate unitpublic static PrimitiveMatrix toCorrelations(Access2D<?> covariances)
public static PrimitiveMatrix toCorrelations(Access2D<?> covariances, boolean clean)
public static PrimitiveMatrix toCovariances(Access1D<?> volatilities, Access2D<?> correlations)
public static double toGrowthFactorFromAnnualReturn(double annualReturn, CalendarDateUnit growthFactorUnit)
annualReturn
- Annualised return (percentage per year)growthFactorUnit
- A growth factor unitpublic static double toGrowthRateFromAnnualReturn(double annualReturn, CalendarDateUnit growthRateUnit)
annualReturn
- Annualised return (percentage per year)growthRateUnit
- A growth rate unitpublic static PrimitiveMatrix toVolatilities(Access2D<?> covariances)
public static PrimitiveMatrix toVolatilities(Access2D<?> covariances, boolean clean)
Copyright © 2017 Optimatika. All rights reserved.