vec_math
Class MinimumStringLength

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by vec_math.AbstractAnalyser
                  extended by vec_math.MinimumStringLength
All Implemented Interfaces:
Cloneable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, Analyser

public class MinimumStringLength
extends AbstractAnalyser

Does the calculation of a period using string length minimization according to Dworetsky, MNRAS 203, 917. The code has been tested with the same data set as in the Stellignwerf, ApJ 224, 953 (1978)paper


Nested Class Summary
static class MinimumStringLength.File
          Use the phase dispersion on file data.
static class MinimumStringLength.Test
          Test against Kepler orbits.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
static double DEFNYQUIST
          Default Nyqusit range scan.
static double DEFOVERSAMPLING
          Default oversampling.
static double DEFSPAN
          Default factor for minimum frequency.
static int FREQNUM
          The number of frequencies to search.
static String KEY_AVERAGEWIDTH
          The key for the running average half-width on visualize.
static String KEY_FREQNUM
          The key for the maximum number of frequencies to scan, no default.
static String KEY_MINPERIOD
          The key for the minimum period, no default.
static String KEY_NYQUIST
          The key for the nyquist multiplier.
static String KEY_OVERSAMPLING
          The key for the oversampling.
static String KEY_SPAN
          The key for the span multiplier.
static String KEY_STRETCH
          The key for the data time span, no default.
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
MinimumStringLength(Map<String,String> prop)
          Creates a new phase dispersion minimizer.
 
Method Summary
 long[] functionCalls(VectorG[] data)
          Only plain arithmetics and roots.
 Object[] metadata(VectorG[] in, VectorG[] proc, VectorG[] visual)
          Minimum string length analysis have no metadata.
static Vector2D[] msl(VectorG[] data)
          Calculates the Theta-array for a given t vs.
static Vector2D[] msl(VectorG[] unscaled, double pmin, double pmax)
          Calculates the Theta-array for a given t vs.
static Vector2D[] msl(VectorG[] unscaled, double pmin, double pmax, int fnum)
          Calculates the Theta-array for a given t vs.
 VectorG[] process(VectorG[] data)
          Calls the processing as phase-dispersion minimization.
 void reset()
          Cleans frequency ans stretch keys.
 double significance(double theta, VectorG[] data, VectorG[] p, VectorG[] v)
          Estimates the significance of a theta value by simple means of chi-square thesis.
private static Vector2D strlen(VectorG[] unscaled, double period, double ymin, double ymax)
          Calculates a single string length for a given period.
 VectorG[] visualize(VectorG[] in, VectorG[] out)
          For visualization, we calculate the running average of the output.
 
Methods inherited from class vec_math.AbstractAnalyser
getBootstrapData, getBootstrapData, getDiminishedData, getDiminishedData, getSyntheticData, getSyntheticData, runningAverage
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, 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 util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 
Methods inherited from interface util.Initializable
init
 

Field Detail

KEY_OVERSAMPLING

public static final String KEY_OVERSAMPLING
The key for the oversampling.

See Also:
Constant Field Values

KEY_NYQUIST

public static final String KEY_NYQUIST
The key for the nyquist multiplier.

See Also:
Constant Field Values

KEY_SPAN

public static final String KEY_SPAN
The key for the span multiplier.

See Also:
Constant Field Values

KEY_FREQNUM

public static final String KEY_FREQNUM
The key for the maximum number of frequencies to scan, no default.

See Also:
Constant Field Values

KEY_STRETCH

public static final String KEY_STRETCH
The key for the data time span, no default.

See Also:
Constant Field Values

KEY_MINPERIOD

public static final String KEY_MINPERIOD
The key for the minimum period, no default.

See Also:
Constant Field Values

KEY_AVERAGEWIDTH

public static final String KEY_AVERAGEWIDTH
The key for the running average half-width on visualize.

See Also:
Constant Field Values

DEFOVERSAMPLING

public static final double DEFOVERSAMPLING
Default oversampling.

See Also:
Constant Field Values

DEFNYQUIST

public static final double DEFNYQUIST
Default Nyqusit range scan.

