# The vbgf function of TFSA

1. Download, Install and Open R

2. Install the R packages: lattice and TFSA (R>Packages> Install packages from local zip files). This is required only once. If the package is successfully installed, you will get the message “package ‘TFSA’ successfully unpacked and MD5 sums checked”.

3. Load both packages using the library function.

Example: library (lattice); library(TFSA)

**The vbgf function**

This function computes the length at age of a fish species. ‘vbgf’ refers to The von Bertalanffy Growth Function.

The VBGF is given by L(t) = L_{¥ }*[1 – exp(-K*(t-t_{0}))].

**Mandatory arguments (inputs):**

‘k’ – The growth coefficient for the species (K).

‘t0’ – The age of the species at length zero.

‘linfinity’ – The asymptotic length of the fish species (L_{¥ }).

**Usage:**

If k=0.8, linfinity=230 and t0=0, then the length of fish at age 3 can be estimated as follows:

> vbgf(a=3,k=0.8,linfinity=230,t0=0) [1] 209.1349

If the interest is to estimate length for a range of age groups, a vector of ages (e.g. 3,4,5,…10) can be used instead. Try the following code:

> vbgf(a=c(3:10),k=0.8,linfinity=230,t0=0) [1] 209.1349 220.6247 225.7874 228.1072 229.1495 229.6178 229.8283 229.9228

The output is a vector of fish length with respect to ages from 3 to 10. The result can be visualised using the plot function in R.

A line graph can be drawn using an extra argument to the plot function as follows:

plot(ages,fishlength,type="l")

Posted on June 23, 2012, in TFSA. Bookmark the permalink. Leave a comment.

## Leave a comment

## Comments 0