vec_math
Class AbstractAnalyser

java.lang.Object
  extended by util.PropertyContainer
      extended by vec_math.AbstractAnalyser
All Implemented Interfaces:
Cloneable, Initializable, PropertyBearing, Analyser
Direct Known Subclasses:
Fourier, LeastFourier, MinimumStringLength, MultipleFrequencyFit, PhaseDispersionMinimization, StatisticAnalyser

public abstract class AbstractAnalyser
extends PropertyContainer
implements Analyser

Is a property container and does supply implementation of visualize(vec_math.VectorG[], vec_math.VectorG[]) and reset().


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyContainer
PropertyContainer.URLResource
 
Field Summary
private static Random random
          We use a random number generator, constructed at class load.
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES
 
Fields inherited from interface util.PropertyBearing
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
protected AbstractAnalyser(Map<String,String> prop)
          Chain.
 
Method Summary
static VectorG[] getBootstrapData(VectorG[] in)
          Returns a bootstrapped data set from the original data with a default duplication rate of 1/e.
static VectorG[] getBootstrapData(VectorG[] in, double fraction)
          Returns a bootstrapped data set from the original data.
static VectorG[] getDiminishedData(VectorG[] in)
          Returns a diminished data set from the original data with a default drop-out rate of 1/e.
static VectorG[] getDiminishedData(VectorG[] in, double fraction)
          For analysers that cannot deal with identical points, we can drop a random fraction of the original data, making the resulting data set smaller.
static VectorG[] getSyntheticData(VectorG[] in, double adderr)
          Generates a synthetic data set out of a measured one.
static VectorG[] getSyntheticData(VectorG[] in, int[] varid, int[] errid, VectorG adderr)
          Generates a synthetic data set out of a measured one.
 void reset()
          Default reset does nothing.
 VectorG[] runningAverage(VectorG[] out, int iy, int halfwidth)
          An implementation of a running average (central, both sides equal) for visualization.
 VectorG[] visualize(VectorG[] in, VectorG[] out)
          Default implementation of visualization returns just the output data.
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, clone, createFrom, createFrom, createFrom, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getLocalClassLoader, getLocalized, getLocalized, getLocalizedString, getLocalizedString, getProperties, getPropertiesToKey, getPropertiesToKey, getProperty, getResource, getResourceAsStream, getResourceFromKey, getResources, has, init, isNew, keyCreate, keyCreate, parseObject, reload, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface vec_math.Analyser
functionCalls, metadata, process, significance
 

Field Detail

random

private static final Random random
We use a random number generator, constructed at class load.

Constructor Detail

AbstractAnalyser

protected AbstractAnalyser(Map<String,String> prop)
Chain.

Method Detail

visualize

public VectorG[] visualize(VectorG[] in,
                           VectorG[] out)
Default implementation of visualization returns just the output data.

Specified by:
visualize in interface Analyser
Parameters:
in - The measured data.
out - The processed data from Analyser.process(vec_math.VectorG[]).
Returns:
Visualizable data derived from processed one.

runningAverage

public VectorG[] runningAverage(VectorG[] out,
                                int iy,
                                int halfwidth)
An implementation of a running average (central, both sides equal) for visualization. The user supplies the data vector, the index in the VectorG where the averaging should take place (normally in y, this is then index=1 and the half-width of the average. The array returned is shorted by twice the half-width of the window.

Parameters:
out - the data vector after analysing.
iy - Index of the y-data (which is to be averaged)
halfwidth - Half-width of the central running average window.

reset

public void reset()
Default reset does nothing.

Specified by:
reset in interface Analyser

getBootstrapData

public static VectorG[] getBootstrapData(VectorG[] in)
Returns a bootstrapped data set from the original data with a default duplication rate of 1/e.

Returns:
A data set of the same length as the original one.

getBootstrapData

public static VectorG[] getBootstrapData(VectorG[] in,
                                         double fraction)
Returns a bootstrapped data set from the original data. The specified fraction of measurements is replaced by duplicates from the original data set.

Parameters:
fraction - The fraction of data points to replace.
Returns:
A data set of the same length as the original one.

getSyntheticData

public static VectorG[] getSyntheticData(VectorG[] in,
                                         double adderr)
Generates a synthetic data set out of a measured one. A synthetic data set varies the measured values within the standard error of all dimensions to generate an artificial data point. It might be used to get confidence limits on parameters not accessible in analytic form.

If input is a three-dim vector as x,y,y_err, meaning only y is afflicted with errors, then varid is a single-element array varid[0]=1 and errid[0] = 2.

Parameters:
in - The original data set, 0=x,1=y,2=err_y
adderr - offset to error

getSyntheticData

public static VectorG[] getSyntheticData(VectorG[] in,
                                         int[] varid,
                                         int[] errid,
                                         VectorG adderr)
Generates a synthetic data set out of a measured one. A synthetic data set varies the measured values within the standard error of all dimensions to generate an artificial data point. It might be used to get confidence limits on parameters not accessible in analytic form.

If input is a three-dim vector as x,y,y_err, meaning only y is afflicted with errors, then varid is a single-element array varid[0]=1 and errid[0] = 2.

Parameters:
in - The original data set
varid - The index in the input vector that should be varied.
errid - The index in the input vector that gives the error of the ith component.
adderr - Each index in varid has an additional error that is added to the value in errid, if original data is too good.

getDiminishedData

public static VectorG[] getDiminishedData(VectorG[] in)
Returns a diminished data set from the original data with a default drop-out rate of 1/e.

Returns:
A data set of the same length as the original one.

getDiminishedData

public static VectorG[] getDiminishedData(VectorG[] in,
                                          double fraction)
For analysers that cannot deal with identical points, we can drop a random fraction of the original data, making the resulting data set smaller.