Package 'lactcurves'

Title: Lactation Curve Parameter Estimation
Description: AllCurves() runs multiple lactation curve models and extracts selection criteria for each model. This package summarises the most common lactation curve models from the last century and provides a tool for researchers to quickly decide on which model fits their data best to proceed with their analysis. Start parameters were optimized based on a dataset with 1.7 million Holstein-Friesian cows. If convergence fails, the start parameters need to be manually adjusted. The models included in the package are taken from: (1) Michaelis-Menten: Michaelis, L. and M.L. Menten (1913). <www.plantphys.info/plant_physiology/copyright/MichaelisMentenTranslation2.pdf> (1a) Michaelis-Menten (Rook): Rook, A.J., J. France, and M.S. Dhanoa (1993). <doi:10.1017/S002185960007684X> (1b) Michaelis-Menten + exponential (Rook): Rook, A.J., J. France, and M.S. Dhanoa (1993). <doi:10.1017/S002185960007684X> (2) Brody (1923): Brody, S., A.C. Ragsdale, and C.W. Turner (1923). <doi:10.1085/jgp.5.6.777> (3) Brody (1924): Brody, S., C.W. Tuner, and A.C. Ragsdale (1924). <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2140670/> (4) Schumacher: Schumacher, F.X. (1939) in Thornley, J.H.M. and J. France (2007). <https://books.google.com.au/books/about/Mathematical_Models_in_Agriculture.html?id=rlwBCRSHobcC&redir_esc=y> (4a) Schumacher (Lopez et al. 2015): Lopez, S. J. France, N.E. Odongo, R.A. McBride, E. Kebreab, O. AlZahal, B.W. McBride, and J. Dijkstra (2015). <doi:10.3168/jds.2014-8132> (5) Parabolic exponential (Adediran): Adediran, S.A., D.A. Ratkowsky, D.J. Donaghy, and A.E.O. Malau-Aduli (2012). <doi:10.3168/jds.2011-4663> (6) Wood: Wood, P.D.P. (1967). <doi:10.1038/216164a0> (6a) Wood reparameterized (Dhanoa): Dhanoa, M.S. (1981). <doi:10.1017/S0003356100027276> (6b) Wood non-linear (Cappio-Borlino): Cappio-Borlino, A., G. Pulina, and G. Rossi (1995). <doi:10.1016/0921-4488(95)00713-U> (7) Quadratic Polynomial (Dave): Dave, B.K. (1971) in Adediran, S.A., D.A. Ratkowsky, D.J. Donaghy, and A.E.O. Malau-Aduli (2012). <doi:10.3168/jds.2011-4663> (8) Cobby and Le Du (Vargas): Vargas, B., W.J. Koops, M. Herrero, and J.A.M Van Arendonk (2000). <doi:10.3168/jds.S0022-0302(00)75005-3> (9) Papajcsik and Bodero 1: Papajcsik, I.A. and J. Bodero (1988). <doi:10.1017/S0003356100003275> (10) Papajcsik and Bodero 2: Papajcsik, I.A. and J. Bodero (1988). <doi:10.1017/S0003356100003275> (11) Papajcsik and Bodero 3: Papajcsik, I.A. and J. Bodero (1988). <doi:10.1017/S0003356100003275> (12) Papajcsik and Bodero 4: Papajcsik, I.A. and J. Bodero (1988). <doi:10.1017/S0003356100003275> (13) Papajcsik and Bodero 6: Papajcsik, I.A. and J. Bodero (1988). <doi:10.1017/S0003356100003275> (14) Mixed log model 1 (Guo and Swalve): Guo, Z. and H.H. Swalve (1995). <https://journal.interbull.org/index.php/ib/issue/view/11> (15) Mixed log model 3 (Guo and Swalve): Guo, Z. and H.H. Swalve (1995). <https://journal.interbull.org/index.php/ib/issue/view/11> (16) Log-quadratic (Adediran et al. 2012): Adediran, S.A., D.A. Ratkowsky, D.J. Donaghy, and A.E.O. Malau-Aduli (2012). <doi:10.3168/jds.2011-4663> (17) Wilmink: J.B.M. Wilmink (1987). <doi:10.1016/0301-6226(87)90003-0> (17a) modified Wilmink (Jakobsen): Jakobsen J.H., P. Madsen, J. Jensen, J. Pedersen, L.G. Christensen, and D.A. Sorensen (2002). <doi:10.3168/jds.S0022-0302(02)74231-8> (17b) modified Wilmink (Laurenson & Strucken): Strucken E.M., Brockmann G.A., and Y.C.S.M. Laurenson (2019). <http://www.aaabg.org/aaabghome/AAABG23papers/35Strucken23139.pdf> (18) Bicompartemental (Ferguson and Boston 1993): Ferguson, J.D., and R. Boston (1993) in Adediran, S.A., D.A. Ratkowsky, D.J. Donaghy, and A.E.O. Malau-Aduli (2012). <doi:10.3168/jds.2011-4663> (19) Dijkstra: Dijkstra, J., J. France, M.S. Dhanoa, J.A. Maas, M.D. Hanigan, A.J. Rook, and D.E. Beever (1997). <doi:10.3168/jds.S0022-0302(97)76185-X> (20) Morant and Gnanasakthy (Pollott et al 2000): Pollott, G.E. and E. Gootwine (2000). <doi:10.1017/S1357729800055028> (21) Morant and Gnanasakthy (Vargas et al 2000): Vargas, B., W.J. Koops, M. Herrero, and J.A.M Van Arendonk (2000). <doi:10.3168/jds.S0022-0302(00)75005-3> (22) Morant and Gnanasakthy (Adediran et al. 2012): Adediran, S.A., D.A. Ratkowsky, D.J. Donaghy, and A.E.O. Malau-Aduli (2012). <doi:10.3168/jds.2011-4663> (23) Khandekar (Guo and Swalve): Guo, Z. and H.H. Swalve (1995). <https://journal.interbull.org/index.php/ib/issue/view/11> (24) Ali and Schaeffer: Ali, T.E. and L.R. Schaeffer (1987). <https://www.nrcresearchpress.com/doi/pdf/10.4141/cjas87-067> (25) Fractional Polynomial (Elvira et al. 2013): Elvira, L., F. Hernandez, P. Cuesta, S. Cano, J.-V. Gonzalez-Martin, and S. Astiz (2012). <doi:10.1017/S175173111200239X> (26) Pollott multiplicative (Elvira): Elvira, L., F. Hernandez, P. Cuesta, S. Cano, J.-V. Gonzalez-Martin, and S. Astiz (2012). <doi:10.1017/S175173111200239X> (27) Pollott modified: Adediran, S.A., D.A. Ratkowsky, D.J. Donaghy, and A.E.O. Malau-Aduli (2012). <doi:10.3168/jds.2011-4663> (28) Monophasic Grossman: Grossman, M. and W.J. Koops (1988). <doi:10.3168/jds.S0022-0302(88)79723-4> (29) Monophasic Power Transformed (Grossman 1999): Grossman, M., S.M. Hartz, and W.J. Koops (1999). <doi:10.3168/jds.S0022-0302(99)75464-0> (30) Diphasic (Grossman 1999): Grossman, M., S.M. Hartz, and W.J. Koops (1999). <doi:10.3168/jds.S0022-0302(99)75464-0> (31) Diphasic Power Transformed (Grossman 1999): Grossman, M., S.M. Hartz, and W.J. Koops (1999). <doi:10.3168/jds.S0022-0302(99)75464-0> (32) Legendre Polynomial (3th order): Jakobsen J.H., P. Madsen, J. Jensen, J. Pedersen, L.G. Christensen, and D.A. Sorensen (2002). <doi:10.3168/jds.S0022-0302(02)74231-8> (33) Legendre Polynomial (4th order): Jakobsen J.H., P. Madsen, J. Jensen, J. Pedersen, L.G. Christensen, and D.A. Sorensen (2002). <doi:10.3168/jds.S0022-0302(02)74231-8> (34) Legendre + Wilmink (Lidauer): Lidauer, M. and E.A. Mantysaari (1999). <https://journal.interbull.org/index.php/ib/article/view/417> (35) Natural Cubic Spline (3 percentiles): White, I.M.S., R. Thompson, and S. Brotherstone (1999). <doi:10.3168/jds.S0022-0302(99)75277-X> (36) Natural Cubic Spline (4 percentiles): White, I.M.S., R. Thompson, and S. Brotherstone (1999). <doi:10.3168/jds.S0022-0302(99)75277-X> (37) Natural Cubic Spline (5 percentiles): White, I.M.S., R. Thompson, and S. Brotherstone (1999) <doi:10.3168/jds.S0022-0302(99)75277-X> (38) Natural Cubic Spline (defined knots according to Harrell 2001): Jr. Harrell, F.E. (2001). <https://link.springer.com/book/10.1007/978-3-319-19425-7> The selection criteria measure the goodness of fit of the model and include: Residual standard error (RSE), R-square (R2), log likelihood, Akaike information criterion (AIC), Akaike information criterion corrected (AICC), Bayesian Information Criterion (BIC), Durbin Watson coefficient (DW). The following model parameters are included: Residual sum of squares (RSS), Residual standard deviation (RSD), F-value (F) based on F-ratio test.
Authors: Eva M. Strucken
Maintainer: Eva M. Strucken <[email protected]>
License: GPL-3
Version: 1.1.0
Built: 2025-02-03 02:53:06 UTC
Source: https://github.com/evastrucken/lactcurves

