a set of C++ library classes
for neural networks development



class MIError2

Class for evaluating the correlation between two random variables representing errors
Random variables are discretized dividing their range values in bins.

Inheritance:


Public Methods

[more] MIError2 (unsigned num_data, unsigned num_bins, float** thedata, float* binlimits = 0, float min_v = 0.0, float max_v = 1.0)
Constructor.
[more] MIError2 (unsigned num_data, unsigned num_bins, char* f, unsigned first, unsigned second, float* binlimits = 0, float min_v = MIN_VALUE, float max_v = MAX_VALUE)
Constructor.
[more] ~MIError2 ()
Destroyer
[more]float Calc_MICorrect2 (void)
It calculates the component of mutual information generated by no errors or not correlated errors.
[more]float Calc_MIErr2 (void)
It calculates the component of mutual information generated by correlated errors.
[more]void Print_MICorrect2 (void)
Print to stdout the mutual information MICorrect2.
[more]void Print_MIErr2 (void)
Print to stdout the mutual information MIErr2.
[more]float Calc_MICorrect (void)
It calculates the component of mutual information generated by no errors
Considering the matrix of the element of the mutual information between the discretized variables var1 and var2, is computed the mutual info corresponding to the first element of the matrix.
[more]float Calc_MIErr (void)
It calculates the component of mutual information generated by errors.
[more]void Print_MICorrect (void)
Print to stdout the mutual information MICorrect.
[more]void Print_MIErr (void)
Print to stdout the mutual information MIErr.

Protected Fields

[more]float MIErr2
Mutual information error not considering two or more errors
[more]float MICorrect2
Mutual information generated by correct guess or by a single error
[more]float MIErr
Mutual information error
[more]float MICorrect
Mutual information generated by correct guess
[more]float* bin
array of the values of the limits of the bins.

Protected Methods

[more]void buildbin (float* binlimits = 0)
It builds the values of the limits of the bins.
[more]virtual unsigned assignbin (unsigned num_var, unsigned num_data)
Calculate the bin of random variable num_var od the data[num_data][num_var].


Inherited from MutualInfo2:

Public Methods

ovoid printdata(void)
ofloat Read_min()
ofloat Read_max()
ovoid Print_min()
ovoid Print_max()
ovoid Calc_p(void)
ovoid Calc_Pjoint(void)
ovoid Print_p(void)
ovoid Print_Pjoint(void)
ofloat* Calc_Entropy(void)
ofloat* Read_Entropy(void)
ovoid Print_Entropy(void)
ofloat Calc_JointEntropy(void)
ofloat Read_JointEntropy(void)
ovoid Print_JointEntropy(void)
ofloat Calc_Minfo(void)
ofloat Read_Minfo(void)
ovoid Print_Minfo(void)

Protected Fields

ostatic const float MIN_VALUE
ostatic const float MAX_VALUE
ofloat min
ofloat max
ounsigned ndata
ounsigned nbins
ofloat ampl
ofloat** data
ofloat** p
ofloat** Pjoint
ofloat H[2]
ofloat Hjoint
ofloat Minfo

Protected Methods

ovoid builddata(unsigned num_data)
oint readdata(unsigned num_data, char* f, unsigned first, unsigned second)
ovoid buildp(unsigned num_bins)
ovoid buildPjoint(unsigned num_bins)
ovoid Init_p(float init=0.0)
ovoid Init_Pjoint(float init=0.0)


Documentation

Class for evaluating the correlation between two random variables representing errors
Random variables are discretized dividing their range values in bins. For each bin is computed its frequency, both for each single variable and the joint frequency. Methods can be used to evaluate the entropy of each variable, the joint entropy, the conditional entropy and the mutual information. The bins are not necessarily of the same size. The first bin correspond to correct values, the others to increasing errors. The input data must be errors between the stimated and the "true" values. The Mutual information error is calculated subtracting to the mutual information the mutal information generated by "correct" values or vlues with a single error.
ofloat MIErr2
Mutual information error not considering two or more errors

ofloat MICorrect2
Mutual information generated by correct guess or by a single error

ofloat MIErr
Mutual information error

ofloat MICorrect
Mutual information generated by correct guess

