public final class Returns extends Object
Modifier and Type | Method and Description |
---|---|
static Vector |
getMeanReturns(double[][] returns)
Computes a vector of mean returns of the input returns (one column for
one asset).
|
static Vector |
getMeanReturns(Matrix returns)
Computes a vector of mean returns of the input returns (one column for
one asset).
|
static double[] |
getPricesFromReturns(double price0,
double[] returns,
ReturnsCalculator calc)
Gets the price series from a return series.
|
static double[] |
getReturns(double[] lastPrices,
double[] currentPrices,
ReturnsCalculator calc) |
static double[] |
getReturnsFromPrices(double[] prices,
ReturnsCalculator calc)
Computes returns series from prices.
|
static double[][] |
getVectorReturnsFromPrices(double[][] prices,
ReturnsCalculator calc)
Computes returns for a 2D array of prices (one column for one asset),
with the given ReturnsCalculator.
|
public static double[] getReturnsFromPrices(double[] prices, ReturnsCalculator calc)
prices
- a series of pricescalc
- the type of returns calculationpublic static double[] getPricesFromReturns(double price0, double[] returns, ReturnsCalculator calc)
price0
- the initial pricereturns
- a return seriescalc
- a type of returns calculationpublic static double[][] getVectorReturnsFromPrices(double[][] prices, ReturnsCalculator calc)
prices
- the price arraycalc
- the type of returns calculationpublic static double[] getReturns(double[] lastPrices, double[] currentPrices, ReturnsCalculator calc)
public static Vector getMeanReturns(double[][] returns)
returns
- the returnsCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.