de.unihalle.informatik.MiToBo.tracking.multitarget.distributions.impl
Class AssociationDistribution<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>
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>
Direct Known Subclasses:
AssociationDistributionNN

public class AssociationDistribution<S extends TargetID,T extends TargetID>
extends AbstractAssociationDistribution<S,T>
implements EvaluatableDistribution<DataAssociation>, LogEvaluatableDistribution<DataAssociation>

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. Note that the likelihood of observations that are not yet associated is not considered here!!

Author:
Oliver Gress

Field Summary
protected  double[][] chi
           
protected  int lastM
          Number of observations in last call of drawSample()
protected  int lastN
          Number of targets in last call of drawSample()
protected  DataAssociation lastSample
          Last sample that was sampled
protected  double[] logBinom
          Binomial distribution of number of observations associated to existing targets
protected  double[] logMuValues
          (log) values of mu to avoid recomputation
protected  double[] logNuValues
          (log) values of nu to avoid recomputation
protected  double logP_C
          (log) probability of the current set of association variables given observations and previous associations
protected  double logP_MN
          (log) propability of M observations given N existing targets and the current model configuration
protected  int M_max
          Maximum number of observations in the time series
protected  int minMN
          Minimum of number of observations and number of targets
protected  LogProbabilityMassFunction mu
          Distribution of the number of clutter observations
protected  int newtargetID
          Target-ID to start from for newborn targets
protected  LogProbabilityMassFunction nu
          Distribution of the number of observations from newborn targets
protected  double P_D
          Probability of target detection
protected  double[] phi_0
           
protected  double[] phi_1
           
protected  double[] 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
AssociationDistribution(java.util.Random rand, AbstractMultiState<S> Z, AbstractMultiObservationDistributionIndep<S,T> observationDistrib, LogProbabilityDensityFunction spatialClutterDistrib, LogProbabilityDensityFunction spatialNewbornDistrib, LogProbabilityMassFunction mu, LogProbabilityMassFunction nu, double P_D)
          Constructor.
AssociationDistribution(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)
          Constructor where the maximum number of observations in the time series is specified to avoid some re-computations.
 
Method Summary
 DataAssociation drawSample()
          Generate a new sample from this density.
 DataAssociation drawSampleDebug(DataAssociation groundtruth, java.io.OutputStream ostream)
           
 void letNewbornTargetIDsStartFrom(int minNewTargetID)
          Specify the starting target-ID for newborn targets
 double log_p(DataAssociation x)
          This method is here only valid for the latest DataAssociation sampled with drawSample().
 double p(DataAssociation x)
          This method is here only valid for the latest DataAssociation sampled with drawSample().
protected  void reset()
           
 void setNewObservations(AbstractMultiState<S> Z, AbstractMultiObservationDistributionIndep<S,T> observationDistrib)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chi

protected double[][] chi

lastM

protected int lastM
Number of observations in last call of drawSample()


lastN

protected int lastN
Number of targets in last call of drawSample()


lastSample

protected DataAssociation lastSample
Last sample that was sampled


logBinom

protected double[] logBinom
Binomial distribution of number of observations associated to existing targets


logMuValues

protected double[] logMuValues
(log) values of mu to avoid recomputation


logNuValues

protected double[] logNuValues
(log) values of nu to avoid recomputation


logP_C

protected double logP_C
(log) probability of the current set of association variables given observations and previous associations


logP_MN

protected double logP_MN
(log) propability of M observations given N existing targets and the current model configuration


M_max

protected int M_max
Maximum number of observations in the time series


minMN

protected int minMN
Minimum of number of observations and number of targets


mu

protected LogProbabilityMassFunction mu
Distribution of the number of clutter observations


newtargetID

protected int newtargetID
Target-ID to start from for newborn targets


nu

protected LogProbabilityMassFunction nu
Distribution of the number of observations from newborn targets


P_D

protected double P_D
Probability of target detection


phi_0

protected double[] phi_0

phi_1

protected double[] phi_1

psi

protected double[] psi
Constructor Detail

AssociationDistribution

public AssociationDistribution(java.util.Random rand,
                               AbstractMultiState<S> Z,
                               AbstractMultiObservationDistributionIndep<S,T> observationDistrib,
                               LogProbabilityDensityFunction spatialClutterDistrib,
                               LogProbabilityDensityFunction spatialNewbornDistrib,
                               LogProbabilityMassFunction mu,
                               LogProbabilityMassFunction nu,
                               double P_D)
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

AssociationDistribution

public AssociationDistribution(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)
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
M_max - maximum number of observations in the time series
Method Detail

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>
Specified by:
drawSample in class AbstractAssociationDistribution<S extends TargetID,T extends TargetID>
Returns:
new sample object

drawSampleDebug

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

letNewbornTargetIDsStartFrom

public void letNewbornTargetIDsStartFrom(int minNewTargetID)
Specify the starting target-ID for newborn targets


log_p

public double log_p(DataAssociation x)
This method is here only valid for the latest DataAssociation sampled with drawSample(). If no DataAssociation was sampled before or the given DataAssociation x is a different object than the latest sampled DataAssociation or a new observation was set, this method returns Double.NaN !!

Specified by:
log_p in interface LogEvaluatableDistribution<DataAssociation>
Parameters:
x - realization of random variable X
Returns:
value of log(p(X)) at x

p

public double p(DataAssociation x)
This method is here only valid for the latest DataAssociation sampled with drawSample(). If no DataAssociation was sampled before or the given DataAssociation x is a different object than the latest sampled DataAssociation or a new observation was set, this method return -1 !!

Specified by:
p in interface EvaluatableDistribution<DataAssociation>
Parameters:
x - realization of random variable X
Returns:
value of p(X) at x

reset

protected void reset()

setNewObservations

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