% get_Cmiss( Pmiss, K_max) - get Cmiss cost array
%
% Cmiss(n+1,K) is -log( P(n target events)) used in cost functions

function Cmiss = get_Cmiss( Pmiss, K_max)

Cmiss = zeros(K_max+1,K_max);

for k=1:K_max
  Cmiss(1:k+1,k) = -log( cumprod([1, (1-Pmiss)*ones(1,k)]) .* fliplr(cumprod([1, Pmiss*ones(1,k)])) )';
end
