ELIFE-ASU / Inform

A cross platform C library for information analysis of dynamical systems

Home Page:https://elife-asu.github.io/Inform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cross Entropy

dglmoore opened this issue · comments

We have already defined mutual information and relative entropy between time series and between distributions. Let's round out the basic measures with cross entropy!

Proposed API

EXPORT double* inform_cross_entropy(const int *p, const int *q, size_t n, size_t m, int b,
    inform_error *err);

Example Usage

int p[10] = {0,1,1,0,1,0,0,1,0,0}; (6,4)
int q[10] = {1,1,1,0,1,1,0,0,0,1}; (4,6)
inform_error err = INFORM_SUCCESS;
inform_cross_entropy(p, q, 1, 10, &err); // 1.087943