/usr/share/octave/packages/statistics-1.3.0/gamlike.m is in octave-statistics 1.3.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Author: Martijn van Oosterhout <kleptog@svana.org>
## This program is granted to the public domain.
## -*- texinfo -*-
## @deftypefn {Function File} {@var{X} =} gamlike ([@var{A} @var{B}], @var{R})
## Calculates the negative log-likelihood function for the Gamma
## distribution over vector @var{R}, with the given parameters @var{A} and @var{B}.
## @seealso{gampdf, gaminv, gamrnd, gamfit}
## @end deftypefn
function res = gamlike(P,K)
if (nargin != 2)
print_usage;
endif
a=P(1);
b=P(2);
res = -sum( log( gampdf(K, a, b) ) );
endfunction
|