Learn R Programming

EvidenceSynthesis (version 1.1.0)

hermiteInterpolation: Cubic Hermite interpolation using both values and gradients to approximate a log likelihood function

Description

Cubic Hermite interpolation using both values and gradients to approximate a log likelihood function

Usage

hermiteInterpolation(x, profile)

Value

The approximate log likelihood for the given x.

Arguments

x

The log(hazard ratio) for which to approximate the log likelihood.

profile

A profile as created with approximateLikelihood() with approximation = "grid with gradients". This is a data frame with 3 columns: point, value, and derivative, sorted by point.

Details

Performs spline interpolation using cubic Hermite polynomials (Catmull et al. 1974) between the points specified in the profile. We use linear extrapolation outside the points.

References

Catmull, Edwin; Rom, Raphael (1974), "A class of local interpolating splines", in Barnhill, R. E.; Riesenfeld, R. F. (eds.), Computer Aided Geometric Design, New York: Academic Press, pp. 317–326

Examples

Run this code
profile <- data.frame(point = c(1.1, 2.1), value = c(1, 1), derivative = c(0.1, -0.1))
hermiteInterpolation(x = 0:3, profile = profile)

Run the code above in your browser using DataLab