utilities
Class InfoCost
java.lang.Object
|
+--utilities.InfoCost
- public class InfoCost
- extends java.lang.Object
methods for calculating the information content of an array
Method Summary |
static double |
l1norm(double[] u,
int least,
int fin)
l1norm()
Absolute summation information cost function. |
static double |
logl2(double[] u,
int least,
int fin)
logl2()
Gauss-Markov information cost function. |
static double |
lpnormp(double[] u,
int least,
int fin,
double p)
lpnormp()
p-th power summation information cost function. |
static double |
ml2logl2(double[] u,
int least,
int fin)
ml2logl2()
``Entropy'' information cost function. |
static double |
tdim(double[] u,
int least,
int fin)
tdim()
Theoretical dimension of a sequence
Calling sequence and basic algorithm:
tdim( U, LEAST, FINAL ):
Let MU2LOGU2 = 0
Let ENERGY = 0
For K = LEAST to FINAL
Let USQ = U[K] * U[K]
If USQ > 0 then
MU2LOGU2 -= USQ * log( USQ )
ENERGY += USQ
If ENERGY > 0 then
Let THEODIM = ENERGY * exp( MU2LOGU2 / ENERGY )
Else
Let THEODIM = 1
Return THEODIM
Inputs:
(double []) u This must point to a preallocated array. |
static int |
thresh(double[] u,
int least,
int fin,
double epsilon)
thresh()
Threshold information cost function. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InfoCost
public InfoCost()
thresh
public static int thresh(double[] u,
int least,
int fin,
double epsilon)
- thresh()
Threshold information cost function.
Calling sequence and basic algorithm:
thresh( U, LEAST, FINAL, EPSILON ):
Let COST = 0
For K = LEAST to FINAL
If absval(U[K]) > EPSILON then
COST += 1
Return COST
Inputs:
double []u This must point to a preallocated array.
(int)least These are the least and final valid
(int)final indices in `u[]'.
(double)epsilon This is a positive, absolute threshold.
Output:
(double)thresh The return value is the number of elements
of `u[]' whose absolute values are
greater than `epsilon'.
Assumptions:
1. epsilon>=0
l1norm
public static double l1norm(double[] u,
int least,
int fin)
- l1norm()
Absolute summation information cost function.
Calling sequence and basic algorithm:
l1norm( U, LEAST, FINAL ):
Let COST = 0
For K = LEAST to FINAL
COST += absval( U[K] )
Return COST
Inputs:
(const double *)u This must point to a preallocated array.
(int)least These are the least and final valid
(int)final indices in `u[]'.
Output:
(double)l1norm The return value is the sum of the absolute
values of the elements of `u[]'.
lpnormp
public static double lpnormp(double[] u,
int least,
int fin,
double p)
- lpnormp()
p-th power summation information cost function.
Calling sequence and basic algorithm:
lpnormp( U, LEAST, FINAL, P ):
Let COST = 0
For K = LEAST to FINAL
Let ABSU = absval( U[K] )
If ABSU > 0 then
COST += exp( P*log( ABSU ) )
Return COST
Inputs:
(const double) u This must point to a preallocated array.
(int)least These are the least and final valid
(int)fin indices in `u[]'.
(double)p Use this power in the summation.
Output:
(double)lpnormp The return value is the sum of the `p'-th
power of the absolute values of the
elements of `u[]'.
ml2logl2
public static double ml2logl2(double[] u,
int least,
int fin)
- ml2logl2()
``Entropy'' information cost function.
Calling sequence and basic algorithm:
ml2logl2( U, LEAST, FINAL ):
Let COST = 0
For K = LEAST to FINAL
Let USQ = U[K] * U[K]
If USQ > 0 then
COST -= USQ * log( USQ )
Return COST
Inputs:
(double [])u This must point to a preallocated array.
(int)least These are the least and final valid
(int)final indices in `u[]'.
Output:
(double)ml2logl2 The return value is the sum of `u*u*log(u*u)'
for all nonzero values of `u*u'.
logl2
public static double logl2(double[] u,
int least,
int fin)
- logl2()
Gauss-Markov information cost function.
Calling sequence and basic algorithm:
logl2( U, LEAST, FINAL ):
Let COST = 0
For K = LEAST to FINAL
COST += log( U[K]*U[K] )
Return COST
Inputs:
( double [])u This must point to a preallocated array.
(int)least These are the least and final valid
(int)final indices in `u[]'.
Output:
(double)logl2 The return value is the sum of `log(u*u)'
for all values of `u*u'.
tdim
public static double tdim(double[] u,
int least,
int fin)
- tdim()
Theoretical dimension of a sequence
Calling sequence and basic algorithm:
tdim( U, LEAST, FINAL ):
Let MU2LOGU2 = 0
Let ENERGY = 0
For K = LEAST to FINAL
Let USQ = U[K] * U[K]
If USQ > 0 then
MU2LOGU2 -= USQ * log( USQ )
ENERGY += USQ
If ENERGY > 0 then
Let THEODIM = ENERGY * exp( MU2LOGU2 / ENERGY )
Else
Let THEODIM = 1
Return THEODIM
Inputs:
(double []) u This must point to a preallocated array.
(int)least These are the least and final valid
(int)final indices in `u[]'.
Output:
(double)tdim The return value is exp of th sum of
`u*u*log(u*u)' for all nonzero values
of `u*u'.