# SSlogCurve: Logarithmic curve In OnofriAndreaPG/aomisc: Statistical methods for the agricultural sciences

 logCurve R Documentation

## Logarithmic curve

### Description

These functions provide the logarithmic model (logCurve) with self-starter for the `nls` function and for the `drm` function in the drc package.

### Usage

```  logCurve.fun(predictor, a, b)
NLS.logCurve(predictor, a, b)
NLS.logCurveNI(predictor, b)
DRC.logCurve(fixed = c(NA, NA), names = c("a", "b"), ...)
```

### Arguments

 `a` model parameter `b` model parameter `fixed` numeric vector. Specifies which parameters are fixed and at what value they are fixed. NAs for parameter that are not fixed. `names` a vector of character strings giving the names of the parameters. The default is reasonable.

### Details

The logarithmic curve is given by the following function:

f(x) = a + b \log (X)

This curve crosses the X axis at X = a. We can force it through the origin by setting a = 0; this is possible by setting 'fixed = c(=, NA), while, in the 'nls()' function, we need to use the NLS.logCurveNI()' function.

### Value

logCurve.fun, NLS.logCurve and NLS.logCurveNI return a numeric value, while DRC.logCurve returns a list containing the nonlinear function, the self starter function and the parameter names.

### Note

DRC.logCurve() is for use with the function `drm`.

Andrea Onofri

### References

Ratkowsky, DA (1990) Handbook of nonlinear regression models. New York (USA): Marcel Dekker Inc.

Onofri, A. (2020). A collection of self-starters for nonlinear regression in R. See: https://www.statforbiology.com/2020/stat_nls_usefulfunctions/

### Examples

```X <- c(1,2,4,5,7,12)
Y <- c(1.97, 2.32, 2.67, 2.71, 2.86, 3.09)

# lm fit
model <- lm(Y ~ log(X) )

# nls fit
model <- nls(Y ~ NLS.logCurve(X, a, b) )

# drm fit
model <- drm(Y ~ X, fct = DRC.logCurve() )
```

OnofriAndreaPG/aomisc documentation built on Feb. 2, 2023, 12:13 p.m.