TABLE OF CONTENTS


curveUpdate/weightcurve [ Functions ]

NAME

    weightcurve --- re-weight the spline and parametric components of a curve

FUNCTION

Re-evaluate a curve if the relative weight of the spline and parametric component has changed, or if either of the component values has changed. Can evaluate either the entire curve or only a single index.

SYNOPSIS

2141 weightcurve <- function(curve, i = 0)

INPUTS

    curve      an RCurve structure
    i          the index at which to evaluate (0=all)

OUTPUTS

    curve      the input curve, with curve$y and curve$ycum updated

SOURCE

2144 {
2145     if(i == 0) ind <- 1:length(curve$x) else ind <- i
2146     # reweigh curve$y
2147     curve$y[ind] <- curve$weight * curve$spline.y[ind] + (1 - curve$weight) *
2148         curve$param.y[ind]
2149     # for the hazard, reweigh curve$ycum
2150     if(curve$name == "hazard")
2151         curve$ycum[ind] <- curve$weight * curve$spline.ycum[ind] + (1 - curve$weight) *
2152             curve$param.ycum[ind]
2153     return(curve)
2154 }