scsurv2
Contents
Syntax
[q, info] = scsurv2(func, p, t, y, N)
Description
Finds maximum likelihood estimates from survivor data like scsurv using the method of scores, but for an additional independent variable, rather than time only. So this routine fits a surface, no a curve.
Input
- func: string with name of user-defined function
f = func (p, t, y) with p: np-vector; t: nt-vector; y: ny-vector f: (nt,ny)-matrix with model-predictions for surviving numbers
- p: (np,2) matrix with
p(:,1) initial guesses for parameter values p(:,2) binaries with yes or no iteration (optional)
- t: (nt,1)-vector with first independent variable (time)
- y: (ny,1)-vector with second independent variable
- N: (nt,ny)-matrix with surviving numbers
Output
- q: matrix like p, but with maximum likelihood estimates
- info: 1 if convergence has been successful; 0 otherwise
Remarks
Calls scdsurv2, and user-defined function 'func'. Set options with scsurv_options.
The iteration is terminated if the norm, i.e. the sum of squared derivetives of the deviance with respect to the iterated parameters, is less than the maximum norm or if the number of iterations exceeds a maximum values (see scsurv_options).
Example of use
Assuming that 'tvalues', 'yvalues', 'numbers', function 'function_name' and initial paramer estimates 'ipars' are properly defined: pars = scsurv2('function_name', ipars, tvalues, yvalues, numbers). See sample file 'mydata_surv2.m' for an example of specification. If progression seems hopeful, but the number of iterations not large enough, you can continue with pars = scsurv2('function_name', pars, tvalues, yvalues, numbers). Alternatively you can increase the maximum number of iterations with scsurv_options.