maximizeInterpolant {edgeR}R Documentation

Maximize a function given a table of values by spline interpolation.

Description

Maximize a function given a table of values by spline interpolation.

Usage

maximizeInterpolant(x, z, maxit=10, eps=1e-7, plot=FALSE)

Arguments

x

numeric vector of the inputs of the function.

z

numeric vector of the values of the function at the inputs given by x.

maxit

numeric scalar giving the maximum number of iterations for the Newton-Raphson algorithm.

eps

numeric scalar giving the convergence tolerance.

plot

logical, whether or not to plot the function on those given points.

Details

maximizeInterpolant calls the function splinefun to fit cubic spline interpolation given a set of points.

maximizeInterpolant uses Newton-Raphson algorithm in finding the maximum of the function performing the interpolation.

Value

maximizeInterpolant returns a single value which maximizes the spline interpolation.

Author(s)

Gordon Smyth

See Also

splinefun

Examples

x <- seq(0,1,length=1000)
y <- rnorm(1000,1,1)
maximizeInterpolant(x,y)

[Package edgeR version 2.4.3 Index]