Class MCMCLocaliser

java.lang.Object
Localiser.algorithms.genericLocaliser.MCMC.old.MCMCLocaliser
All Implemented Interfaces:
TimeDelayLocaliserModel

@Deprecated public class MCMCLocaliser extends Object implements TimeDelayLocaliserModel
Deprecated.
Markov chain Monte Carlo (MCMC) time delay based localisation algorithm.

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> of observed time delays, along with a corresponding error ArrayListinvalid input: '<'ArrayList> and ArrayListinvalid input: '<'ArrayList> of hydrophone positions. The time delay and delay errors arraylist will be exactly the same size.

Each row in the time delay ArrayList contains a group time delays calculated from N synchrnoised hydrophones in the corresponding ArrayListinvalid input: '<'ArrayList> row. This allows potential locaisation between large groups of unsynchronised hydrophones, a situation always encountered during target motions analysis.

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 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 delays
      errors - - 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

      public Object[] mCMC(ArrayList<ArrayList<Double>> observedTimeDelays)
      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 interface TimeDelayLocaliserModel
    • clusterAnalaysis

      public ArrayList<MCMCTDResults> clusterAnalaysis(ArrayList<MCMCTDResults> meanArray)
      Deprecated.
      Perform a cluster analysis of results. The clustering algorithm used is determined by the MCMC localiser params.
    • kMeansAnalysis

      public ArrayList<javax.vecmath.Point3d> kMeansAnalysis(ArrayList<MCMCTDResults> meanArray)
      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

      public MCMCTDResults averageChains(ArrayList<MCMCTDResults> data)
      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

      public void setTimeDelays(ArrayList<ArrayList<Double>> timeDelays)
      Deprecated.
    • setTimeDelaysErrors

      public void setTimeDelaysErrors(ArrayList<ArrayList<Double>> timeDelayErrors)
      Deprecated.
      Note the sample rate must be set before this function.
      Parameters:
      timeDelayErrors -
      Throws:
      Exception
    • setHydrophonePos

      public void setHydrophonePos(ArrayList<ArrayList<javax.vecmath.Point3f>> hydrophonePos)
      Deprecated.
    • getHydrophonePos

      public ArrayList<ArrayList<javax.vecmath.Point3f>> getHydrophonePos()
      Deprecated.
    • getJumps

      public ArrayList<ArrayList<javax.vecmath.Point3f>> getJumps()
      Deprecated.
    • getChiJumps

      public ArrayList<ArrayList<Double>> getChiJumps()
      Deprecated.
    • getResultsAllChains

      public ArrayList<MCMCTDResults> getResultsAllChains()
      Deprecated.
    • getResults

      public ArrayList<MCMCTDResults> getResults()
      Deprecated.
    • changeSettings

      public Boolean changeSettings()
      Deprecated.
      Description copied from interface: TimeDelayLocaliserModel
      Change any settings in the algorithm.
      Specified by:
      changeSettings in interface TimeDelayLocaliserModel
      Returns:
    • getSettings

      public MCMCParams 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 compress
      compressSize - - 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 interface TimeDelayLocaliserModel
    • clearResults

      public void clearResults()
      Deprecated.
      Clear the results from memory.