TABLE OF CONTENTS
CcurveUpdate/EvalCurveAtOnePoint [ Functions ]
NAME
EvalCurveAtOnePoint --- evaluate a CCurve at a single point
FUNCTION
Given a point x, compute the value of the curve at that point, even if it is not included in the curve's set of observations.
SYNOPSIS
1482 double EvalCurveAtOnePoint(curveP theCurve, double x)
INPUTS
theCurve CCurve to be evaluated x double, point at which to evaluate it.
OUTPUTS
y CCurve evaluated at x
SOURCE
1486 { 1487 // this would actually work on frailties, I think, but it never gets called 1488 // for frailties, so I just put this in as a safeguard. 1489 if(theCurve->isHazard) Rprintf("Error: using EvalCurveAtOnePoint on hazard"); 1490 // evaluate spline component 1491 double splY=EvalSplineAtOnePoint(theCurve,x); 1492 // evaluate parametric component 1493 double parY=EvalParamAtOnePoint(theCurve,x,0); 1494 // weight the two components 1495 if(theCurve->hasPar & theCurve->hasSpline) 1496 return theCurve->Weight[0] * splY + (1-theCurve->Weight[0])*parY; 1497 else if(theCurve->hasPar) 1498 return parY; 1499 else if(theCurve->hasSpline) 1500 return splY; 1501 else return 0; 1502 }