forked from Craigacp/MIToolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWeightedEntropy.h
54 lines (46 loc) · 2.24 KB
/
WeightedEntropy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*******************************************************************************
** WeightedEntropy.h
** Part of the mutual information toolbox
**
** Contains functions to calculate the entropy of a single variable H(X),
** the joint entropy of two variables H(X,Y), and the conditional entropy
** H(X|Y), while using a weight vector to modify the calculation.
**
** Author: Adam Pocock
** Created: 20/6/2011
**
** Copyright 2010/2011 Adam Pocock, The University Of Manchester
** www.cs.manchester.ac.uk
**
** This file is part of MIToolbox, licensed under the 3-clause BSD license.
*******************************************************************************/
#ifndef __WeightedEntropy_H
#define __WeightedEntropy_H
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************************
** calculateWeightedEntropy returns the entropy in log base 2 of dataVector
** H_w(X), weighted by weightVector
**
** length(vectors) == vectorLength otherwise it will segmentation fault
*******************************************************************************/
double calculateWeightedEntropy(double *dataVector, double *weightVector, int vectorLength);
/*******************************************************************************
** calculateWeightedJointEntropy returns the entropy in log base 2 of the joint
** variable of firstVector and secondVector, H_w(XY), weighted by weightVector
**
** length(vectors) == vectorLength otherwise it will segmentation fault
*******************************************************************************/
double calculateWeightedJointEntropy(double *firstVector, double *secondVector, double *weightVector, int vectorLength);
/*******************************************************************************
** calculateWeightedConditionalEntropy returns the entropy in log base 2 of
** dataVector conditioned on conditionVector, H_w(X|Y), weighted by weightVector
**
** length(vectors) == vectorLength otherwise it will segmentation fault
*******************************************************************************/
double calculateWeightedConditionalEntropy(double *dataVector, double *conditionVector, double *weightVector, int vectorLength);
#ifdef __cplusplus
}
#endif
#endif