TABLE OF CONTENTS
CcurveUpdate/FrailtySplineVar [ Functions ]
NAME
FrailtySplineVar --- compute frailty variance of a spline component
FUNCTION
For the spline component of a frailty density curve, compute the corresponding frailty variance.
SYNOPSIS
664 double FrailtySplineVar(curveP frailty)
INPUTS
frailty a frailty CCurve
OUTPUTS
fvar variance of the frailty density
SOURCE
668 { 669 double fvar=0; 670 double * Moment2 = (double *) malloc( frailty->nj * sizeof(double)); 671 int ord = frailty->SplineOrd; 672 int K = frailty->SplineNknots; 673 int N=2; 674 // vector of second moments of each basis function 675 cevalEinte(Moment2,frailty->SplineKnots,&ord,&K,&N); 676 for(int i=0;i<frailty->nj;i++) Moment2[i] = 1-Moment2[i]; 677 // second moment of the entire density 678 fvar = ddotWrapper(frailty->nj, Moment2, frailty->SplineEPar)/frailty->SplineEParSum; 679 // subtract mean^2 680 fvar = fvar - 1.0; 681 return fvar; 682 }