Calculate Derivative of Function Values

Applies numerical differentiation to the values in selected columns of a function value table.

spatial, nonparametric
## S3 method for class 'fv':
deriv(expr, which = "*", ...,
          method=c("spline", "numeric"),
Function values to be differentiated. A function value table (object of class "fv", see fv.object).
Character vector identifying which columns of the table should be differentiated. Either a vector containing names of columns, or one of the wildcard strings "*" or "." explained below.
Extra arguments passed to smooth.spline to control the differentiation algorithm, if method="spline".
Differentiation method. A character string, partially matched to either "spline" or "numeric".
Optional vector of $x$ values where the derivative is allowed to be discontinuous.

This command performs numerical differentiation on the function values in a function value table (object of class "fv"). The differentiation is performed either by smooth.spline or by a naive numerical difference algorithm.

The command deriv is generic. This is the method for objects of class "fv".

Differentiation is applied to every column (or to each of the selected columns) of function values in turn, using the function argument as the $x$ coordinate and the selected column as the $y$ coordinate. The original function values are then replaced by the corresponding derivatives.

The optional argument which specifies which of the columns of function values in x will be differentiated. The default (indicated by the wildcard which="*") is to differentiate all function values, i.e. all columns except the function argument. Alternatively which="." designates the subset of function values that are displayed in the default plot. Alternatively which can be a character vector containing the names of columns of x.

If the argument kinks is given, it should be a numeric vector giving a value or values of $x$ where the function is not differentiable. Differentiation will be performed separately on intervals between the discontinuity points.


  • Another function value table (object of class "fv") of the same format.

See Also

with.fv, fv.object, smooth.spline

  • deriv.fv
   G <- Gest(cells)
   plot(deriv.fv(G, which=".", spar=0.5))
Documentation reproduced from package spatstat, version 1.36-0, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.