Last data update: 2014.03.03

R: Fitting Hossfeld growth function.
wrapHossfeldR Documentation

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.

Author(s)

C. Jessica E. Metcalf, Sean M. McMahon, Roberto Salguero-Gomez, Eelke Jongejans & Cory Merow.

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


# 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")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(IPMpack)
Loading required package: Matrix
Loading required package: MASS
Loading required package: nlme
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/IPMpack/wrapHossfeld.Rd_%03d_medium.png", width=480, height=480)
> ### Name: wrapHossfeld
> ### Title: Fitting Hossfeld growth function.
> ### Aliases: wrapHossfeld
> 
> ### ** Examples
> 
> 
> # 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)
[1] 1146.422
> 
> # Use optim to get best parameters values [not run]
> tmp <- optim(c(1, 1, 1), wrapHossfeld, dataf = dff, method = "Nelder-Mead")
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>