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-t0))].

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¥ ).


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.

> ages<-c(1:10)
> fishlength<-vbgf(a=ages,k=0.8,linfinity=230,t0=0)
> plot(ages,fishlength)

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


Hope this was useful. Thanks.


About Deepak George Pazhayamadom

I'm a fish biologist and a mathematical modeller. I have a wide range of research interests, mostly centered on fisheries resource management.

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

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: