de.unihalle.informatik.MiToBo.tracking.multitarget.distributions.impl
Class AssociationDistributionNN<S extends TargetID,T extends TargetID>

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.tracking.multitarget.distributions.abstracts.AbstractAssociationDistribution<S,T>
      extended by de.unihalle.informatik.MiToBo.tracking.multitarget.distributions.impl.AssociationDistribution<S,T>
          extended by de.unihalle.informatik.MiToBo.tracking.multitarget.distributions.impl.AssociationDistributionNN<S,T>
Type Parameters:
S - Type of discrete variables in the multi target observation
T - Type of discrete variables in the multi target state
All Implemented Interfaces:
EvaluatableDistribution<DataAssociation>, LogEvaluatableDistribution<DataAssociation>, SamplingDistribution<DataAssociation>

public class AssociationDistributionNN<S extends TargetID,T extends TargetID>
extends AssociationDistribution<S,T>

Association distribution to sample association variables for a set of observations based on a model of how observations are formed.

Observations are comprised from existing targets that are detected with probability P_D, a number of observations of newborn targets distributed according to a distribution nu and a number of clutter observations distributed according to a distribution mu.

The association variables of the individual observations are sampled sequentially and their distributions are assumed to depend on the likelihood of the current observation for a specific realization of the association variable and the probability of the association variable given all previous associations. Furthermore the likelihood of nearby observations is considered. The number of the considered neighboring observations can be controlled by a maximum number as well as a maximum Euklidean distance. Keep the combinatorial problem in mind that explodes when the number of considered neighbors increases!!

Author:
Oliver Gress

Nested Class Summary
static class AssociationDistributionNN.AType
           
private  class AssociationDistributionNN.ObsDistance
           
private  class AssociationDistributionNN.ProbTreeData
           
 
Field Summary
protected  AssociationDistributionNN.ObsDistance[][] kNearestObs
          Stores for each observation the k-nearest observations that will be associated after the corresponding observation.
protected  LogFaculty logFac
          An object to compute and store log(n!)
protected  double maxDistNeighbors
          Maximum distance of neighboring observations
protected  int maxNumNeighbors
          Maximum number of neighboring observations
 
Fields inherited from class de.unihalle.informatik.MiToBo.tracking.multitarget.distributions.impl.AssociationDistribution
chi, lastM, lastN, lastSample, logBinom, logMuValues, logNuValues, logP_C, logP_MN, M_max, minMN, mu, newtargetID, nu, P_D, phi_0, phi_1, psi
 
Fields inherited from class de.unihalle.informatik.MiToBo.tracking.multitarget.distributions.abstracts.AbstractAssociationDistribution
assocfactory, clutterdistrib, log_pzc, M, N, newborndistrib, obsdistrib, rand, Z
 
Constructor Summary
AssociationDistributionNN(java.util.Random rand, AbstractMultiState<S> Z, AbstractMultiObservationDistributionIndep<S,T> observationDistrib, LogProbabilityDensityFunction spatialClutterDistrib, LogProbabilityDensityFunction spatialNewbornDistrib, LogProbabilityMassFunction mu, LogProbabilityMassFunction nu, double P_D, int maxNumNeighbors, double maxDistNeighbors)
          Constructor.
AssociationDistributionNN(java.util.Random rand, AbstractMultiState<S> Z, AbstractMultiObservationDistributionIndep<S,T> observationDistrib, LogProbabilityDensityFunction spatialClutterDistrib, LogProbabilityDensityFunction spatialNewbornDistrib, LogProbabilityMassFunction mu, LogProbabilityMassFunction nu, double P_D, int M_max, int maxNumNeighbors, double maxDistNeighbors)
          Constructor where the maximum number of observations in the time series is specified to avoid some re-computations.
 
Method Summary
private  double compute_pczAhead(MTBTreeNode pcTree, java.util.Vector<java.lang.Integer> availableTargets, java.util.Stack<java.lang.Integer> observations)
          Compute probability of all possible associations of neighboring observations including their likelihood
private  MTBTreeNode compute_qAhead(int m, int mmax, int kmin, int bmin, double logPc_previous, MTBTreeNode subtree)
          Compute tree of data association prior probabilities depending on previous associations.
 DataAssociation drawSample()
          Generate a new sample from this density.
 DataAssociation drawSampleDebug(DataAssociation groundtruth, java.io.OutputStream ostream)
           
protected  AssociationDistributionNN.ObsDistance[][] kNearestObservations(int maxNumNeighbors, double maxDistNeighbors)
          Get the (k) nearest observations for each observation in this.Z, i.e. for each observation z_m all following observations z_{m:M} are sorted by Euklidean distance and stored in an array.
 void setNewObservations(AbstractMultiState<S> Z, AbstractMultiObservationDistributionIndep<S,T> observationDistrib)
           
 
