Class MCMCLocaliser
- All Implemented Interfaces:
TimeDelayLocaliserModel
This is an advanced and highly computationally intensive localisation algorithm based on MCMC methods. For a good description see; The Transit Light Curve (TLC) Project.I. Four Consecutive Transits of the Exoplanet XO-1b Matthew J. Holman1
Input variables are an ArrayListinvalid input: '<'ArrayList
Each row in the time delay ArrayList contains a group time delays calculated from N synchrnoised hydrophones in the corresponding ArrayListinvalid input: '<'ArrayList
Multiple MCMC chains can and should be run. These are executed on different threads to take advantage of multi core processing as much as possible. Even so a large number of chains or large number of observed delays can result in significant processing times.
Results are analysed for convergence and final locations packed into an MCMCTDResults class.
Input
Time Delays
Time Delay Errors
Hydrophone Array
SampaleRate
- Author:
- Jamie Macaulay
-
Constructor Summary
ConstructorDescriptionMCMCLocaliser
(ArrayList<ArrayList<javax.vecmath.Point3f>> hydrophoneArray, ArrayList<ArrayList<Double>> timeDelays, ArrayList<ArrayList<Double>> timeDelayErrors, MCMCParams settings, float sampleRate, double speedOfSound) Deprecated.MCMCLocaliser
(MCMCParams settings) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionaddCrossCorError
(ArrayList<ArrayList<Double>> tdErrors, double timeError, float sampleRate) Deprecated.Adds the cross correlation error to the time delay errors array.AnalyseMCMCResults
(ArrayList<javax.vecmath.Point3f> chainJumps, ArrayList<Double> Chi2, int analysisType) Deprecated.Take an ArrayList of the Markov chain jumps and chi-squared values of each jump and calculate source position.averageChains
(ArrayList<MCMCTDResults> data) Deprecated.Deprecated.Change any settings in the algorithm.static double
chiSquared
(ArrayList<ArrayList<Double>> observedTimeDelays, ArrayList<ArrayList<Double>> chainPosTimeDelays, ArrayList<ArrayList<Double>> errors) Deprecated.Calculates the chi^2 value between observed data and theoretical delays calculated for a certain point in three dimensional space.void
Deprecated.Clear the results from memory.clusterAnalaysis
(ArrayList<MCMCTDResults> meanArray) Deprecated.Perform a cluster analysis of results.compressMCMCResults
(ArrayList<ArrayList<javax.vecmath.Point3f>> jumps, int compressSize) Deprecated.Reduces the number of MCMC jumps in order to reduce memory usage when displaying probability distributions in Java3D or other visualise components.Deprecated.Deprecated.getJumps()
Deprecated.javax.vecmath.Point3f
getNewJumpPoint
(javax.vecmath.Point3f chainPos) Deprecated.Calculates a random new Co-Ordinate, 3D Cartesian or Cylindrical space;Deprecated.Deprecated.Deprecated.getTimeDelays
(javax.vecmath.Point3f chainPos, ArrayList<ArrayList<javax.vecmath.Point3f>> hydrophonePos, double speedOfSound) Deprecated.Calculate the theoretical time delays if a source was located at point3d ChainPos.ArrayList<javax.vecmath.Point3d>
kMeansAnalysis
(ArrayList<MCMCTDResults> meanArray) Deprecated.Sometimes multiple chains will converge to different final distributions.Object[]
Deprecated.Simple Markov Chain Monte Carlo simulation.double
Deprecated.void
Deprecated.Runs the localisation algorithm an creates a results.void
setHydrophonePos
(ArrayList<ArrayList<javax.vecmath.Point3f>> hydrophonePos) Deprecated.void
setSampleRate
(float sampleRate) Deprecated.void
setSoundSpeed
(double speedOfSound) Deprecated.void
setTimeDelays
(ArrayList<ArrayList<Double>> timeDelays) Deprecated.void
setTimeDelaysErrors
(ArrayList<ArrayList<Double>> timeDelayErrors) Deprecated.Note the sample rate must be set before this function.void
stop()
Deprecated.Stop the localiser.
-
Constructor Details
-
Method Details
-
getNewJumpPoint
public javax.vecmath.Point3f getNewJumpPoint(javax.vecmath.Point3f chainPos) Deprecated.Calculates a random new Co-Ordinate, 3D Cartesian or Cylindrical space;- Parameters:
chainPos
-- Returns:
-
randomNGenerator
public double randomNGenerator()Deprecated. -
chiSquared
public static double chiSquared(ArrayList<ArrayList<Double>> observedTimeDelays, ArrayList<ArrayList<Double>> chainPosTimeDelays, ArrayList<ArrayList<Double>> errors) Deprecated.Calculates the chi^2 value between observed data and theoretical delays calculated for a certain point in three dimensional space.- Parameters:
observedTimeDelays
- - the observed time delays.chainPosTimeDelays
- - the set of time delays to compare to the observed time delayserrors
- - the measurement errors in the observed time delays.- Returns:
- chi squared value for observed time delays compared to chain position time delays.
-
getTimeDelays
public static ArrayList<ArrayList<Double>> getTimeDelays(javax.vecmath.Point3f chainPos, ArrayList<ArrayList<javax.vecmath.Point3f>> hydrophonePos, double speedOfSound) Deprecated.Calculate the theoretical time delays if a source was located at point3d ChainPos.- Parameters:
hydrophonePos
- - the positions of all the hydrophones within the array in Cartesian coOrdinates.speedOfSound
- - the speed of sound;ChainPos
- - theoretical position of the source.- Returns:
- The time delays that would result from a source at this location.
-
AnalyseMCMCResults
public MCMCTDResults AnalyseMCMCResults(ArrayList<javax.vecmath.Point3f> chainJumps, ArrayList<Double> Chi2, int analysisType) Deprecated.Take an ArrayList of the Markov chain jumps and chi-squared values of each jump and calculate source position. In order to make sure the burn in phase is not included, a certain initial percentage of jumps is ignored.- Parameters:
chainJumps
-Chi2
-PercentagetoIgnore
-- Returns:
-
mCMC
Deprecated.Simple Markov Chain Monte Carlo simulation. A good description of how this process works can be found in: The Transit Light Curve (TLC) Project.I. Four Consecutive Transits of the Exoplanet XO-1b Matthew J. Holman1, Joshua N. Winn2, David W. Latham1, Francis T. O�Donovan3, David Charbonneau1,7....- Parameters:
observedTimeDelays
-- Returns:
- Object containing an arraylist of successful chain jumps and an arraylist containing the corresponding chi squared values of each successful jump
-
runAlgorithm
public void runAlgorithm()Deprecated.Description copied from interface:TimeDelayLocaliserModel
Runs the localisation algorithm an creates a results. The results are dependednt on the localisation class.- Specified by:
runAlgorithm
in interfaceTimeDelayLocaliserModel
-
clusterAnalaysis
Deprecated.Perform a cluster analysis of results. The clustering algorithm used is determined by the MCMC localiser params. -
kMeansAnalysis
Deprecated.Sometimes multiple chains will converge to different final distributions. If this is the case the results must be clustered, otherwise the final answer will simply be the mean of the two different distributions. Here a 3D k-means clustering algorithm is used in x, y and z . First, nk random points are assigned in space based on the start dispersion. Next, all chains are clusters corresponding to their euclidian distance from these two random points. The random points then move to the centroid of their correpsonding clusters. The process repeats 'int iterations' times by which time it is likely convergence will have occurred. Clustering is attempted 'int attempts' times from different random positions.- Parameters:
meanArray
- - the mean values of all chains;- Returns:
-
averageChains
Deprecated. -
addCrossCorError
public static ArrayList<ArrayList<Double>> addCrossCorError(ArrayList<ArrayList<Double>> tdErrors, double timeError, float sampleRate) Deprecated.Adds the cross correlation error to the time delay errors array.- Parameters:
tdErrors
-timeError
-sampleRate
-- Returns:
-
setTimeDelays
Deprecated. -
setTimeDelaysErrors
Deprecated.Note the sample rate must be set before this function.- Parameters:
timeDelayErrors
-- Throws:
Exception
-
setHydrophonePos
Deprecated. -
getHydrophonePos
Deprecated. -
getJumps
Deprecated. -
getChiJumps
Deprecated. -
getResultsAllChains
Deprecated. -
getResults
Deprecated. -
changeSettings
Deprecated.Description copied from interface:TimeDelayLocaliserModel
Change any settings in the algorithm.- Specified by:
changeSettings
in interfaceTimeDelayLocaliserModel
- Returns:
-
getSettings
Deprecated. -
setSampleRate
public void setSampleRate(float sampleRate) Deprecated. -
setSoundSpeed
public void setSoundSpeed(double speedOfSound) Deprecated. -
compressMCMCResults
public static ArrayList<ArrayList<javax.vecmath.Point3f>> compressMCMCResults(ArrayList<ArrayList<javax.vecmath.Point3f>> jumps, int compressSize) Deprecated.Reduces the number of MCMC jumps in order to reduce memory usage when displaying probability distributions in Java3D or other visualise components.- Parameters:
jumps
- ArrayList of chain jumps to compresscompressSize
- - the ideal number of points in the new array. Note: unless compressSize exactly divides the jump size then final arrays will be slightly larger than compressSize- Returns:
-
stop
public void stop()Deprecated.Description copied from interface:TimeDelayLocaliserModel
Stop the localiser. For MCMC, which can takes minutes to compute this is important. For other localisers, such as Simplex, this is unimportant and can be left blank.- Specified by:
stop
in interfaceTimeDelayLocaliserModel
-
clearResults
public void clearResults()Deprecated.Clear the results from memory.
-