derivative5pointsStencil {IDSL.IPA}R Documentation

Numerical differentiation by five-point stencil method

Description

This module performs numerical differentiation using the five-point stencil method.

Usage

derivative5pointsStencil(x, y, n)

Arguments

x

a vector of values for x.

y

a vector of values for y.

n

order of numerical differentiation (n=1-4).

Value

A matrix of 2 columns. The first column represents x and the second column represents numerical differentiation values. This matrix has four rows (two rows from the beginning and 2 rows from the end) less than length of x or y.

Examples

data(peak_spline)
rt <- peak_spline[, 1]
int <- peak_spline[, 2]
n <- 2 # second order derivative
derivative5pointsStencil(rt, int, n)

[Package IDSL.IPA version 2.9 Index]