Package qa.generator.distributions
Class QACorrelatedSequence
java.lang.Object
qa.generator.distributions.QADistribution
qa.generator.distributions.QACorrelatedSequence
Make a correlated sequence of values with a given width and mean. 
This can be used to generate slowly varying amplitude and ICI sequences. Works by generating the numbers from a base distribution and then filtering them at a frequency of 1/correlation using a 'correlation' order butterworth filter.
- Author:
 - dg50
 
- 
Constructor Summary
ConstructorsConstructorDescriptionQACorrelatedSequence(boolean integrate, double mean, double width, int correlation) Construct a correlated sequence of values with given mean and distribution width using a gamma distribution.QACorrelatedSequence(boolean integrate, QADistribution baseDistribution, double mean, double width, int correlation) Construct a correlated sequence of values with given mean and distribution width using a gamma distribution. - 
Method Summary
Modifier and TypeMethodDescriptionprotected double[]createValues(int nValues) Generate a set of random values according to the underlying distribution.double[]getRange(double nSigma) Get the range of the distrubution.Methods inherited from class qa.generator.distributions.QADistribution
getRange, getValues, isIntegrate, isSort, setIntegrate, setSort 
- 
Constructor Details
- 
QACorrelatedSequence
public QACorrelatedSequence(boolean integrate, QADistribution baseDistribution, double mean, double width, int correlation) Construct a correlated sequence of values with given mean and distribution width using a gamma distribution.- Parameters:
 integrate- integrate the values (e.g. to give times rather than inter-click intervals)baseDistribution- underlying distribution. This will probably need to be set up with a width (e.g. the Guassian sigma) of sqrt(correlation) times the width you want in the distribution of the output data.mean- mean valuewidth- width of distributioncorrelation- order of the correlation
 - 
QACorrelatedSequence
public QACorrelatedSequence(boolean integrate, double mean, double width, int correlation) Construct a correlated sequence of values with given mean and distribution width using a gamma distribution.- Parameters:
 integrate- integrate the values (e.g. to give times rather than inter-click intervals)mean- mean valuewidth- width of distributioncorrelation- order of the correlation
 
 - 
 - 
Method Details
- 
createValues
protected double[] createValues(int nValues) Description copied from class:QADistributionGenerate a set of random values according to the underlying distribution.Do not sort or integrate within createValues, that wil be handled by the calling getValues function
- Specified by:
 createValuesin classQADistribution- Parameters:
 nValues- number of values to generate.- Returns:
 - array of values.
 
 - 
getRange
public double[] getRange(double nSigma) Description copied from class:QADistributionGet the range of the distrubution. How this is defined is a little nebulous, for Guassian like distributions its the mean +/- n standard deviations.- Specified by:
 getRangein classQADistribution- Parameters:
 nSigma- number of Standard Deviations (or equivalents).- Returns:
 - The range of values.
 
 
 -