Methods inherited from class de.unihalle.informatik.MiToBo.tracking.multitarget.distributions.impl.AssociationDistribution
letNewbornTargetIDsStartFrom, log_p, p, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

kNearestObs

protected AssociationDistributionNN.ObsDistance[][] kNearestObs
Stores for each observation the k-nearest observations that will be associated after the corresponding observation.


logFac

protected LogFaculty logFac
An object to compute and store log(n!)


maxDistNeighbors

protected double maxDistNeighbors
Maximum distance of neighboring observations


maxNumNeighbors

protected int maxNumNeighbors
Maximum number of neighboring observations

Constructor Detail

AssociationDistributionNN

public AssociationDistributionNN(java.util.Random rand,
                                 AbstractMultiState<S> Z,
                                 AbstractMultiObservationDistributionIndep<S,T> observationDistrib,
                                 LogProbabilityDensityFunction spatialClutterDistrib,
                                 LogProbabilityDensityFunction spatialNewbornDistrib,
                                 LogProbabilityMassFunction mu,
                                 LogProbabilityMassFunction nu,
                                 double P_D,
                                 int maxNumNeighbors,
                                 double maxDistNeighbors)
Constructor.

Parameters:
rand - random generator for sampling
Z - the current observations
observationDistrib - distribution of the observations model
spatialClutterDistrib - spatial distribution of possible clutter appearance
spatialNewbornDistrib - spatial distribution of possible newborn appearance
mu - distribution of the number of clutter observations
nu - distribution of the number of observations from newborn targets
P_D - probability of target detection
maxNumNeighbors - maximum number of neighboring observations to be considered for each association
maxDistNeighbors - maximum Euklidean distance of neighboring observations to be considered for each association

AssociationDistributionNN

public AssociationDistributionNN(java.util.Random rand,
                                 AbstractMultiState<S> Z,
                                 AbstractMultiObservationDistributionIndep<S,T> observationDistrib,
                                 LogProbabilityDensityFunction spatialClutterDistrib,
                                 LogProbabilityDensityFunction spatialNewbornDistrib,
                                 LogProbabilityMassFunction mu,
                                 LogProbabilityMassFunction nu,
                                 double P_D,
                                 int M_max,
                                 int maxNumNeighbors,
                                 double maxDistNeighbors)
Constructor where the maximum number of observations in the time series is specified to avoid some re-computations.

Parameters:
rand - random generator for sampling
Z - the current observations
observationDistrib - distribution of the observations model
spatialClutterDistrib - spatial distribution of possible clutter appearance
spatialNewbornDistrib - spatial distribution of possible newborn appearance
mu - distribution of the number of clutter observations
nu - distribution of the number of observations from newborn targets
P_D - probability of target detection
maxNumNeighbors - maximum number of neighboring observations to be considered for each association
maxDistNeighbors - maximum Euklidean distance of neighboring observations to be considered for each association
M_max - maximum number of observations in the time series
Method Detail

compute_pczAhead

private double compute_pczAhead(MTBTreeNode pcTree,
                                java.util.Vector<java.lang.Integer> availableTargets,
                                java.util.Stack<java.lang.Integer> observations)
Compute probability of all possible associations of neighboring observations including their likelihood

Parameters:
pcTree -
availableTargets -
observations -
Returns:

compute_qAhead

private MTBTreeNode compute_qAhead(int m,
                                   int mmax,
                                   int kmin,
                                   int bmin,
                                   double logPc_previous,
                                   MTBTreeNode subtree)
Compute tree of data association prior probabilities depending on previous associations.

Parameters:
m -
mmax -
kmin -
bmin -
logPc_previous -
subtree -
Returns:

drawSample

public DataAssociation drawSample()
Description copied from interface: SamplingDistribution
Generate a new sample from this density. This method should create a new object.

Specified by:
drawSample in interface SamplingDistribution<DataAssociation>
Overrides:
drawSample in class AssociationDistribution<S extends TargetID,T extends TargetID>
Returns:
new sample object

drawSampleDebug

public DataAssociation drawSampleDebug(DataAssociation groundtruth,
                                       java.io.OutputStream ostream)
Overrides:
drawSampleDebug in class AssociationDistribution<S extends TargetID,T extends TargetID>

kNearestObservations

protected AssociationDistributionNN.ObsDistance[][] kNearestObservations(int maxNumNeighbors,
                                                                         double maxDistNeighbors)
Get the (k) nearest observations for each observation in this.Z, i.e. for each observation z_m all following observations z_{m:M} are sorted by Euklidean distance and stored in an array. If k is larger 0 only the k-nearest observations are returned, if maxDist is larger 0 only observations in that range are returned. Both parameters may be specified.


setNewObservations

public void setNewObservations(AbstractMultiState<S> Z,
                               AbstractMultiObservationDistributionIndep<S,T> observationDistrib)
Overrides:
setNewObservations in class AssociationDistribution<S extends TargetID,T extends TargetID>