Help Index


Lactation Curve Parameter Estimation

Description

AllCurves runs multiple lactation curve models and extracts selection criteria (RSE, R2, log likelihood, AIC, AICC, and BIC) for each model.

Usage

AllCurves(x, trait, dim)

Arguments

x

data frame containing londitudinal trait records and time points of record collection

trait

specifies the column containing longitudinal trait records

dim

specifies the column containing time points

Value

Output

modelnames

provides names and order number of models

model

gives model equation, default starting parameters, and other model specifications

critall

gives selection criteria for all models sorted from best to worst accroding to specified criteria

modeldescrip

gives RSS, RSD, and F-value for each model

critbest

gives all selection criteria for best model

bestmodel

gives model equation for best model for each selection criterion

Error

gives a Warning if model failed to converge

ModelParam

gives a list of three tables containing the converged model parameters

summary*

gives the summary of a particular model. summary1 for example give the summary of the first model by Michaelis and Menten

Citation

Strucken, E.M. (2021). lactcurves: Lactation Curve Parameter Estimation. R package version 1.1.0

Note

lactcurved requires installation of packages polynom, orthopolynom, and splines.

In general, if a lactation curve model is linear, it can be fitted directly in a test-day (TD) model. If lactation curve model is non-linear, parameters need to be estimated first and then fitted in a TD model with other fixed and random effects if required.

