TABLE OF CONTENTS


CcurveUpdate/MakeSplineBasis [ Functions ]

NAME

    MakeSplineBasis --- make a the spline basis from scratch

FUNCTION

Function to make the spline basis, analogous to makesplinebasis in R. It can be called when the knots, or X values of the curve have changed. This turned out to be rather inefficient, and was replaced by RemakeSplineBasis, but this function remains in the codebase for debugging.

SYNOPSIS

1117 void MakeSplineBasis(curveP theCurve)

INPUTS

    theCurve      a CCurve structure

OUTPUTS

    theCurve, with SplineBasis, SplineBasisCum, SplineBasisInt and SplineBasisExp updated

SOURCE

1121 {
1122     if(!theCurve->hasSpline) return;
1123     double * knots = theCurve->SplineKnots;
1124     int ord = theCurve->SplineOrd;
1125     int nknots = theCurve->SplineNknots;
1126     int nj = theCurve->nj;
1127     double * x = theCurve->X;
1128     int c1 = 1;
1129 
1130     // compute integrals over each basis spline
1131     cevalBinte(theCurve->SplineBasisInt, knots, &ord, &nknots);
1132 
1133     // For frailty, compute the expectations
1134     if(!theCurve->isHazard) 
1135         cevalEinte(theCurve->SplineBasisExp, knots, &ord, &nknots, &c1);
1136     
1137     // Make basis
1138     UpdateSplineBasis(theCurve,-1,0,nj); 
1139     
1140 }