ff_deriv {flexFitR}R Documentation

Function for derivatives

Description

Function for derivatives

Usage

ff_deriv(params, x_new, curve, fixed_params = NA, which = "fd")

Arguments

params

A vector of parameter values.

x_new

A vector of x values to evaluate the derivative.

curve

A string. The name of the function used for curve fitting.

fixed_params

A vector of fixed parameter values. NA by default.

which

Can be "fd" for first-derivative or "sd" for second-derivative.

Value

First or second derivative.

Examples

library(flexFitR)
data(dt_potato)
mod_1 <- dt_potato |>
  modeler(
    x = DAP,
    y = Canopy,
    grp = Plot,
    fn = "fn_lin_plat",
    parameters = c(t1 = 45, t2 = 80, k = 0.9),
    subset = c(15, 2, 45)
  )
print(mod_1)
# First Derivative
predict(mod_1, x = 45, type = "fd", id = 2)

[Package flexFitR version 1.2.0 Index]