Hassell's typeIII response (not assuming replacement)
1 2 3 4  hassIIInr_fit(data, samp, start, fixed, boot=FALSE, windows=FALSE)
hassIIInr_nll(b, c, h, T, X, Y)
hassIIInr(X, b, c, h, T)

data 
A data frame containing X and Y (at least). 
samp 
A vector specifying the rows of data to use in the fit. Provided by 
start 
A named list. Starting values for items to be optimised. Usually b, c and h. 
fixed 
A names list. 'Fixed data' (not optimised). Usually T. 
boot 
A logical. Is the function being called for use by 
windows 
A logical. Is the operating system Microsoft Windows? 
b,c,h 
Hassel's b and c, plus h, the handling time. Usually items to be optimised. 
T 
T, the total time available. 
X 
The X variable. Usually prey density. 
Y 
The Y variable. Usually the number of prey consumed. 
This implements Hassel's TypeIII extension to the 'random predator' functional response. This does not assume prey are replaced throughout the experiment (c.f. hassIII
). The number of prey eaten (Ne) follow the same relationship defined for the Roger's TypeII response, however the capture rate (a) is assumed to vary with prey density in the following hyperbolic relationship:
a < (b*X)/(1+c*X)
where b
and c
are coefficients to be fitted and X is the initial prey density. This is the initial formulation of Hassell et al. (1977) and uses their naming conventions. The value for a is then used within the Roger's TypeII 'random predator' equation (see rogersII
).
None of these functions are designed to be called directly, though they are all exported so that the user can do so if desired. The intention is that they are called via frair_fit
, which calls them in the order they are specified above.
hassIIInr_fit
does the heavy lifting and also pulls double duty as the statistic
function for bootstrapping (via boot()
in the boot package). The windows
argument if required to prevent needless calls to require(frair)
on platforms that can manage sane parallel processing.
The core fitting is done by mle2
from the bbmle
package and users are directed there for more information. mle2
uses the hassIIInr_nll
function to optimise hassIIInr
.
Further references and recommended reading can be found on the help page for frair_fit.
Daniel Pritchard
Hassell M, Lawton J, Beddington J (1977) Sigmoid functional responses by invertebrate predators and parasitoids. Journal of Animal Ecology 46: 249–262.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25  datx < rep(c(1,2,3,4,6,12,24,50,100), times=10)
daty1 < round(hassIIInr(X=datx,
b=0.08*rnorm(length(datx), mean=1, sd=0.1),
c=0.1*rnorm(length(datx), mean=1, sd=0.1),
h=0.08*rnorm(length(datx), mean=1, sd=0.1),
T=1),0)
daty2 < round(hassIIInr(X=datx,
b=0.05*rnorm(length(datx), mean=1, sd=0.1),
c=0.08*rnorm(length(datx), mean=1, sd=0.1),
h=0.1*rnorm(length(datx), mean=1, sd=0.1),
T=1),0)
dat < data.frame(datx,daty1,daty2)
hassIIInr_1 < frair_fit(daty1~datx, data=dat, response='hassIIInr',
start=list(b=0.05, c=0.1, h=0.1), fixed=list(T=1))
hassIIInr_2 < frair_fit(daty2~datx, data=dat, response='hassIIInr',
start=list(b=0.05, c=0.1, h=0.1), fixed=list(T=1))
plot(c(0,100), c(0,15), type='n', xlab='Density', ylab='No. Eaten')
points(hassIIInr_1)
points(hassIIInr_2, col=4)
lines(hassIIInr_1)
lines(hassIIInr_2, col=4)
frair_compare(hassIIInr_1, hassIIInr_2)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.