Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

parabolaSlopes

Estimate the slope of an interpolating function using a parabola


Description

Returns estimates of the slope of an interpolating function that runs through a set of points in the xy-plane.

Usage

parabolaSlopes(x,y)

Arguments

x,y

coordinates of points defining the interpolating function.

Value

Returns an estimate of the slope of the interpolant at (x,y).

Note

This function is used as part of the Stineman interpolation function stinterp. It is rarely called directly by the user, and checking of x and y must be performed by the calling function.

The parabola method provides a better approximation of the slope for smooth functions than the original method suggested by Stineman (1980), which is provided by the function stinemanSlopes (see the documentation of the function stinterp for further information), but it results in higher slopes near abrupt steps or spikes and can lead to some overshooting where Stineman's method does not.

Author(s)

Norbert Nemec, Institute of Theoretical Physics, University of Regensburg. Translation from Python code by Halldor Bjornsson

See Also

Examples

x <- seq(0,2*pi,by=pi/6)
y <- sin(x)
## Not run: parabolaSlopes(x,y)

stinepack

Stineman, a Consistently Well Behaved Method of Interpolation

v1.4
GPL-2
Authors
Tomas Johannesson & Halldor Bjornsson, Icelandic Met. Office; Gabor Grothendieck
Initial release
2018-07-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.