uk.ac.gla.dcs.renaissance.iqir.qpr
Class Density

java.lang.Object
  extended by uk.ac.gla.dcs.renaissance.iqir.qpr.EigenDecomposition
      extended by uk.ac.gla.dcs.renaissance.iqir.qpr.Density
All Implemented Interfaces:
Serializable

public class Density
extends EigenDecomposition

A probability density

Author:
B. Piwowarski
See Also:
Serialized Form

Field Summary
 
Fields inherited from class uk.ac.gla.dcs.renaissance.iqir.qpr.EigenDecomposition
map, mS, mU
 
Constructor Summary
Density(DensityTracker tracker, boolean deepCopy)
           
Density(bpiwowar.maths.matrix.DoubleMatrix2D u, bpiwowar.maths.matrix.DiagonalDoubleMatrix s, it.unimi.dsi.fastutil.ints.Int2IntSortedMap map)
           
Density(bpiwowar.maths.matrix.DoubleMatrix2D mU, bpiwowar.maths.matrix.DiagonalDoubleMatrix mS, it.unimi.dsi.fastutil.ints.Int2IntSortedMap map, boolean deepCopy)
           
Density(SubspaceTracker tracker)
          Uses a subspace tracker (SVD) to initialise
 
Method Summary
 double computeProbability(bpiwowar.maths.matrix.DoubleMatrix1D vector)
          Compute the probability of a one-dimensional subspace
 double computeProbability(bpiwowar.maths.matrix.DoubleMatrix1D vector, boolean sameMap)
          Compute the probability of a one-dimensional subspace
 double computeProbability(Subspace subspace, boolean fuzzyEvent)
          Compute the probability of an event
 double computeProbability(Subspace subspace, boolean fuzzyEvent, boolean sameMap)
          Compute the probability of an event
 Density copy()
           
 bpiwowar.maths.matrix.DoubleMatrix2D getProbabilityMatrix(bpiwowar.maths.matrix.DoubleMatrix1D vector, boolean sameMap)
          Get the matrix v^T * (U x S) where U is the basis and S is the square root of the eigenvalues.
 bpiwowar.maths.matrix.DoubleMatrix2D getProbabilityMatrix(Subspace subspace, boolean fuzzyEvent, boolean sameMap)
          Pre-computation of a probability.
 
Methods inherited from class uk.ac.gla.dcs.renaissance.iqir.qpr.EigenDecomposition
getGlobalMatrix, getLocalToGobalTermIdMap, getMatrix, getRank, getS, normalise, normalise, normalise, trim
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Density

public Density(bpiwowar.maths.matrix.DoubleMatrix2D u,
               bpiwowar.maths.matrix.DiagonalDoubleMatrix s,
               it.unimi.dsi.fastutil.ints.Int2IntSortedMap map)

Density

public Density(SubspaceTracker tracker)
Uses a subspace tracker (SVD) to initialise

Parameters:
tracker -

Density

public Density(DensityTracker tracker,
               boolean deepCopy)
Parameters:
tracker - The tracker from which to build this density
deepCopy - If true, copy all the matrices (but sigma)

Density

public Density(bpiwowar.maths.matrix.DoubleMatrix2D mU,
               bpiwowar.maths.matrix.DiagonalDoubleMatrix mS,
               it.unimi.dsi.fastutil.ints.Int2IntSortedMap map,
               boolean deepCopy)
Method Detail

computeProbability

public final double computeProbability(Subspace subspace,
                                       boolean fuzzyEvent)
Compute the probability of an event

Parameters:
subspace - The event
fuzzyEvent - The event should be considered as "fuzzy" -- i.e. each dimension is weighted by the corresponding sigma
Returns:

computeProbability

public final double computeProbability(Subspace subspace,
                                       boolean fuzzyEvent,
                                       boolean sameMap)
Compute the probability of an event

Parameters:
subspace - The event
fuzzyEvent - The event should be considered as "fuzzy" -- i.e. each dimension is weighted by the corresponding sigma
sameMap -
Returns:

getProbabilityMatrix

public bpiwowar.maths.matrix.DoubleMatrix2D getProbabilityMatrix(Subspace subspace,
                                                                 boolean fuzzyEvent,
                                                                 boolean sameMap)
Pre-computation of a probability.

Given the subspace representation S U and the density S' U', computes UT U' S' (crisp subspace) or S UT U' S' (fuzzy subspace). The sum of the squares of the matrix correspond to the probability of observing the subspace given the density.

Each row of the resulting matrix correspond to the probability associated with one of the dimension of the subspace. Similarly, each column is associated to a dimension of the density.

Parameters:
subspace -
fuzzyEvent -
sameMap -
Returns:

getProbabilityMatrix

public bpiwowar.maths.matrix.DoubleMatrix2D getProbabilityMatrix(bpiwowar.maths.matrix.DoubleMatrix1D vector,
                                                                 boolean sameMap)
Get the matrix v^T * (U x S) where U is the basis and S is the square root of the eigenvalues. The Froebenius norm of the resulting matrix is the probability of the event defined by v x v^t

Parameters:
vector - The vector v
sameMap -
Returns:

copy

public Density copy()

computeProbability

public double computeProbability(bpiwowar.maths.matrix.DoubleMatrix1D vector,
                                 boolean sameMap)
Compute the probability of a one-dimensional subspace

Parameters:
vector -
Returns:

computeProbability

public double computeProbability(bpiwowar.maths.matrix.DoubleMatrix1D vector)
Compute the probability of a one-dimensional subspace

Parameters:
vector -
Returns:


Copyright © 2011. All Rights Reserved.