| QFASA diet estimates for many predators using various distances | R Documentation |
QFASA diet estimates for many predators using various distances.
mkld(Y, x, tol = 1e-8, maxit = 50000, alpha = 0.1)
mait(Y, x, tol = 1e-8, maxit = 50000, alpha = 0.01)
mlsq(Y, x, tol = 1e-8, maxit = 50000, alpha = 0.01)
mlr(Y, x, tol = 1e-8, maxit = 100)
Y |
The response variable, a matrix with values between 0 and 1 that sum to 1. For some functions, zero values are allowed. Every column corresponds to the food composition of a predator. The column-wise sums are equal to 1. |
x |
A matrix with independent variables, values between 0 and 1. Each column contains a prey's diet. The column-wise sums are equal to 1. |
tol |
The tolerance value to terminate the algorithm. |
maxit |
The maximum iterations allowed. |
alpha |
The step-size parameter of the fixed points iteration algorithm. This is similar to the |
The function estimates the betas that minimize a distance. The fitted values are linear constraints of the observed xs. The constraint is that all beta coefficients are positive and sum to 1. That is
\hat{y}_i= \sum_{j=1}\bm{x}_{ij}\beta_j such that 0\leq \beta_j \leq 1 and \sum_{j=1}^d\beta_j=1.
A list including:
coefficients |
A numerical matrix with the positively constrained beta coefficients. |
value |
A numerical vector with the value of the objective function. |
iters |
The number of iterations required until termination of the algorithm. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
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.
kld, mpcls
x <- matrix(runif(30 * 6), ncol = 30)
x <- t( x / rowSums(x) )
Y <- matrix(runif(30 * 10), ncol = 30)
Y <- t( Y / rowSums(Y) )
mkld(Y, x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.