vec_math
Class PhaseDispersionMinimization

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

public class PhaseDispersionMinimization
extends AbstractAnalyser

Does the calculation of a period using phase dispersion minimization according to Stellignwerf, ApJ 224, 953 (1978). The code has been tested with the same data set as in the paper above:


Nested Class Summary
static class PhaseDispersionMinimization.File
          Use the phase dispersion on file data.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
static int[][] BINNINGS
          Binnings to use.
static int[] BINSWITCH
          Binning switch as a function of data points.
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_BINNING
          The key for the binnings, no default.
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
PhaseDispersionMinimization(Map<String,String> prop)
          Creates a new phase dispersion minimizer.
 
Method Summary
private static int[] binnings(int length)
          Calculates the binning from set length.
private static int[] binningsFromString(String bin)
          Parses a binnings-string like 5,2 into the binnings array.
private static Vector2D dispersion(VectorG[] sorted, double period, int[] bins, double norm)
          Calculates a single theta value for a given period.
static double falseAlarm(int n, double theta)
          Estimates the false Alarm of a theta value by simple means of chi-square thesis.
 long[] functionCalls(VectorG[] data)
          Only plain arithmetics.
 Object[] metadata(VectorG[] in, VectorG[] proc, VectorG[] visual)
          Phase dispersion minimization analysis have no metadata.
static Vector2D[] pdm(VectorG[] data)
          Calculates the Theta-array for a given t vs.
static Vector2D[] pdm(VectorG[] sorted, double pmin, double pmax)
          Calculates the Theta-array for a given t vs.
static Vector2D[] pdm(VectorG[] sorted, double norm, double pmin, double pmax, int fnum, int[] bin)
          Calculates the Theta-array for a given t vs.
static Vector2D[] pdm(VectorG[] sorted, double pmin, double pmax, int fnum)
          Calculates the Theta-array for a given t vs.
static Vector2D[] pdm(VectorG[] sorted, double pmin, double pmax, int fnum, int[] bin)
          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.
 
Methods inherited from class vec_math.AbstractAnalyser
getBootstrapData, getBootstrapData, getDiminishedData, getDiminishedData, getSyntheticData, getSyntheticData, runningAverage, visualize
 
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_BINNING

public static final String KEY_BINNING
The key for the binnings, 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

BINNINGS

public static final int[][] BINNINGS
Binnings to use.


BINSWITCH

public static final int[] BINSWITCH
Binning switch as a function of data points.


FREQNUM

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

See Also:
Constant Field Values
Constructor Detail

PhaseDispersionMinimization

public PhaseDispersionMinimization(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

functionCalls

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

Returns:
null If unknown.

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.

metadata

public Object[] metadata(VectorG[] in,
                         VectorG[] proc,
                         VectorG[] visual)
Phase dispersion minimization 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 AbstractAnalyser.visualize(vec_math.VectorG[], vec_math.VectorG[]).

pdm

public static Vector2D[] pdm(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 Θ.

pdm

public static Vector2D[] pdm(VectorG[] sorted,
                             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:
sorted - A sorted in x 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 Θ.

pdm

public static Vector2D[] pdm(VectorG[] sorted,
                             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:
sorted - A sorted in x 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 Θ.

pdm

public static Vector2D[] pdm(VectorG[] sorted,
                             double pmin,
                             double pmax,
                             int fnum,
                             int[] bin)
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:
sorted - A sorted in x 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 Θ.

pdm

public static Vector2D[] pdm(VectorG[] sorted,
                             double norm,
                             double pmin,
                             double pmax,
                             int fnum,
                             int[] bin)
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:
sorted - A sorted in x 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 Θ.

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

falseAlarm

public static double falseAlarm(int n,
                                double theta)
Estimates the false Alarm of a theta value by simple means of chi-square thesis. Eq. 5, p 954, only for high n (n=sum(nj)-M).


binningsFromString

private static int[] binningsFromString(String bin)
Parses a binnings-string like 5,2 into the binnings array.


binnings

private static int[] binnings(int length)
Calculates the binning from set length.


dispersion

private static final Vector2D dispersion(VectorG[] sorted,
                                         double period,
                                         int[] bins,
                                         double norm)
Calculates a single theta value for a given period.
       Θ=s&pow2;/σ&pow2;
σ&pow2;=Σ(ti-)&pow2;/(N-1)
s...Subset sigma.

Parameters:
sorted - A sorted in x 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 Θ.