ofloat* bin
array of the values of the limits of the bins.
The first value correspond to the leftmost value=min, the last value correspond to the rightmost=max. The size of the vector must be nbins + 1.

ovoid buildbin(float* binlimits = 0)
It builds the values of the limits of the bins.
The first value correspond to the leftmost value=min, the last value correspond to the rightmost=max. If binlimits == 0 are builts equispaced bins.
Parameters:
binlimits. - Array of the values of the bin limits. The size of the vector must be nbins + 1.
See Also:
bin

ovirtual unsigned assignbin(unsigned num_var, unsigned num_data)
Calculate the bin of random variable num_var od the data[num_data][num_var]. It calculates the index of the random variable num_var where the value data[num_data][num_var] falls. num_var is the row of p and the column of data. It corresponds also to the dimension of Pjoint.
Parameters:
num_var - index of the random variable in the matrix data
num_data - index of random variable value in data
Returns:
index number of the bin of p

o MIError2(unsigned num_data, unsigned num_bins, float** thedata, float* binlimits = 0, float min_v = 0.0, float max_v = 1.0)
Constructor.
Parameters:
num_data - random variable values cardinality
num_bins - number of bins by wich each range of values of the random variables is subdivided
thedata - matrix of data. It must have two columns, each referring to a different random variables. The rows refer to the values of the random variables
binlimits - Array of the limit values of the bins. Its size must be num_bins + 1. If it is not specified the bins are equally spaced between min_v and max_v
min_v - Minimum of the random variable value
max_v - Maximum of the random variable value

o MIError2(unsigned num_data, unsigned num_bins, char* f, unsigned first, unsigned second, float* binlimits = 0, float min_v = MIN_VALUE, float max_v = MAX_VALUE)
Constructor.
Parameters:
num_data - random variable values cardinality
num_bins - number of bins by wich each range of values of the random variables is subdivided
f - file containing the values of random variables. This file must have columns corresponding to different variables separated by at least a blank.
- first the column in the file of the first variable. The columns are numbered from 1 to up.
second - the column in the file of the second variable. It must be greater than first.
binlimits - Array of the limit values of the bins. Its size must be num_bins + 1. If it is not specified the bins are equally spaced between min_v and max_v
min_v - Minimum of the random variable value
max_v - Maximum of the random variable value

o ~MIError2()
Destroyer

ofloat Calc_MICorrect2(void)
It calculates the component of mutual information generated by no errors or not correlated errors.
Considering the matrix of the element of the mutual information between the discretized variables var1 and var2, is computed the mutual info corresponding to the first row and the first column.
Returns:
the component of mutual information generated by no errors or not correlated errors

ofloat Calc_MIErr2(void)
It calculates the component of mutual information generated by correlated errors.
Considering the matrix of the element of the mutual information between the discretized variables var1 and var2, is computed the mutual info corresponding to the overall matrix minus the first row and the first column.
Returns:
the component of mutual information generated by correlated errors.

ovoid Print_MICorrect2(void)
Print to stdout the mutual information MICorrect2.
Print to stdout the mutual information MICorrect2 generated by no errors or not correlated errors

ovoid Print_MIErr2(void)
Print to stdout the mutual information MIErr2.
Print to stdout the mutual information generated by correlated errors.

ofloat Calc_MICorrect(void)
It calculates the component of mutual information generated by no errors
Considering the matrix of the element of the mutual information between the discretized variables var1 and var2, is computed the mutual info corresponding to the first element of the matrix.
Returns:
the component of mutual information generated by no errors.

ofloat Calc_MIErr(void)
It calculates the component of mutual information generated by errors.
Considering the matrix of the element of the mutual information between the discretized variables var1 and var2, is computed the mutual info corresponding to the overall matrix minus the first element
Returns:
the component of mutual information generated by errors.

ovoid Print_MICorrect(void)
Print to stdout the mutual information MICorrect.
Print to stdout the mutual information MICorrect generated by no errors

ovoid Print_MIErr(void)
Print to stdout the mutual information MIErr.
Print to stdout the mutual information generated by errors.


This class has no child classes.
See Also:
MutualMatrix
Outerr

Alphabetic index HTML hierarchy of classes or Java


Last Updated February 2001
For comments and suggestions mail to Giorgio Valentini