Description
centropy(p,q,delta) = p * log((p+delta)/(q+delta))
Small Model of Type : GAMS
Category : GAMS Test library
Main file : fncentr2.gms includes : fnset_x.inc [html] fntest_x.inc [html]
$title 'Test correctness of centropy intrinsic' (FNCENTR2,SEQ=318)
$onText
centropy(p,q,delta) = p * log((p+delta)/(q+delta))
$offText
$include fnset_x.inc
$gdxIn fncentr2
$load relToInput aeps0 aeps1 aeps2 reps0 reps1 reps2 T data
$gdxIn
loop {T,
data(T, 'f') = centropy.value (data(T,'x'), data(T,'c'), data(T,'d'));
data(T, 'fx') = centropy.grad (data(T,'x'), data(T,'c'), data(T,'d'));
data(T,'fxx') = centropy.hess (data(T,'x'), data(T,'c'), data(T,'d'));
data(T, 'rc') = mathlastrc;
data(T, 'ec') = mathlastec;
};
$include fntest_x.inc