fncentr2.gms : Test correctness of centropy intrinsic


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 [htmlfntest_x.inc [html]

$title 'Test correctness of centropy intrinsic' (FNCENTR2,SEQ=318)

centropy(p,q,delta) = p * log((p+delta)/(q+delta))

$include fnset_x.inc

$gdxin fncentr2
$load relToInput aeps0 aeps1 aeps2 reps0 reps1 reps2 T data

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