org.ojalgo.random
Class SampleSet

java.lang.Object
  extended by org.ojalgo.random.SampleSet

public class SampleSet
extends Object


Constructor Summary
SampleSet(Array1Dim<?> anArray)
           
SampleSet(BigDecimal[] someValues)
           
 
Method Summary
 double getCorrelation(SampleSet aSet)
           
 double getCovariance(SampleSet aSet)
           
 double getMean()
           
 double getStandardDeviation()
           
 double getSumOfSquares()
          "Sum of squares is a concept that permeates much of inferential statistics and descriptive statistics.
 double getVariance()
           
static SampleSet make(RandomNumber aRndmNmbr, int aSize)
           
static
<K extends Comparable<K>,V extends Number>
SampleSet
makeFromPriceAndRiskFreeSeries(TimeSeries<K,V> aPriceSeries, TimeSeries<K,V> aRiskFreeInterestRateSeries)
          Deprecated. Use FinanceUtils#makeFromPriceAndRiskFreeSeries(TimeSeries,TimeSeries) instead
static
<K extends Comparable<K>,V extends Number>
SampleSet
makeUsingGeometricChanges(BasicSeries<K,V> aSeries)
          Does not alter the series in any way.
static
<K extends Comparable<K>,V extends Number>
SampleSet
makeUsingLinearChanges(BasicSeries<K,V> aSeries)
          Does not alter the series in any way.
static
<K extends Comparable<K>,V extends Number>
SampleSet
makeUsingValues(BasicSeries<K,V> aSeries)
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SampleSet

public SampleSet(Array1Dim<?> anArray)

SampleSet

public SampleSet(BigDecimal[] someValues)
Method Detail

make

public static SampleSet make(RandomNumber aRndmNmbr,
                             int aSize)

makeFromPriceAndRiskFreeSeries

public static <K extends Comparable<K>,V extends Number> SampleSet makeFromPriceAndRiskFreeSeries(TimeSeries<K,V> aPriceSeries,
                                                                                                  TimeSeries<K,V> aRiskFreeInterestRateSeries)
Deprecated. Use FinanceUtils#makeFromPriceAndRiskFreeSeries(TimeSeries,TimeSeries) instead

Type Parameters:
K - Time series key type
V - Time series value type
Parameters:
aPriceSeries - A series of prices
aRiskFreeInterestRateSeries - A series of interest rates (risk free return)
Returns:
A sample set of price growth factors adjusted for risk free return

makeUsingGeometricChanges

public static <K extends Comparable<K>,V extends Number> SampleSet makeUsingGeometricChanges(BasicSeries<K,V> aSeries)
Does not alter the series in any way. Example use case: You want to create a SampleSet based on this BasicSeries by first calculating the log of each of the values in the series, and then the differences between following values. A SampleSet item is log(xi+1) - log(xi) which is the same as log(xi+1 / xi).


makeUsingLinearChanges

public static <K extends Comparable<K>,V extends Number> SampleSet makeUsingLinearChanges(BasicSeries<K,V> aSeries)
Does not alter the series in any way. Returns a SampleSet with one less item where each item is xi+1 - xi


makeUsingValues

public static <K extends Comparable<K>,V extends Number> SampleSet makeUsingValues(BasicSeries<K,V> aSeries)

getCorrelation

public double getCorrelation(SampleSet aSet)

getCovariance

public double getCovariance(SampleSet aSet)

getMean

public double getMean()

getStandardDeviation

public double getStandardDeviation()

getSumOfSquares

public double getSumOfSquares()

"Sum of squares is a concept that permeates much of inferential statistics and descriptive statistics. More properly, it is "the sum of the squared deviations". Mathematically, it is an unscaled, or unadjusted measure of dispersion (also called variability). When scaled for the number of degrees of freedom, it estimates the variance, or spread of the observations about their mean value."

Wikipedia


getVariance

public double getVariance()

size

public int size()

toString

public String toString()
Overrides:
toString in class Object