In lactcurves, starting parameters (defined in start) have been optimized across the first three lactations of 1.7 million Holstein Friesian dairy cows. If a lactation curve model fails to converge with other data, it is recommended to extract the model code and optimize the start values for the new data.

Author(s)

Eva M. Strucken

Examples

## create data set for 3 individuals with milk yield records on 24 days

ID=c(rep("ID123",24),rep("ID456",24),rep("ID789",24))

dim=as.integer(rep(seq(from=5, to=340, by=14),3))

mkg=as.numeric(c(23.4,28.3,30.5,31.3,31.5,31.3,30.9,30.5,30.1,29.6,29.1,28.7,28.2,27.7,27.2,26.7,
26.2,25.7,25.2,24.7,24.2,23.7,23.2,22.8,
21.3,25.7,26.9,27.2,26.9,26.5,26.1,25.6,25.1,24.6,24.1,23.6,23.1,22.6,22.1,21.6,21.1,20.6,20.1,
19.6,19.1,18.6,18.1,17.6,
22.0,26.5,28.1,28.4,28.2,27.9,27.4,26.9,26.4,25.9,25.4,24.9,24.4,23.9,23.4,22.9,22.4,21.9,21.4,
20.9,20.4,19.9,19.4,18.9))

data=cbind.data.frame(ID,dim,mkg)

## run example

library(polynom)
library(orthopolynom)
library(splines)

output=AllCurves(data,mkg,dim)

output$critall
output$modeldescrip
output$critbest
output$bestmodel
output$Error
output$ModelParam
output$summary17b

## plot curve
# set the number of days to consider
dim=c(1:340)

# look up the model and its estimated parameters
output$summary17b

# use model and parameters to plot curve
plot(19.293701+(31.358471-19.293701)*(1-exp(1)^(-0.059874*dim))-0.035495*dim)