p.QFASA: Returns QFASA diet estimates corresponding to a sample of...

Description Usage Arguments Value References Examples

View source: R/qfasa.R

Description

Computes the diet estimate for each predator in predator.mat using either the Kullback-Leibler Distance (KL), the Aitchison Distance (AIT) or the Chi-Square Distance (CS).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
p.QFASA(
  predator.mat,
  prey.mat,
  cal.mat,
  dist.meas,
  gamma = 1,
  FC = rep(1, nrow(prey.mat)),
  start.val = rep(0.99999, nrow(prey.mat)),
  ext.fa
)

Arguments

predator.mat

matrix containing the FA signatures of the predators.

prey.mat

matrix containing a representative FA signature from each prey group (usually the mean). The first column must index the prey group.

cal.mat

matrix of calibration factors where the i th column is to be used with the i th predator. If modelling is to be done without calibration coefficients, simply pass a vector or matrix of ones.

dist.meas

distance measure to use for estimation: 1=KL, 2=AIT or 3=CS

gamma

parameter required for calculations using CS distance (passed to CS.obj). Currently being set to 1.

FC

vector of fat content of length equal to the number of prey groups or species.

start.val

initial vector of parameters to be optimized

ext.fa

subset of fatty acids to be used to obtain QFASA diet estimates.

Value

A list with components:

Diet Estimates

A matrix of the diet estimates for each predator where each row corresponds to a predator and the columns to prey species. The estimates are expressed as proportions summing to one.

Additional Measures

For each predator for which a diet estimate was obtained:

ModFAS

the value of the modelled fatty acid. These are expressed as proportions summing to one.

DistCont

The contribution of each fatty acid to the final minimized distance.

PropDistCont

The contribution of each fatty acid to the final minimized distance as a proportion of the total.

MinDist

The final minimized distance.

References

Iverson, Sara J., Field, Chris, Bowen, W. Don and Blanchard, Wade (2004) Quantitative Fatty Acid Signature Analysis: A New Method of Estimating Predator Diets. Ecological Monographs, 74(2), 211-235

Examples

 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 ## Fatty Acids
 data(FAset)
 fa.set = as.vector(unlist(FAset))

 ## Predators
 data(predatorFAs)
 tombstone.info = predatorFAs[,1:4]
 predator.matrix = predatorFAs[,5:(ncol(predatorFAs))]
 npredators = nrow(predator.matrix)

 ## Prey
 data(preyFAs)
 prey.sub=(preyFAs[,4:(ncol(preyFAs))])[fa.set]
 prey.sub=prey.sub/apply(prey.sub,1,sum)
 group=as.vector(preyFAs$Species)
 prey.matrix=cbind(group,prey.sub)
 prey.matrix=MEANmeth(prey.matrix)

 ## Fat Content

 FC = preyFAs[,c(2,3)]
 FC = as.vector(tapply(FC$lipid,FC$Species,mean,na.rm=TRUE))

 ## Calibration Coefficients
 data(CC)
 cal.vec = CC[,2]
 cal.mat = replicate(npredators, cal.vec)

 ## Run QFASA
 Q = p.QFASA(predator.matrix,
             prey.matrix,
             cal.mat,
             dist.meas = 1,
             gamma=1,
             FC,
             start.val = rep(1,nrow(prey.matrix)),
             fa.set)

## Diet Estimates
DietEst = Q$'Diet Estimates'

QFASA documentation built on July 21, 2021, 1:06 a.m.