# vbmultifit: Fit a Multi-Group von Bertalanffy Growth Model In fishmethods: Fishery Science Methods and Models in R

## Description

Fits a von Bertalanffy growth curve to length and age for two or more groups.

## Usage

 ```1 2 3``` ```vbmultifit(len=NULL,age=NULL,group=NULL,fixed=c(1,1,1),error=1, select=1,Linf=c(NULL),K=c(NULL),t0=c(NULL),plot=FALSE, control=list(maxiter=10000,minFactor=1/1024,tol=1e-5)) ```

## Arguments

 `len` the vector of lengths of individual fish. `age` the vector of ages associated with the length vector. `group` the vector of character names specifying group association. The first character in the name must be a letter. `fixed` arguments specifying that Linf, K or t0 should be fitted as a constant between groups or as separate parameters for each group. 1 = single parameter between groups, 2 = separate parameters for each group. The order of fixed is c(Linf,K,t0). `error` the error variance assumption. 1= constant variance for all lijs; 2= constant variance for all mean lengths at age; 3=var of lij varies with age. See methods a-c in Kimura (1980: pp. 766). The required statistics for each type of error are calculated from the individual length-age observations. `select` the selection of starting values of L-infinity, K, and t0. 1=automatic selection, 2=user-specified. If select=1, initial starting values of L-infinity, K, and t0 are calculated from Walford lines (Everhart et al. 1975), and ages represented as decimal values are truncated to the integer before linear regression is applied. If select=2, the user must specify values of L-infinity, K, and t0 for each group. `Linf` if select=2, the starting values for L-infinity of the von Bertalanffy equation, one for each group. `K` if select=2, the starting values for K of the von Bertalanffy equation, one for each group. `t0` if select=2, the starting value for t0 of the von Bertalanffy equation, one for each group. `plot` logical argument specifying whether observed versus predicted and residuals graphs should be plotted. Default is FALSE. `control` see function nls.

## Details

A single von Bertalanffy model is fitted to the length and age data of two or more groups using function nls (nonlinear least squares). Parameters can be estimated for each group or as constants across groups. Individual observations of lengths-at-age are required. If error variance assumptions 2 or 3, mean lengths and required statistics are calculated. The parameters are fitted using a model.matrix where the 1st column is a row of 1s representing the parameter estimate of the reference group (group with lowest alpha-numeric order) and the remaining group columns have 1 if group identifier is the current group and 0 otherwise. See function model.matrix. This is a companion function to function vblrt.

When seperate parameters are estimated for each group, estimates for the the non-reference groups would be the reference-group estimated parameters (e.g., Linf1 or K1 or t01) plus the coefficent estimate for the nth group (e.g., group 2: Linf2 or K2, or t02) based on the alpha-numeric order. If the parameter is assumed constant across groups, then estimates of Linf1 or K1 or t01 is used as the parameter for each group.

## Value

 `results` list element containing summary statistics of nls fit `residuals` list element with the residuals from the model.

## Author(s)

Gary A. Nelson, Massachusetts Division of Marine Fisheries [email protected]

## References

Everhart, W. H., A. W. Eipper, and W. D. Youngs. 1975. Principles of Fishery Science. Cornell University Press.

Kimura, D. K. 1980. Likelihood methods for the von Bertalanffy growth curve. U. S. Fish. Bull. 77(4): 765-776.

`vblrt`

## Examples

 ```1 2 3 4``` ```data(Kimura) vbmultifit(len=Kimura\$length,age=Kimura\$age,group=Kimura\$sex,fixed=c(2,1,1), error=1,select=1,Linf=NULL,K=NULL,t0=NULL,plot=FALSE,control=list(maxiter=10000, minFactor=1/1024,tol=1e-5)) ```

### Example output

```Loading required package: MASS
\$results

Formula: len ~ (Linf1 * F + Linf2 * M) * (1 - exp(-(K1 * F) * (age - (t01 *
F))))

Parameters:
Estimate Std. Error t value Pr(>|t|)
Linf1 59.99538    0.91006  65.924  < 2e-16 ***
Linf2 -2.32310    0.85438  -2.719   0.0132 *
K1     0.32991    0.02422  13.619 1.41e-11 ***
t01    0.03955    0.11934   0.331   0.7438
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 1.708 on 20 degrees of freedom

Number of iterations to convergence: 7
Achieved convergence tolerance: 2.364e-06

\$AIC
[1] 99.4386

\$residuals
[1] -0.8928100 -0.5437182  1.6475571  0.9172439 -1.1871675 -2.1297633
[7] -2.7070267 -1.7936954 -0.1885430  0.9670837  0.4659382  1.9652909
[13]  2.5900401 -0.2619315 -0.5373071  4.2283041  1.0606504  0.1263287
[19] -0.6911644 -1.5456702 -1.5928371 -0.1849036  0.7114823 -0.3875477
attr(,"label")
[1] "Residuals"
```

fishmethods documentation built on Nov. 17, 2017, 7:43 a.m.