cc.mallet.util
Class VectorStats

java.lang.Object
  extended by cc.mallet.util.VectorStats

public class VectorStats
extends java.lang.Object


Constructor Summary
VectorStats()
           
 
Method Summary
static SparseVector mean(InstanceList instances)
          Returns a SparseVector whose entries (taken from the union of those in the instances) are the expected values of those in the InstanceList.
static SparseVector mean(InstanceList instances, int numIndices)
          Returns a SparseVector whose entries (dense with the given number of indices) are the expected values of those in the InstanceList.
static SparseVector mean(InstanceList instances, int[] indices)
          Returns a SparseVector whose entries (the given indices) are the expected values of those in the InstanceList.
static SparseVector stddev(InstanceList instances)
          Square root of unbiased variance.
static SparseVector stddev(InstanceList instances, boolean unbiased)
          Square root of variance.
static SparseVector stddev(InstanceList instances, SparseVector mean)
          Square root of unbiased variance of instances having the given mean
static SparseVector stddev(InstanceList instances, SparseVector mean, boolean unbiased)
          Square root of variance.
static SparseVector variance(InstanceList instances)
          Returns unbiased variance
static SparseVector variance(InstanceList instances, boolean unbiased)
          Returns a SparseVector whose entries (taken from the union of those in the instances) are the variance of those in the InstanceList.
static SparseVector variance(InstanceList instances, SparseVector mean)
          Returns unbiased variance of instances having the given mean.
static SparseVector variance(InstanceList instances, SparseVector mean, boolean unbiased)
          Returns a SparseVector whose entries (taken from the mean argument) are the variance of those in the InstanceList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorStats

public VectorStats()
Method Detail

mean

public static SparseVector mean(InstanceList instances)
Returns a SparseVector whose entries (taken from the union of those in the instances) are the expected values of those in the InstanceList. This implies the returned vector will not have binary values.


mean

public static SparseVector mean(InstanceList instances,
                                int numIndices)
Returns a SparseVector whose entries (dense with the given number of indices) are the expected values of those in the InstanceList. This implies the returned vector will not have binary values.


mean

public static SparseVector mean(InstanceList instances,
                                int[] indices)
Returns a SparseVector whose entries (the given indices) are the expected values of those in the InstanceList. This implies the returned vector will not have binary values.


variance

public static SparseVector variance(InstanceList instances,
                                    boolean unbiased)
Returns a SparseVector whose entries (taken from the union of those in the instances) are the variance of those in the InstanceList. This implies the returned vector will not have binary values.

Parameters:
unbiased - Normalizes by N-1 when true, and by N otherwise.

variance

public static SparseVector variance(InstanceList instances,
                                    SparseVector mean,
                                    boolean unbiased)
Returns a SparseVector whose entries (taken from the mean argument) are the variance of those in the InstanceList. This implies the returned vector will not have binary values.

Parameters:
unbiased - Normalizes by N-1 when true, and by N otherwise.

variance

public static SparseVector variance(InstanceList instances)
Returns unbiased variance


variance

public static SparseVector variance(InstanceList instances,
                                    SparseVector mean)
Returns unbiased variance of instances having the given mean.


stddev

public static SparseVector stddev(InstanceList instances,
                                  SparseVector mean,
                                  boolean unbiased)
Square root of variance.

Parameters:
mean - Mean of the given instances.
unbiased - Normalizes variance by N-1 when true, and by N otherwise.
See Also:
variance

stddev

public static SparseVector stddev(InstanceList instances)
Square root of unbiased variance.


stddev

public static SparseVector stddev(InstanceList instances,
                                  boolean unbiased)
Square root of variance.

Parameters:
unbiased - Normalizes variance by N-1 when true, and by N otherwise.
See Also:
variance

stddev

public static SparseVector stddev(InstanceList instances,
                                  SparseVector mean)
Square root of unbiased variance of instances having the given mean