TABLE OF CONTENTS
splineUtils/evalEinte [ Functions ]
NAME
evalEinte --- compute the expected distance from 1 of a B-spline
FUNCTION
Since the frailty density must have mean 1, it is important to be able to compute the difference between 1 and the frailty density mean. This function calculates the expected values of a set of normalized B-spline basis functions and subtracts them from 1. The difference between 1 and the frailty mean is then
curve$spline.basisexp%*%exp(curve$spline.par)
where the former is the output of this function and the latter is the set of spline weights.
SYNOPSIS
1511 evalEinte <- function(knots, ord)
INPUTS
knots a set of spline knots as output by makeknots ord integer spline order
OUTPUTS
a vector containing one minus the expectation of each of the normalized basis functions
SOURCE
1514 { 1515 K <- sum(knots > attr(knots, "b")[1] & knots < attr(knots, "b")[2]) 1516 Einte <- rep(0, K + ord) 1517 for(j in 1:(K + ord)){ 1518 # Einte[j] contains the 1st moment of the j-th spline of order ord defined 1519 # on a given set of knots 1520 Einte[j] <- nBsmom(1, ord, j, knots) 1521 } 1522 return(1 - Einte) 1523 }