SUBROUTINE DERUTI ( D, PAR, XX, DXX1, EV, SEV, EVL, EEV, UTIL, DERUTIL, NDV, NIV, NOPT, NPAR, NPAREXT, NUML, NUME, NEST )

Argument Definitions (+ indicates altered content)
DOUBLE PRECISION   D(*),      +DERUTIL(10,120),        DXX1(10,80)
DOUBLE PRECISION   EEV(*),     EV(*),      EVL(*),     PAR(*)
DOUBLE PRECISION   SEV,        UTIL(*),    XX(10,80)
INTEGER            NDV,        NEST,       NIV,        NOPT
INTEGER            NPAR,       NPAREXT,    NUME(*),    NUML(*)
Description
Compute the derivatives of the utility function UTIL(i) with respect t 
the estimated parameters BETA, STETA, GTETA, PHI and PMU, and LAMBDA. 
USAGE: 
  This routine is called before computing the derivatives of the proba 
  function P(i) with respect to the estimated parameters, for predicti 
INPUT: 
  d     dependent variable (vector of ndv elements): 
        If d(i) = 1 , the individual has chosen the available alternat 
        If d(i) = 0 , he has not chosen the available alternative i; 
        If d(i) = -1, the alternative i is not available for the indiv 
  par   estimated parameters in the log-likelihood function (vector of 
        elements). 
  xx    (ndv x niv) matrix containing an observation on "niv" independ 
        variables (with and without Box-Cox) specified in "ndv" altern 
        for estimation or prediction. 
  dxx1  (ndv x niv) matrix containing the first derivatives of the mat 
        with respect to the estimated Box-Cox parameters LAMBDA. 
  ev    exponential of the representative utility component V (vector 
        elements): exp(V(i)). 
  sev   sum of the exp(V(i))'s for STANDARD DOGIT only. 
  evl   phi*ev + 1 for LIN-IPT-LOGIT, or ev + pmu for BT-IPT-LOGIT 
        (vector of ndv elements) 
  eev   exp(exp(V)) if phi = 0, or evl**(1/phi) if phi > 0 for LIN-IPT 
        (vector of ndv elements) 
  util  utility function corresponding to the numerator of the probabi 
        function P (vector of ndv elements) 
  ndv   number of alternatives considered in the estimation. 
  niv   number of beta-coefficients in the estimation. 
  nopt  = 1 : LOGIT 
        = 2 : STANDARD DOGIT 
        = 3 : GENERALIZED DOGIT 
        = 4 : LIN-IPT-LOGIT 
        = 5 : BT-IPT-LOGIT. 
  npar  total number of estimated parameters, namely the estimated BET 
        coefficients, the estimated extra parameters (STETA or GTETA o 
        PHI and PMU) and the estimated Box-Cox parameters LAMBDA. 
nparext total number of estimated parameters including the estimated B 
        coefficients and the estimated extra parameters only. 
  numl  vector of "niv" elements, containing the index numbers of the 
        parameters (fixed or estimated) associated with the "niv" inde 
        variables. If numl(k) = 0, then no Box-Cox transformation is a 
        to the k-th variable. 
  nume  vector of "nest" elements, containing the index numbers of the 
        mated Box-Cox parameters only. 
  nest  number of distinctly estimated Box-Cox parameters. 
OUTPUT: 
derutil (ndv x npar) matrix of first derivatives of the utility functi 
        UTIL(i), i=1,ndv, with respect to the estimated BETA, STETA, G 
        PHI, PMU and LAMBDA.
Source file:deruti.f
Intrinsic Functions Called
DOUBLE PRECISION   DABS,       DLOG
Local Variables (+ indicates altered content)
DOUBLE PRECISION  +EVLPHI,    +FACTDER(10)
INTEGER           +I,         +J,         +K,         +L
INTEGER           +M
Referenced Common Block Variables (+ indicates altered content)
EXPAR              INTEGER            NMU,       NPHI
EXPAR              INTEGER            NTETA,     NUMGT(10,10)
EXPAR              INTEGER            NUMMU(10)
EXPAR              INTEGER            NUMPHI(10)
EXPAR              INTEGER            NUMST(10)
MINMAX             DOUBLE PRECISION   PHIZERO
VALEXPAR           DOUBLE PRECISION   GTETA(10,10)
VALEXPAR           DOUBLE PRECISION   PHI(10),   STETA(10)