| Title: | Simplicially Constrained Regression Models for Proportions |
|---|---|
| Description: | Simplicially constrained regression models for proportions in both sides. The constraint is always that the betas are non-negative and sum to 1. References: Iverson S.J.., Field C., Bowen W.D. and Blanchard W. (2004) "Quantitative Fatty Acid Signature Analysis: A New Method of Estimating Predator Diets". Ecological Monographs, 74(2): 211-235. <doi:10.1890/02-4105>. |
| Authors: | Michail Tsagris [aut, cre] |
| Maintainer: | Michail Tsagris <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.2 |
| Built: | 2026-05-15 08:57:12 UTC |
| Source: | https://github.com/cran/scpropreg |
Simplicially Constrained Regression Models for Proportions. The constraint is always that the betas are non-negative and sum to 1.
| Package: | scpropreg |
| Type: | Package |
| Version: | 1.2 |
| Date: | 2026-04-15 |
Michail Tsagris <[email protected]>.
Michail Tsagris [email protected]
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.
Positive and unit sum constrained least squares.
pcls(y, x) mpcls(Y, x)pcls(y, x) mpcls(Y, x)
y |
The response variable. For the pcls() a numerical vector with observations, but for the mpcls() a numerical matrix, where each columns sums to 1. |
Y |
The response variable, a numerical matrix, where each column sums to 1. |
x |
A matrix with independent variables, the design matrix. |
The constraint is that all beta coefficients are positive and sum to 1. That is
such that and .
The pcls() function performs a single regression model, whereas the mpcls() function performs a regression for each column of y.
Each regression is independent of the others.
A list including:
coefficients |
A numerical matrix with the positively constrained beta coefficients. |
value |
A numerical vector with the mean squared error. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
x <- matrix(runif(30 * 8), ncol = 30) x <- t( x / rowSums(x) ) y <- runif(30) y <- y / sum(y) pcls(y, x)x <- matrix(runif(30 * 8), ncol = 30) x <- t( x / rowSums(x) ) y <- runif(30) y <- y / sum(y) pcls(y, x)
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)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
such that and .
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 [email protected].
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.
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)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)
QFASA diet estimates using various distances.
kld(y, x, tol = 1e-8, maxit = 50000, alpha = 0.1) ait(y, x, tol = 1e-8, maxit = 50000, alpha = 0.01) lsq(y, x, tol = 1e-8, maxit = 50000, alpha = 0.01) jsd(y, x, tol = 1e-8, maxit = 300000, alpha = 0.01) lr(y, x, tol = 1e-8, maxit = 100)kld(y, x, tol = 1e-8, maxit = 50000, alpha = 0.1) ait(y, x, tol = 1e-8, maxit = 50000, alpha = 0.01) lsq(y, x, tol = 1e-8, maxit = 50000, alpha = 0.01) jsd(y, x, tol = 1e-8, maxit = 300000, alpha = 0.01) lr(y, x, tol = 1e-8, maxit = 100)
y |
The response variable. The predator's food composition. A vector with values between 0 and 1 that sum to 1. For some functions, zero values are allowed. |
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
such that and .
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 [email protected].
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.
x <- matrix(runif(30 * 8), ncol = 30) x <- t( x / rowSums(x) ) y <- runif(30) y <- y / sum(y) kld(y, x) ait(y, x) lsq(y, x) lr(y, x)x <- matrix(runif(30 * 8), ncol = 30) x <- t( x / rowSums(x) ) y <- runif(30) y <- y / sum(y) kld(y, x) ait(y, x) lsq(y, x) lr(y, x)