Learn R Programming

IPMpack (version 2.1)

wrapHossfeld: Fitting Hossfeld growth function.

Description

Function to define deviance of a Hossfeld function for use with optim to generate a Hossfeld growth object.

Usage

wrapHossfeld(par, dataf)

Arguments

par
vector of length three.
dataf
dataframe with columns size and incr.

References

Zuidema, Jongejans, Chien, During & Schieving. Integral projection models for trees: a new parameterization method and a validation of model output. Journal of Ecology 98, p345-355.

See Also

Hossfeld

Examples

Run this code

# Simulate data and create a column for growth increment
dff <- generateData()
dff$incr <- dff$sizeNext - dff$size

# Current sum of squares
wrapHossfeld(c(1, 1, 1), dff)

# Use optim to get best parameters values [not run]
tmp <- optim(c(1, 1, 1), wrapHossfeld, dataf = dff, method = "Nelder-Mead")

Run the code above in your browser using DataLab