kappa4nls: Sigmoidal curve fitting.

Description Usage Arguments Value Methods (by class) Examples

View source: R/kappa4nls.R

Description

A framework for nonlinear least squares fitting of the four-parameter kappa sigmoidal function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
kappa4nls(formula, data = list(), lower, upper, tol, maxiter, ...)

## Default S3 method:
kappa4nls(formula, data = list(), lower = c(0, -5, -5),
  upper = c(10, 1, 1), tol = 1e-15, maxiter = 50000, ...)

## S3 method for class 'kappa4nls'
print(x, ...)

## S3 method for class 'kappa4nls'
summary(object, ...)

## S3 method for class 'summary.kappa4nls'
print(x, ...)

## S3 method for class 'formula'
kappa4nls(formula, data = list(), lower = c(0, -5, -5),
  upper = c(10, 1, 1), tol = 1e-15, maxiter = 50000, ...)

## S3 method for class 'kappa4nls'
predict(object, newdata = NULL, ...)

Arguments

formula

An LHS ~ RHS formula, specifying the linear model to be estimated.

data

A data.frame which contains the variables in formula.

lower

A vector of lower constraints for the parameters to be estimated; defaults to c(0, -5, -5).

upper

A vector of upper constraints for the parameters to be estimated; defaults to c(10, 1, 1).

tol

Error tolerance level; defaults to 1e-15.

maxiter

The maximum number of iterations allowed; defaults to 50000.

...

Arguments to be passed on to the differential evolution function JDEoptim.

x

A kappa4nls object.

object

A kappa4nls object.

newdata

The data on which the estimated model is to be fitted.

Value

A generic S3 object with class kappa4nls.

kappa4nls.default: A list with all components from JDEoptim, as well as:

summary.kappa4nls: A list of class summary.kappa4nls with the following components:

print.summary.kappa4nls: The object passed to the function is returned invisibly.

predict.kappa4nls: A vector of predicted values resulting from the estimated model.

Methods (by class)

Examples

1
2
3
4
5
6
7
8
9
k <- kappa4tc(-4, 0, 1)$par
x <- seq(qkappa4(0, 4, 0.4, -4, k), qkappa4(0.7, 4, 0.4, -4, k), length.out=100)
y <- sapply(x, function(i) pkappa4(i, 4, 0.4, -4, k))
kappa4nls.default(y~x, tol=1e-5)

u <- seq(qkappa4(0.1, 4, 0.4, -4, k), qkappa4(0.8, 4, 0.4, -4, k), length.out=100)
v <- sapply(u, function(i) pkappa4(i, 4, 0.4, -4, k))
nls <- kappa4nls(y~x, tol=1e-5)
predict(nls, newdata=data.frame(y=v, x=u))

alR documentation built on Dec. 7, 2017, 5:03 p.m.