dev

Contents

Syntax

d = dev(func, p, varargin)

Description

calculates deviance: two times the difference between the log likelihood function and its maximum
  (which based on the multinomial distribution where the death probabilities correspond with the observed relative frequencies).
The maximum likelihood estimates minimize the deviance.
See dev2 for the surface-equivalent and dev3 for the volume-equivalent.

Input

   f = func (p, tn) with
     p: k-vector with parameters; tn: (n,c)-matrix; f: n-vector
   [f1, f2, ...] = func (p, tn1, tn2, ...) with  p: k-vector  and
    tni: (ni,k)-matrix; fi: ni-vector with model predictions
   The dependent variable in the output f; For tn see below.
   tni(:,1) time: must be increasing with rows
   tni(:,2) number of survivors: must be non-increasing with rows
   tni(:,3, 4, ... ) data-pont specific information data (optional)
   The number of data matrices tn1, tn2, ... is optional but >0

Output * d: scalar with deviance

Remarks

calls user-defined function 'func'

Example of use

Assuming that function_name, pars, and tn1 (and possibly more data matrices) are defined properly: dev('function_name', pars, tn1, tn2, ...).