See Also:
Constant Field Values

DEFSPAN

public static final double DEFSPAN
Default factor for minimum frequency.

See Also:
Constant Field Values

FREQNUM

public static final int FREQNUM
The number of frequencies to search.

See Also:
Constant Field Values
Constructor Detail

MinimumStringLength

public MinimumStringLength(Map<String,String> prop)
Creates a new phase dispersion minimizer.

Method Detail

reset

public void reset()
Cleans frequency ans stretch keys.

Specified by:
reset in interface Analyser
Overrides:
reset in class AbstractAnalyser

process

public VectorG[] process(VectorG[] data)
Calls the processing as phase-dispersion minimization.

Parameters:
data - The measured data.
Returns:
Processed data of the same length as input data.

visualize

public VectorG[] visualize(VectorG[] in,
                           VectorG[] out)
For visualization, we calculate the running average of the output. The length of the average is stored in the #KEY_AVERAGE property.

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

functionCalls

public long[] functionCalls(VectorG[] data)
Only plain arithmetics and roots.

Returns:
null If unknown.

msl

public static Vector2D[] msl(VectorG[] data)
Calculates the Theta-array for a given t vs. something array. The values of theta are defined by
       Θ=s&pow2;/σ&pow2;
σ&pow2;=Σ(ti-)&pow2;/(N-1)
s...Subset sigma.

Parameters:
data - An array of measurements y at times x.
Returns:
An array of frequencies and corresponding Θ.

msl

public static Vector2D[] msl(VectorG[] unscaled,
                             double pmin,
                             double pmax)
Calculates the Theta-array for a given t vs. something array. The values of theta are defined by
       Θ=s&pow2;/σ&pow2;
σ&pow2;=Σ(ti-)&pow2;/(N-1)
s...Subset sigma.

Parameters:
unscaled - A unscaled array of measurements y at times x.
pmin - Minimum period to search in t units.
pmax - Maximum period to search in t units.
Returns:
An array of frequencies and corresponding Θ.

msl

public static Vector2D[] msl(VectorG[] unscaled,
                             double pmin,
                             double pmax,
                             int fnum)
Calculates the Theta-array for a given t vs. something array. The values of theta are defined by
       Θ=s&pow2;/σ&pow2;
σ&pow2;=Σ(ti-)&pow2;/(N-1)
s...Subset sigma.

Parameters:
unscaled - A unscaled array of measurements y at times x.
pmin - Minimum period to search in t units.
pmax - Maximum period to search in t units.
fnum - Number of frequencies to search
Returns:
An array of frequencies and corresponding Θ.

metadata

public Object[] metadata(VectorG[] in,
                         VectorG[] proc,
                         VectorG[] visual)
Minimum string length analysis have no metadata.

Parameters:
in - The original data, before process.
proc - The processed data from process(vec_math.VectorG[]).
visual - The visualized data from visualize(vec_math.VectorG[], vec_math.VectorG[]).

significance

public double significance(double theta,
                           VectorG[] data,
                           VectorG[] p,
                           VectorG[] v)
Estimates the significance of a theta value by simple means of chi-square thesis. Eq. 5, p 954, only for high n (n=sum(nj)-M).

Parameters:
theta - The value whose significance is to be probed.
data - The original data, before process.
p - The processed data from Analyser.process(vec_math.VectorG[]).
v - The visualized data from Analyser.visualize(vec_math.VectorG[], vec_math.VectorG[]).
Returns:
A significance, 1-false-Alarm probability

strlen

private static final Vector2D strlen(VectorG[] unscaled,
                                     double period,
                                     double ymin,
                                     double ymax)
Calculates a single string length for a given period.
       λ=Σ(y'i-y'i-1)&pow2;+(Φi-Φi-1)&pow2;,
where y' = 0.5*(y-ymin)/(ymax-ymin)-0.25

Parameters:
unscaled - A unscaled array of measurements y at times x.
period - Trial period.
bin - Binning to be applied.
norm - The variance of the total data set for normailzation.
Returns:
An array of frequencies and corresponding Θ.