<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="Creates a function for a specific parameterizations of the von Bertalanffy, Gompertz, Richards, and logistic growth functions. Use growthFunShow() to see the equations for each growth function."><title>Creates a function for a specific parameterization of the von Bertalanffy, Gompertz, Richards, and logistic growth functions. — growthModels • FSA</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.2.2/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.2.2/bootstrap.bundle.min.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- bootstrap-toc --><script src="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@v1.0.1/dist/bootstrap-toc.min.js" integrity="sha256-4veVQbu7//Lk5TSmc7YV48MxtMy98e26cf5MrgZYnwo=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- search --><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Creates a function for a specific parameterization of the von Bertalanffy, Gompertz, Richards, and logistic growth functions. — growthModels"><meta property="og:description" content="Creates a function for a specific parameterizations of the von Bertalanffy, Gompertz, Richards, and logistic growth functions. Use growthFunShow() to see the equations for each growth function."><meta property="og:image" content="https://fishr-core-team.github.io/FSA/logo.png"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--></head><body>
    <a href="#main" class="visually-hidden-focusable">Skip to contents</a>
    

    <nav class="navbar fixed-top navbar-dark navbar-expand-lg bg-primary"><div class="container">
    
    <a class="navbar-brand me-2" href="../index.html">FSA</a>

    <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Released version">0.9.5</small>

    
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div id="navbar" class="collapse navbar-collapse ms-3">
      <ul class="navbar-nav me-auto"><li class="active nav-item">
  <a class="nav-link" href="../reference/index.html">Reference</a>
</li>
      </ul><form class="form-inline my-2 my-lg-0" role="search">
        <input type="search" class="form-control me-sm-2" aria-label="Toggle navigation" name="search-input" data-search-index="../search.json" id="search-input" placeholder="Search for" autocomplete="off"></form>

      <ul class="navbar-nav"><li class="nav-item">
  <a class="nav-link" href="../news/index.html">
    <span class="fa fa-newspaper"></span>
     
  </a>
</li>
<li class="nav-item">
  <a class="nav-link" href="../index.html">
    <span class="fa fa-home fa"></span>
     
  </a>
</li>
<li class="nav-item">
  <a class="external-link nav-link" href="https://github.com/fishR-Core-Team/FSA">
    <span class="fa fa-github fa"></span>
     
  </a>
</li>
      </ul></div>

    
  </div>
</nav><div class="container template-reference-topic">
<div class="row">
  <main id="main" class="col-md-9"><div class="page-header">
      <img src="../logo.png" class="logo" alt=""><h1>Creates a function for a specific parameterization of the von Bertalanffy, Gompertz, Richards, and logistic growth functions.</h1>
      <small class="dont-index">Source: <a href="https://github.com/fishR-Core-Team/FSA/blob/HEAD/R/growthModels.R" class="external-link"><code>R/growthModels.R</code></a></small>
      <div class="d-none name"><code>growthModels.Rd</code></div>
    </div>

    <div class="ref-description section level2">
    <p>Creates a function for a specific parameterizations of the von Bertalanffy, Gompertz, Richards, and logistic growth functions. Use <code>growthFunShow()</code> to see the equations for each growth function.</p>
    </div>

    <div class="section level2">
    <h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">vbFuns</span><span class="op">(</span></span>
<span>  param <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"Typical"</span>, <span class="st">"typical"</span>, <span class="st">"Traditional"</span>, <span class="st">"traditional"</span>, <span class="st">"BevertonHolt"</span>,</span>
<span>    <span class="st">"Original"</span>, <span class="st">"original"</span>, <span class="st">"vonBertalanffy"</span>, <span class="st">"GQ"</span>, <span class="st">"GallucciQuinn"</span>, <span class="st">"Mooij"</span>, <span class="st">"Weisberg"</span>,</span>
<span>    <span class="st">"Ogle"</span>, <span class="st">"Schnute"</span>, <span class="st">"Francis"</span>, <span class="st">"Laslett"</span>, <span class="st">"Polacheck"</span>, <span class="st">"Somers"</span>, <span class="st">"Somers2"</span>, <span class="st">"Pauly"</span>,</span>
<span>    <span class="st">"Fabens"</span>, <span class="st">"Fabens2"</span>, <span class="st">"Wang"</span>, <span class="st">"Wang2"</span>, <span class="st">"Wang3"</span>, <span class="st">"Francis2"</span>, <span class="st">"Francis3"</span><span class="op">)</span>,</span>
<span>  simple <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  msg <span class="op">=</span> <span class="cn">FALSE</span></span>
<span><span class="op">)</span></span>
<span></span>
<span><span class="fu">GompertzFuns</span><span class="op">(</span></span>
<span>  param <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"Ricker1"</span>, <span class="st">"Ricker2"</span>, <span class="st">"Ricker3"</span>, <span class="st">"QuinnDeriso1"</span>, <span class="st">"QuinnDeriso2"</span>,</span>
<span>    <span class="st">"QuinnDeriso3"</span>, <span class="st">"QD1"</span>, <span class="st">"QD2"</span>, <span class="st">"QD3"</span>, <span class="st">"Original"</span>, <span class="st">"original"</span>, <span class="st">"Troynikov1"</span>,</span>
<span>    <span class="st">"Troynikov2"</span><span class="op">)</span>,</span>
<span>  simple <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  msg <span class="op">=</span> <span class="cn">FALSE</span></span>
<span><span class="op">)</span></span>
<span></span>
<span><span class="fu">RichardsFuns</span><span class="op">(</span>param <span class="op">=</span> <span class="fl">1</span>, simple <span class="op">=</span> <span class="cn">FALSE</span>, msg <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></span>
<span></span>
<span><span class="fu">logisticFuns</span><span class="op">(</span></span>
<span>  param <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"CJ1"</span>, <span class="st">"CJ2"</span>, <span class="st">"Karkach"</span>, <span class="st">"Haddon"</span>, <span class="st">"CampanaJones1"</span>, <span class="st">"CampanaJones2"</span><span class="op">)</span>,</span>
<span>  simple <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  msg <span class="op">=</span> <span class="cn">FALSE</span></span>
<span><span class="op">)</span></span>
<span></span>
<span><span class="fu">growthFunShow</span><span class="op">(</span></span>
<span>  type <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"vonBertalanffy"</span>, <span class="st">"Gompertz"</span>, <span class="st">"Richards"</span>, <span class="st">"Logistic"</span>, <span class="st">"Schnute"</span>,</span>
<span>    <span class="st">"SchnuteRichards"</span><span class="op">)</span>,</span>
<span>  param <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  case <span class="op">=</span> <span class="va">param</span>,</span>
<span>  plot <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  <span class="va">...</span></span>
<span><span class="op">)</span></span></code></pre></div>
    </div>

    <div class="section level2">
    <h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>
    <dl><dt>param</dt>
<dd><p>A string (for von Bertalanffy, Gompertz, and logistic) or numeric (for Richards) that indicates the specific parameterization of the growth function. See details.</p></dd>


<dt>simple</dt>
<dd><p>A logical that indicates whether the function will accept all parameter values in the first parameter argument (<code>=FALSE</code>; DEFAULT) or whether all individual parameters must be specified in separate arguments (<code>=TRUE</code>).</p></dd>


<dt>msg</dt>
<dd><p>A logical that indicates whether a message about the growth function and parameter definitions should be output (<code>=TRUE</code>) or not (<code>=FALSE</code>; DEFAULT).</p></dd>


<dt>type</dt>
<dd><p>A string (in <code>growthFunShow</code>) that indicates the type of growth function to show.</p></dd>


<dt>case</dt>
<dd><p>A numeric that indicates the specific case of the Schnute function to use. See details.</p></dd>


<dt>plot</dt>
<dd><p>A logical that indicates whether the growth function expression should be shown as an equation in a simple plot.</p></dd>


<dt>...</dt>
<dd><p>Not implemented.</p></dd>

</dl></div>
    <div class="section level2">
    <h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
    

<p>The functions ending in <code>xxxFuns</code> return a function that can be used to predict fish size given a vector of ages and values for the growth function parameters and, in some parameterizations, values for constants. The result should be saved to an object that is then the function name. When the resulting function is used, the parameters are ordered as shown when the definitions of the parameters are printed after the function is called (if <code>msg=TRUE</code>). If <code>simple=FALSE</code> (DEFAULT), then the values for all parameters may be included as a vector in the first parameter argument (but in the same order). Similarly, the values for all constants may be included as a vector in the first constant argument (i.e., <code>t1</code>). If <code>simple=TRUE</code>, then all parameters and constants must be declared individually. The resulting function is somewhat easier to read when <code>simple=TRUE</code>, but is less general for some applications.</p>


<p>An expression of the equation for each growth function may be created with <code>growthFunShow</code>. In this function <code>type=</code> is used to select the major function type (e.g., von Bertalanffy, Gompertz, Richards, Logistic, Schnute) and <code>param=</code> is used to select a specific parameterization of that growth function. If <code>plot=TRUE</code>, then a simple graphic will be created with the equation using <code><a href="https://rdrr.io/r/grDevices/plotmath.html" class="external-link">plotmath</a></code> for a pretty format.</p>
    </div>
    <div class="section level2">
    <h2 id="note">Note<a class="anchor" aria-label="anchor" href="#note"></a></h2>
    <p>Take note of the following for parameterizations (i.e., <code>param</code>) of each growth function:</p><ul><li><p>von Bertalanffy</p><ul><li><p>The ‘Original’ and ‘vonBertalanffy’ are synonymous as are ‘Typical’, ‘Traditional’, and ‘BevertonHolt’. Further note that the ‘Ogle’ parameterization has the ‘Original’/‘vonBertalanffy’ and ‘Typical’/‘Traditional’/‘BevertonHolt’ parameterizations as special cases.</p></li>
</ul></li>
<li><p>Gompertz</p><ul><li><p>The ‘Ricker2’ and ‘QuinnDeriso1’ are synonymous, as are ‘Ricker3’ and ‘QuinnDeriso2’.</p></li>
<li><p>The parameterizations and parameters for the Gompertz function are varied and confusing in the literature. I have attempted to use a uniform set of parameters in these functions, but that makes a direct comparison to the literature difficult. Common sources for Gompertz models are listed in the references below. I make some comments here to aid comparisons to the literature.</p></li>
<li><p>Within FSA, L0 is the mean length at age 0, Linf is the mean asymptotic length, ti is the age at the inflection point, gi is the instantaneous growth rate at the inflection point, t* is a dimensionless parameter related to time/age, and a is a dimensionless parameter related to growth.</p></li>
<li><p>In the Quinn and Deriso (1999) functions (the ‘QuinnDerisoX’ functions), the a parameter here is equal to lambda/K there and the gi parameter here is equal to the K parameter there. Also note that their Y is L here.</p></li>
<li><p>In the Ricker (1979)[p. 705] functions (the ‘RickerX’ functions), the a parameter here is equal to k there and the gi parameter here is equal to the g parameter there. Also note that their w is L here. In the Ricker (1979) functions as presented in Campana and Jones (1992), the a parameter here is equal to k parameter there and the gi parameter here is equal to the G parameter there. Also note that their X is L here.</p></li>
<li><p>The function in Ricker (1975)[p. 232] is the same as ‘Ricker2’ where the a parameter here is qual to G there and the gi parameter here is equal to the g parameter there. Also note that their w is L here.</p></li>
<li><p>The function in Quist <em>et al.</em> (2012)[p. 714] is the same as ‘Ricker1’ where the gi parameter here is equal to the G parameter there and the ti parameter here is equal to the t0 parameter there.</p></li>
<li><p>The function in Katsanevakis and Maravelias (2008) is the same as ‘Ricker1’ where the gi parameter here is equal to k2 parameter there and the ti parameter here is equal to the t2 parameter there.</p></li>
</ul></li>
<li><p>Richards</p><ul><li><p>Within FSA, Linf is the mean asymptotic length, ti is the age at the inflection point, k controls the slope at the inflection point (maximum relative growth rate), b is dimensionless but related to the vertical position (i.e., size) of the inflection point, a is dimensionless but related to the horizontal position (i.e., age) of the inflection point, and L0 is the mean length at age-0.</p></li>
<li><p>The parameterizations (1-6) correspond to functions/equations 1, 4, 5, 6, 7, and 8, respectively, in Tjorve and Tjorve (2010). Note that their A, S, k, d, and B are Linf, a, k, b, and L0, respectively, here (in FSA). THeir (Tjorve and Tjorve 2010) K does not appear here.</p></li>
</ul></li>
<li><p>logistic</p><ul><li><p>Within FSA, L0 is the mean length at age 0, Linf is the mean asymptotic length, ti is the age at the inflection point, and gninf is the instantaneous growth rate at negative infinity.</p></li>
</ul></li>
</ul></div>
    <div class="section level2">
    <h2 id="ifar-chapter">IFAR Chapter<a class="anchor" aria-label="anchor" href="#ifar-chapter"></a></h2>
    <p>12-Individual Growth.</p>
    </div>
    <div class="section level2">
    <h2 id="references">References<a class="anchor" aria-label="anchor" href="#references"></a></h2>
    <p>Ogle, D.H. 2016. <a href="https://fishr-core-team.github.io/fishR/pages/books.html#introductory-fisheries-analyses-with-r" class="external-link">Introductory Fisheries Analyses with R</a>. Chapman &amp; Hall/CRC, Boca Raton, FL.</p>
<p>Campana, S.E. and C.M. Jones. 1992. Analysis of otolith microstructure data. Pages 73-100 In D.K. Stevenson and S.E. Campana, editors. Otolith microstructure examination and analysis. Canadian Special Publication of Fisheries and Aquatic Sciences 117. [Was (is?) from http://www.dfo-mpo.gc.ca/Library/141734.pdf.]</p>
<p>Fabens, A. 1965. Properties and fitting of the von Bertalanffy growth curve. Growth 29:265-289.</p>
<p>Francis, R.I.C.C. 1988. Are growth parameters estimated from tagging and age-length data comparable?  Canadian Journal of Fisheries and Aquatic Sciences, 45:936-942.</p>
<p>Gallucci, V.F. and T.J. Quinn II. 1979. Reparameterizing, fitting, and testing a simple growth model. Transactions of the American Fisheries Society, 108:14-25.</p>
<p>Garcia-Berthou, E., G. Carmona-Catot, R. Merciai, and D.H. Ogle. A technical note on seasonal growth models. Reviews in Fish Biology and Fisheries 22:635-640. [Was (is?) from https://www.researchgate.net/publication/257658359_A_technical_note_on_seasonal_growth_models.]</p>
<p>Gompertz, B. 1825. On the nature of the function expressive of the law of human mortality, and on a new method of determining the value of life contingencies. Philosophical Transactions of the Royal Society of London. 115:513-583.</p>
<p>Haddon, M., C. Mundy, and D. Tarbath. 2008. Using an inverse-logistic model to describe growth increments of Blacklip Abalone (<em>Haliotis rubra</em>) in Tasmania. Fishery Bulletin 106:58-71. [Was (is?) from http://aquaticcommons.org/8857/1/haddon_Fish_Bull_2008.pdf.]</p>
<p>Karkach, A. S. 2006. Trajectories and models of individual growth. Demographic Research 15:347-400. [Was (is?) from http://www.demographic-research.org/volumes/vol15/12/15-12.pdf.]</p>
<p>Katsanevakis, S. and C.D. Maravelias. 2008. Modeling fish growth: multi-model inference as a better alternative to a priori using von Bertalanffy equation. Fish and Fisheries 9:178-187.</p>
<p>Mooij, W.M., J.M. Van Rooij, and S. Wijnhoven. 1999. Analysis and comparison of fish growth from small samples of length-at-age data: Detection of sexual dimorphism in Eurasian Perch as an example. Transactions of the American Fisheries Society 128:483-490.</p>
<p>Polacheck, T., J.P. Eveson, and G.M. Laslett. 2004. Increase in growth rates of southern Bluefin Tuna (<em>Thunnus maccoyii</em>) over four decades: 1960 to 2000. Canadian Journal of Fisheries and Aquatic Sciences, 61:307-322.</p>
<p>Quinn, T. J. and R. B. Deriso. 1999. Quantitative Fish Dynamics. Oxford University Press, New York, New York. 542 pages.</p>
<p>Quist, M.C., M.A. Pegg, and D.R. DeVries. 2012. Age and Growth. Chapter 15 in A.V. Zale, D.L Parrish, and T.M. Sutton, Editors  Fisheries Techniques, Third Edition. American Fisheries Society, Bethesda, MD.</p>
<p>Richards, F. J. 1959. A flexible growth function for empirical use. Journal of Experimental Biology 10:290-300.</p>
<p>Ricker, W.E. 1975. Computation and interpretation of biological statistics of fish populations. Technical Report Bulletin 191, Bulletin of the Fisheries Research Board of Canada. [Was (is?) from http://www.dfo-mpo.gc.ca/Library/1485.pdf.]</p>
<p>Ricker, W.E. 1979. Growth rates and models. Pages 677-743 In W.S. Hoar, D.J. Randall, and J.R. Brett, editors. Fish Physiology, Vol. 8: Bioenergetics and Growth. Academic Press, NY, NY. [Was (is?) from https://books.google.com/books?id=CB1qu2VbKwQC&amp;pg=PA705&amp;lpg=PA705&amp;dq=Gompertz+fish&amp;source=bl&amp;ots=y34lhFP4IU&amp;sig=EM_DGEQMPGIn_DlgTcGIi_wbItE&amp;hl=en&amp;sa=X&amp;ei=QmM4VZK6EpDAgwTt24CABw&amp;ved=0CE8Q6AEwBw#v=onepage&amp;q=Gompertz%20fish&amp;f=false.]</p>
<p>Schnute, J. 1981. A versatile growth model with statistically stable parameters. Canadian Journal of Fisheries and Aquatic Sciences, 38:1128-1140.</p>
<p>Somers, I. F. 1988. On a seasonally oscillating growth function. Fishbyte 6(1):8-11. [Was (is?) from http://www.worldfishcenter.org/Naga/na_2914.pdf.]</p>
<p>Tjorve, E. and K. M. C. Tjorve. 2010. A unified approach to the Richards-model family for use in growth analyses: Why we need only two model forms. Journal of Theoretical Biology 267:417-425. [Was (is?) from https://www.researchgate.net/profile/Even_Tjorve/publication/46218377_A_unified_approach_to_the_Richards-model_family_for_use_in_growth_analyses_why_we_need_only_two_model_forms/links/54ba83b80cf29e0cb04bd24e.pdf.]</p>
<p>Troynikov, V. S., R. W. Day, and A. M. Leorke. Estimation of seasonal growth parameters using a stochastic Gompertz model for tagging data. Journal of Shellfish Research 17:833-838. [Was (is?) from https://www.researchgate.net/profile/Robert_Day2/publication/249340562_Estimation_of_seasonal_growth_parameters_using_a_stochastic_gompertz_model_for_tagging_data/links/54200fa30cf203f155c2a08a.pdf.]</p>
<p>Vaughan, D. S. and T. E. Helser. 1990. Status of the Red Drum stock of the Atlantic coast: Stock assessment report for 1989. NOAA Technical Memorandum NMFS-SEFC-263, 117 p. [Was (is?) from http://docs.lib.noaa.gov/noaa_documents/NMFS/SEFSC/TM_NMFS_SEFSC/NMFS_SEFSC_TM_263.pdf.]</p>
<p>Wang, Y.-G. 1998. An improved Fabens method for estimation of growth parameters in the von Bertalanffy model with individual asymptotes. Canadian Journal of Fisheries and Aquatic Sciences 55:397-400.</p>
<p>Weisberg, S., G.R. Spangler, and L. S. Richmond. 2010. Mixed effects models for fish growth. Canadian Journal of Fisheries And Aquatic Sciences 67:269-277.</p>
<p>Winsor, C.P. 1932. The Gompertz curve as a growth curve. Proceedings of the National Academy of Sciences. 18:1-8. [Was (is?) from http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1076153/pdf/pnas01729-0009.pdf.]</p>
    </div>
    <div class="section level2">
    <h2 id="see-also">See also<a class="anchor" aria-label="anchor" href="#see-also"></a></h2>
    <div class="dont-index"><p>See <code><a href="Schnute.html">Schnute</a></code> for an implementation of the Schnute (1981) model.</p></div>
    </div>
    <div class="section level2">
    <h2 id="author">Author<a class="anchor" aria-label="anchor" href="#author"></a></h2>
    <p>Derek H. Ogle, <a href="mailto:DerekOgle51@gmail.com">DerekOgle51@gmail.com</a>, thanks to Gabor Grothendieck for a hint about using <code><a href="https://rdrr.io/r/base/get.html" class="external-link">get()</a></code>.</p>
    </div>

    <div class="section level2">
    <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="co">###########################################################</span></span></span>
<span class="r-in"><span><span class="co">## Simple Examples -- Von B</span></span></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">vb1</span> <span class="op">&lt;-</span> <span class="fu">vbFuns</span><span class="op">(</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, Linf, K = NULL, t0 = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(Linf) == 3) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         K &lt;- Linf[[2]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         t0 &lt;- Linf[[3]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         Linf &lt;- Linf[[1]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     Linf * (1 - exp(-K * (t - t0)))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b4c64908&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b4c8bcd0&gt;</span>
<span class="r-in"><span><span class="va">ages</span> <span class="op">&lt;-</span> <span class="fl">0</span><span class="op">:</span><span class="fl">20</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu">vb1</span><span class="op">(</span><span class="va">ages</span>,Linf<span class="op">=</span><span class="fl">20</span>,K<span class="op">=</span><span class="fl">0.3</span>,t0<span class="op">=</span><span class="op">-</span><span class="fl">0.2</span><span class="op">)</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-1.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">vb2</span> <span class="op">&lt;-</span> <span class="fu">vbFuns</span><span class="op">(</span><span class="st">"Francis"</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, L1, L2 = NULL, L3 = NULL, t1, t3 = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(L1) == 3) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         L2 &lt;- L1[[2]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         L3 &lt;- L1[[3]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         L1 &lt;- L1[[1]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(t1) == 2) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         t3 &lt;- t1[[2]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         t1 &lt;- t1[[1]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     r &lt;- (L3 - L2)/(L2 - L1)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     L1 + (L3 - L1) * ((1 - r^(2 * ((t - t1)/(t3 - t1))))/(1 - </span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         r^2))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b4c6b5b0&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b4e55da0&gt;</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu">vb2</span><span class="op">(</span><span class="va">ages</span>,L1<span class="op">=</span><span class="fl">10</span>,L2<span class="op">=</span><span class="fl">19</span>,L3<span class="op">=</span><span class="fl">20</span>,t1<span class="op">=</span><span class="fl">2</span>,t3<span class="op">=</span><span class="fl">18</span><span class="op">)</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-2.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">vb2c</span> <span class="op">&lt;-</span> <span class="fu">vbFuns</span><span class="op">(</span><span class="st">"Francis"</span>,simple<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span> <span class="op">)</span>   <span class="co"># compare to vb2</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, L1, L2, L3, t1, t3) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     r &lt;- (L3 - L2)/(L2 - L1)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     L1 + (L3 - L1) * ((1 - r^(2 * ((t - t1)/(t3 - t1))))/(1 - </span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         r^2))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b4c6d780&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b4f658a0&gt;</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co">## Simple Examples -- Gompertz</span></span></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">gomp1</span> <span class="op">&lt;-</span> <span class="fu">GompertzFuns</span><span class="op">(</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, Linf, gi = NULL, ti = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(Linf) == 3) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         gi &lt;- Linf[[2]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         ti &lt;- Linf[[3]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         Linf &lt;- Linf[[1]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     Linf * exp(-exp(-gi * (t - ti)))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b4ff2578&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b502a278&gt;</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu">gomp1</span><span class="op">(</span><span class="va">ages</span>,Linf<span class="op">=</span><span class="fl">800</span>,gi<span class="op">=</span><span class="fl">0.5</span>,ti<span class="op">=</span><span class="fl">5</span><span class="op">)</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-3.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">gomp2</span> <span class="op">&lt;-</span> <span class="fu">GompertzFuns</span><span class="op">(</span><span class="st">"Ricker2"</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, L0, a = NULL, gi = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(L0) == 3) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         a &lt;- L0[[2]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         gi &lt;- L0[[3]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         L0 &lt;- L0[[1]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     L0 * exp(a * (1 - exp(-gi * t)))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b5005060&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b5127e50&gt;</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu">gomp2</span><span class="op">(</span><span class="va">ages</span>,L0<span class="op">=</span><span class="fl">2</span>,a<span class="op">=</span><span class="fl">6</span>,gi<span class="op">=</span><span class="fl">0.5</span><span class="op">)</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-4.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">gomp2c</span> <span class="op">&lt;-</span> <span class="fu">GompertzFuns</span><span class="op">(</span><span class="st">"Ricker2"</span>,simple<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span> <span class="op">)</span>   <span class="co"># compare to gomp2</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, L0, a, gi) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     L0 * exp(a * (1 - exp(-gi * t)))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b5004378&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b5238b98&gt;</span>
<span class="r-in"><span><span class="op">(</span> <span class="va">gompT</span> <span class="op">&lt;-</span> <span class="fu">GompertzFuns</span><span class="op">(</span><span class="st">"Troynikov1"</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (Lm, dt, Linf, gi = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(Linf) == 2) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         gi &lt;- Linf[2]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         Linf &lt;- Linf[1]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     Linf * ((Lm/Linf)^exp(-gi * dt)) - Lm</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b5013760&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b528d380&gt;</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co">## Simple Examples -- Richards</span></span></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">rich1</span> <span class="op">&lt;-</span> <span class="fu">RichardsFuns</span><span class="op">(</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, Linf, k = NULL, a = NULL, b = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(Linf) == 4) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         k &lt;- Linf[[2]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         a &lt;- Linf[[3]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         b &lt;- Linf[[4]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         Linf &lt;- Linf[[1]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     Linf * (1 - a * exp(-k * t))^b</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b52fd2d0&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b53136d8&gt;</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu">rich1</span><span class="op">(</span><span class="va">ages</span>,Linf<span class="op">=</span><span class="fl">800</span>,k<span class="op">=</span><span class="fl">0.5</span>,a<span class="op">=</span><span class="fl">1</span>,b<span class="op">=</span><span class="fl">6</span><span class="op">)</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-5.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">rich2</span> <span class="op">&lt;-</span> <span class="fu">RichardsFuns</span><span class="op">(</span><span class="fl">2</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, Linf, k = NULL, ti = NULL, b = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(Linf) == 4) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         k &lt;- Linf[[2]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         ti &lt;- Linf[[3]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         b &lt;- Linf[[4]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         Linf &lt;- Linf[[1]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     Linf * (1 - (1/b) * exp(-k * (t - ti)))^b</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b5301c90&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b5435738&gt;</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu">rich2</span><span class="op">(</span><span class="va">ages</span>,Linf<span class="op">=</span><span class="fl">800</span>,k<span class="op">=</span><span class="fl">0.5</span>,ti<span class="op">=</span><span class="fl">3</span>,b<span class="op">=</span><span class="fl">6</span><span class="op">)</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-6.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">rich3</span> <span class="op">&lt;-</span> <span class="fu">RichardsFuns</span><span class="op">(</span><span class="fl">3</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, Linf, k = NULL, ti = NULL, b = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(Linf) == 4) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         k &lt;- Linf[[2]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         ti &lt;- Linf[[3]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         b &lt;- Linf[[4]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         Linf &lt;- Linf[[1]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     Linf/((1 + b * exp(-k * (t - ti)))^(1/b))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b5300250&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b5555d70&gt;</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu">rich3</span><span class="op">(</span><span class="va">ages</span>,Linf<span class="op">=</span><span class="fl">800</span>,k<span class="op">=</span><span class="fl">0.5</span>,ti<span class="op">=</span><span class="fl">3</span>,b<span class="op">=</span><span class="fl">0.15</span><span class="op">)</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-7.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">rich4</span> <span class="op">&lt;-</span> <span class="fu">RichardsFuns</span><span class="op">(</span><span class="fl">4</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, Linf, k = NULL, ti = NULL, b = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(Linf) == 4) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         k &lt;- Linf[[2]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         ti &lt;- Linf[[3]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         b &lt;- Linf[[4]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         Linf &lt;- Linf[[1]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     Linf * (1 + (b - 1) * exp(-k * (t - ti)))^(1/(1 - b))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b530a700&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b569dd00&gt;</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu">rich4</span><span class="op">(</span><span class="va">ages</span>,Linf<span class="op">=</span><span class="fl">800</span>,k<span class="op">=</span><span class="fl">0.5</span>,ti<span class="op">=</span><span class="fl">3</span>,b<span class="op">=</span><span class="fl">0.95</span><span class="op">)</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/lines.html" class="external-link">lines</a></span><span class="op">(</span><span class="fu">rich4</span><span class="op">(</span><span class="va">ages</span>,Linf<span class="op">=</span><span class="fl">800</span>,k<span class="op">=</span><span class="fl">0.5</span>,ti<span class="op">=</span><span class="fl">3</span>,b<span class="op">=</span><span class="fl">1.5</span><span class="op">)</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span>,col<span class="op">=</span><span class="st">"blue"</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-8.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">rich5</span> <span class="op">&lt;-</span> <span class="fu">RichardsFuns</span><span class="op">(</span><span class="fl">5</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, Linf, k = NULL, L0 = NULL, b = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(Linf) == 4) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         k &lt;- Linf[[2]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         L0 &lt;- Linf[[3]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         b &lt;- Linf[[4]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         Linf &lt;- Linf[[1]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     Linf * (1 + (((L0/Linf)^(1 - b)) - 1) * exp(-k * t))^(1/(1 - </span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         b))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b53185f8&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b581ef90&gt;</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu">rich5</span><span class="op">(</span><span class="va">ages</span>,Linf<span class="op">=</span><span class="fl">800</span>,k<span class="op">=</span><span class="fl">0.5</span>,L0<span class="op">=</span><span class="fl">50</span>,b<span class="op">=</span><span class="fl">1.5</span><span class="op">)</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-9.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">rich6</span> <span class="op">&lt;-</span> <span class="fu">RichardsFuns</span><span class="op">(</span><span class="fl">6</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, Linf, k = NULL, ti = NULL, Lninf = NULL, b = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(Linf) == 5) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         k &lt;- Linf[[2]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         ti &lt;- Linf[[3]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         Lninf &lt;- Linf[[3]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         b &lt;- Linf[[4]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         Linf &lt;- Linf[[1]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     Lninf + (Linf - Lninf) * (1 + (b - 1) * exp(-k * (t - ti)))^(1/(1 - </span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         b))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b5316230&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b5949580&gt;</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu">rich6</span><span class="op">(</span><span class="va">ages</span>,Linf<span class="op">=</span><span class="fl">800</span>,k<span class="op">=</span><span class="fl">0.5</span>,ti<span class="op">=</span><span class="fl">3</span>,Lninf<span class="op">=</span><span class="fl">50</span>,b<span class="op">=</span><span class="fl">1.5</span><span class="op">)</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-10.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">rich2c</span> <span class="op">&lt;-</span> <span class="fu">RichardsFuns</span><span class="op">(</span><span class="fl">2</span>,simple<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span> <span class="op">)</span> <span class="co"># compare to rich2</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, Linf, k, ti, b) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     Linf * (1 - (1/b) * exp(-k * (t - ti)))^b</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b5300b10&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b5b4c1f0&gt;</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co">## Simple Examples -- Logistic</span></span></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">log1</span> <span class="op">&lt;-</span> <span class="fu">logisticFuns</span><span class="op">(</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, Linf, gninf = NULL, ti = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(Linf) == 3) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         gninf &lt;- Linf[[2]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         ti &lt;- Linf[[3]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         Linf &lt;- Linf[[1]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     Linf/(1 + exp(-gninf * (t - ti)))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b5bab2b0&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b5bad988&gt;</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu">log1</span><span class="op">(</span><span class="va">ages</span>,Linf<span class="op">=</span><span class="fl">800</span>,gninf<span class="op">=</span><span class="fl">0.5</span>,ti<span class="op">=</span><span class="fl">5</span><span class="op">)</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-11.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">log2</span> <span class="op">&lt;-</span> <span class="fu">logisticFuns</span><span class="op">(</span><span class="st">"CJ2"</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, Linf, gninf = NULL, a = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(Linf) == 3) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         gninf &lt;- Linf[[2]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         a &lt;- Linf[[3]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         Linf &lt;- Linf[[1]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     Linf/(1 + a * exp(-gninf * t))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b5ba7e60&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b5d049a0&gt;</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">ages</span>,Linf<span class="op">=</span><span class="fl">800</span>,gninf<span class="op">=</span><span class="fl">0.5</span>,a<span class="op">=</span><span class="fl">10</span><span class="op">)</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-12.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">log2c</span> <span class="op">&lt;-</span> <span class="fu">logisticFuns</span><span class="op">(</span><span class="st">"CJ2"</span>,simple<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span> <span class="op">)</span> <span class="co"># compare to log2</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, Linf, gninf, a) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     Linf/(1 + a * exp(-gninf * t))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b5ba71b0&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b5e81db0&gt;</span>
<span class="r-in"><span><span class="op">(</span> <span class="va">log3</span> <span class="op">&lt;-</span> <span class="fu">logisticFuns</span><span class="op">(</span><span class="st">"Karkach"</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (t, Linf, L0 = NULL, gninf = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(Linf) == 3) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         L0 &lt;- Linf[[2]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         gninf &lt;- Linf[[3]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         Linf &lt;- Linf[[1]]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     L0 * Linf/(L0 + (Linf - L0) * exp(-gninf * t))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b5ba6c00&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b6028220&gt;</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu">log3</span><span class="op">(</span><span class="va">ages</span>,L0<span class="op">=</span><span class="fl">10</span>,Linf<span class="op">=</span><span class="fl">800</span>,gninf<span class="op">=</span><span class="fl">0.5</span><span class="op">)</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-13.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">log4</span> <span class="op">&lt;-</span> <span class="fu">logisticFuns</span><span class="op">(</span><span class="st">"Haddon"</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> function (Lm, dLmax, L50 = NULL, L95 = NULL) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     if (length(dLmax) == 3) {</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         L50 &lt;- dLmax[2]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         L95 &lt;- dLmax[3]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>         dLmax &lt;- dLmax[1]</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     dLmax/(1 + exp(log(19) * ((Lm - L50)/(L95 - L50))))</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;bytecode: 0x00000239b5bbb608&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x00000239b6431dd0&gt;</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co">###########################################################</span></span></span>
<span class="r-in"><span><span class="co">## Examples of fitting</span></span></span>
<span class="r-in"><span><span class="co">##   After the last example a plot is constructed with three</span></span></span>
<span class="r-in"><span><span class="co">##   or four lines on top of each other illustrating that the</span></span></span>
<span class="r-in"><span><span class="co">##   parameterizations all produce the same fitted values.</span></span></span>
<span class="r-in"><span><span class="co">##   However, observe the correlations in the summary() results.</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co">## Von B</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">tl</span><span class="op">~</span><span class="va">age</span>,data<span class="op">=</span><span class="va">SpotVA1</span>,pch<span class="op">=</span><span class="fl">19</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Fitting the typical parameterization of the von B function</span></span></span>
<span class="r-in"><span><span class="va">fit1</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/stats/nls.html" class="external-link">nls</a></span><span class="op">(</span><span class="va">tl</span><span class="op">~</span><span class="fu">vb1</span><span class="op">(</span><span class="va">age</span>,<span class="va">Linf</span>,<span class="va">K</span>,<span class="va">t0</span><span class="op">)</span>,data<span class="op">=</span><span class="va">SpotVA1</span>,</span></span>
<span class="r-in"><span>            start<span class="op">=</span><span class="fu"><a href="vbStarts.html">vbStarts</a></span><span class="op">(</span><span class="va">tl</span><span class="op">~</span><span class="va">age</span>,data<span class="op">=</span><span class="va">SpotVA1</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit1</span>,correlation<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Formula: tl ~ vb1(age, Linf, K, t0)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Parameters:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>      Estimate Std. Error t value Pr(&gt;|t|)    </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Linf 16.79818    1.93455   8.683  &lt; 2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> K     0.22493    0.06922   3.250  0.00125 ** </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> t0   -2.55738    0.47496  -5.384 1.24e-07 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ---</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Residual standard error: 1.053 on 400 degrees of freedom</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Correlation of Parameter Estimates:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>    Linf  K    </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> K  -0.99      </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> t0 -0.94  0.98</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Number of iterations to convergence: 10 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Achieved convergence tolerance: 5.49e-06</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/curve.html" class="external-link">curve</a></span><span class="op">(</span><span class="fu">vb1</span><span class="op">(</span><span class="va">x</span>,Linf<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit1</span><span class="op">)</span><span class="op">)</span>,from<span class="op">=</span><span class="fl">0</span>,to<span class="op">=</span><span class="fl">5</span>,col<span class="op">=</span><span class="st">"red"</span>,lwd<span class="op">=</span><span class="fl">10</span>,add<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Fitting the Francis parameterization of the von B function</span></span></span>
<span class="r-in"><span><span class="va">fit2</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/stats/nls.html" class="external-link">nls</a></span><span class="op">(</span><span class="va">tl</span><span class="op">~</span><span class="fu">vb2c</span><span class="op">(</span><span class="va">age</span>,<span class="va">L1</span>,<span class="va">L2</span>,<span class="va">L3</span>,t1<span class="op">=</span><span class="fl">0</span>,t3<span class="op">=</span><span class="fl">5</span><span class="op">)</span>,data<span class="op">=</span><span class="va">SpotVA1</span>,</span></span>
<span class="r-in"><span>            start<span class="op">=</span><span class="fu"><a href="vbStarts.html">vbStarts</a></span><span class="op">(</span><span class="va">tl</span><span class="op">~</span><span class="va">age</span>,data<span class="op">=</span><span class="va">SpotVA1</span>,type<span class="op">=</span><span class="st">"Francis"</span>,ages2use<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">0</span>,<span class="fl">5</span><span class="op">)</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit2</span>,correlation<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Formula: tl ~ vb2c(age, L1, L2, L3, t1 = 0, t3 = 5)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Parameters:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>    Estimate Std. Error t value Pr(&gt;|t|)    </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> L1  7.34803    0.18749   39.19   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> L2 11.41275    0.08344  136.78   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> L3 13.72912    0.32219   42.61   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ---</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Residual standard error: 1.053 on 400 degrees of freedom</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Correlation of Parameter Estimates:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>    L1    L2   </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> L2 -0.43      </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> L3  0.48  0.20</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Number of iterations to convergence: 7 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Achieved convergence tolerance: 9.455e-06</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/curve.html" class="external-link">curve</a></span><span class="op">(</span><span class="fu">vb2c</span><span class="op">(</span><span class="va">x</span>,L1<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit2</span><span class="op">)</span><span class="op">[</span><span class="fl">1</span><span class="op">]</span>,L2<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit2</span><span class="op">)</span><span class="op">[</span><span class="fl">2</span><span class="op">]</span>,L3<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit2</span><span class="op">)</span><span class="op">[</span><span class="fl">3</span><span class="op">]</span>,t1<span class="op">=</span><span class="fl">0</span>,t3<span class="op">=</span><span class="fl">5</span><span class="op">)</span>,</span></span>
<span class="r-in"><span>      from<span class="op">=</span><span class="fl">0</span>,to<span class="op">=</span><span class="fl">5</span>,col<span class="op">=</span><span class="st">"blue"</span>,lwd<span class="op">=</span><span class="fl">5</span>,add<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Fitting the Schnute parameterization of the von B function</span></span></span>
<span class="r-in"><span><span class="va">vb3</span> <span class="op">&lt;-</span> <span class="fu">vbFuns</span><span class="op">(</span><span class="st">"Schnute"</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">fit3</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/stats/nls.html" class="external-link">nls</a></span><span class="op">(</span><span class="va">tl</span><span class="op">~</span><span class="fu">vb3</span><span class="op">(</span><span class="va">age</span>,<span class="va">L1</span>,<span class="va">L3</span>,<span class="va">K</span>,t1<span class="op">=</span><span class="fl">0</span>,t3<span class="op">=</span><span class="fl">4</span><span class="op">)</span>,data<span class="op">=</span><span class="va">SpotVA1</span>,</span></span>
<span class="r-in"><span>            start<span class="op">=</span><span class="fu"><a href="vbStarts.html">vbStarts</a></span><span class="op">(</span><span class="va">tl</span><span class="op">~</span><span class="va">age</span>,data<span class="op">=</span><span class="va">SpotVA1</span>,type<span class="op">=</span><span class="st">"Schnute"</span>,ages2use<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">0</span>,<span class="fl">4</span><span class="op">)</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit3</span>,correlation<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Formula: tl ~ vb3(age, L1, L3, K, t1 = 0, t3 = 4)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Parameters:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>    Estimate Std. Error t value Pr(&gt;|t|)    </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> L1  7.34803    0.18749   39.19  &lt; 2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> L3 12.95500    0.18740   69.13  &lt; 2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> K   0.22494    0.06922    3.25  0.00125 ** </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ---</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Residual standard error: 1.053 on 400 degrees of freedom</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Correlation of Parameter Estimates:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>    L1    L3   </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> L3  0.30      </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> K  -0.80 -0.71</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Number of iterations to convergence: 8 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Achieved convergence tolerance: 8.156e-06</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/curve.html" class="external-link">curve</a></span><span class="op">(</span><span class="fu">vb3</span><span class="op">(</span><span class="va">x</span>,L1<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit3</span><span class="op">)</span>,t1<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">0</span>,<span class="fl">4</span><span class="op">)</span><span class="op">)</span>,from<span class="op">=</span><span class="fl">0</span>,to<span class="op">=</span><span class="fl">5</span>,col<span class="op">=</span><span class="st">"green"</span>,lwd<span class="op">=</span><span class="fl">2</span>,add<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-14.png" alt="" width="700" height="433"></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co">## Gompertz</span></span></span>
<span class="r-in"><span><span class="co"># Make some fake data using the original parameterization</span></span></span>
<span class="r-in"><span><span class="va">gompO</span> <span class="op">&lt;-</span> <span class="fu">GompertzFuns</span><span class="op">(</span><span class="st">"original"</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="co"># setup ages, sample sizes (general reduction in numbers with</span></span></span>
<span class="r-in"><span><span class="co"># increasing age), and additive SD to model</span></span></span>
<span class="r-in"><span><span class="va">t</span> <span class="op">&lt;-</span> <span class="fl">1</span><span class="op">:</span><span class="fl">15</span></span></span>
<span class="r-in"><span><span class="va">n</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">10</span>,<span class="fl">40</span>,<span class="fl">35</span>,<span class="fl">25</span>,<span class="fl">12</span>,<span class="fl">10</span>,<span class="fl">10</span>,<span class="fl">8</span>,<span class="fl">6</span>,<span class="fl">5</span>,<span class="fl">3</span>,<span class="fl">3</span>,<span class="fl">3</span>,<span class="fl">2</span>,<span class="fl">2</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">sd</span> <span class="op">&lt;-</span> <span class="fl">15</span></span></span>
<span class="r-in"><span><span class="co"># expand ages</span></span></span>
<span class="r-in"><span><span class="va">ages</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html" class="external-link">rep</a></span><span class="op">(</span><span class="va">t</span>,<span class="va">n</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="co"># get lengths from gompertz and a random error for individuals</span></span></span>
<span class="r-in"><span><span class="va">lens</span> <span class="op">&lt;-</span> <span class="fu">gompO</span><span class="op">(</span><span class="va">ages</span>,Linf<span class="op">=</span><span class="fl">450</span>,a<span class="op">=</span><span class="fl">1</span>,gi<span class="op">=</span><span class="fl">0.3</span><span class="op">)</span><span class="op">+</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/length.html" class="external-link">length</a></span><span class="op">(</span><span class="va">ages</span><span class="op">)</span>,<span class="fl">0</span>,<span class="va">sd</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="co"># put together as a data.frame</span></span></span>
<span class="r-in"><span><span class="va">df</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span>age<span class="op">=</span><span class="va">ages</span>,len<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/Round.html" class="external-link">round</a></span><span class="op">(</span><span class="va">lens</span>,<span class="fl">0</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">len</span><span class="op">~</span><span class="va">age</span>,data<span class="op">=</span><span class="va">df</span>,pch<span class="op">=</span><span class="fl">19</span>,col<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/grDevices/rgb.html" class="external-link">rgb</a></span><span class="op">(</span><span class="fl">0</span>,<span class="fl">0</span>,<span class="fl">0</span>,<span class="fl">1</span><span class="op">/</span><span class="fl">5</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span>  </span></span>
<span class="r-in"><span><span class="co"># Fit first Ricker parameterization</span></span></span>
<span class="r-in"><span><span class="va">fit1</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/stats/nls.html" class="external-link">nls</a></span><span class="op">(</span><span class="va">len</span><span class="op">~</span><span class="fu">gomp1</span><span class="op">(</span><span class="va">age</span>,<span class="va">Linf</span>,<span class="va">gi</span>,<span class="va">ti</span><span class="op">)</span>,data<span class="op">=</span><span class="va">df</span>,start<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span>Linf<span class="op">=</span><span class="fl">500</span>,gi<span class="op">=</span><span class="fl">0.3</span>,ti<span class="op">=</span><span class="fl">3</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit1</span>,correlation<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Formula: len ~ gomp1(age, Linf, gi, ti)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Parameters:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>       Estimate Std. Error t value Pr(&gt;|t|)    </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Linf 4.563e+02  6.231e+00   73.23   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> gi   2.998e-01  9.123e-03   32.86   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ti   3.423e+00  6.060e-02   56.49   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ---</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Residual standard error: 15.65 on 171 degrees of freedom</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Correlation of Parameter Estimates:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>    Linf  gi   </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> gi -0.84      </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ti  0.88 -0.73</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Number of iterations to convergence: 3 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Achieved convergence tolerance: 5.463e-07</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/curve.html" class="external-link">curve</a></span><span class="op">(</span><span class="fu">gomp1</span><span class="op">(</span><span class="va">x</span>,Linf<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit1</span><span class="op">)</span><span class="op">)</span>,from<span class="op">=</span><span class="fl">0</span>,to<span class="op">=</span><span class="fl">15</span>,col<span class="op">=</span><span class="st">"red"</span>,lwd<span class="op">=</span><span class="fl">10</span>,add<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Fit third Ricker parameterization</span></span></span>
<span class="r-in"><span><span class="va">fit2</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/stats/nls.html" class="external-link">nls</a></span><span class="op">(</span><span class="va">len</span><span class="op">~</span><span class="fu">gomp2</span><span class="op">(</span><span class="va">age</span>,<span class="va">L0</span>,<span class="va">a</span>,<span class="va">gi</span><span class="op">)</span>,data<span class="op">=</span><span class="va">df</span>,start<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span>L0<span class="op">=</span><span class="fl">30</span>,a<span class="op">=</span><span class="fl">3</span>,gi<span class="op">=</span><span class="fl">0.3</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit2</span>,correlation<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Formula: len ~ gomp2(age, L0, a, gi)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Parameters:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     Estimate Std. Error t value Pr(&gt;|t|)    </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> L0 28.011977   1.912871   14.64   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> a   2.790547   0.060744   45.94   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> gi  0.299777   0.009123   32.86   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ---</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Residual standard error: 15.65 on 171 degrees of freedom</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Correlation of Parameter Estimates:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>    L0    a    </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> a  -0.98      </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> gi -0.90  0.82</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Number of iterations to convergence: 3 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Achieved convergence tolerance: 9.415e-06</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/curve.html" class="external-link">curve</a></span><span class="op">(</span><span class="fu">gomp2</span><span class="op">(</span><span class="va">x</span>,L0<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit2</span><span class="op">)</span><span class="op">)</span>,from<span class="op">=</span><span class="fl">0</span>,to<span class="op">=</span><span class="fl">15</span>,col<span class="op">=</span><span class="st">"blue"</span>,lwd<span class="op">=</span><span class="fl">5</span>,add<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Fit third Quinn and Deriso parameterization (using simple=TRUE model)</span></span></span>
<span class="r-in"><span><span class="va">gomp3</span> <span class="op">&lt;-</span> <span class="fu">GompertzFuns</span><span class="op">(</span><span class="st">"QD3"</span>,simple<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">fit3</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/stats/nls.html" class="external-link">nls</a></span><span class="op">(</span><span class="va">len</span><span class="op">~</span><span class="fu">gomp3</span><span class="op">(</span><span class="va">age</span>,<span class="va">Linf</span>,<span class="va">gi</span>,<span class="va">t0</span><span class="op">)</span>,data<span class="op">=</span><span class="va">df</span>,start<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span>Linf<span class="op">=</span><span class="fl">500</span>,gi<span class="op">=</span><span class="fl">0.3</span>,t0<span class="op">=</span><span class="fl">0</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit3</span>,correlation<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Formula: len ~ gomp3(age, Linf, gi, t0)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Parameters:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>        Estimate Std. Error t value Pr(&gt;|t|)    </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Linf 456.313767   6.231063  73.232  &lt; 2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> gi     0.299776   0.009123  32.858  &lt; 2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> t0    -0.595395   0.184092  -3.234  0.00146 ** </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ---</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Residual standard error: 15.65 on 171 degrees of freedom</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Correlation of Parameter Estimates:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>    Linf  gi   </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> gi -0.84      </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> t0 -0.74  0.97</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Number of iterations to convergence: 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Achieved convergence tolerance: 4.607e-07</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/curve.html" class="external-link">curve</a></span><span class="op">(</span><span class="fu">gomp3</span><span class="op">(</span><span class="va">x</span>,Linf<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit3</span><span class="op">)</span><span class="op">[</span><span class="fl">1</span><span class="op">]</span>,gi<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit3</span><span class="op">)</span><span class="op">[</span><span class="fl">2</span><span class="op">]</span>,t0<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit3</span><span class="op">)</span><span class="op">[</span><span class="fl">3</span><span class="op">]</span><span class="op">)</span>,</span></span>
<span class="r-in"><span>      from<span class="op">=</span><span class="fl">0</span>,to<span class="op">=</span><span class="fl">15</span>,col<span class="op">=</span><span class="st">"green"</span>,lwd<span class="op">=</span><span class="fl">2</span>,add<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-15.png" alt="" width="700" height="433"></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co">## Richards</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="cn">FALSE</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span><span class="co"># Fit first Richards parameterization ... DOES NOT CONVERGE</span></span></span>
<span class="r-in"><span><span class="va">fit1</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/stats/nls.html" class="external-link">nls</a></span><span class="op">(</span><span class="va">len</span><span class="op">~</span><span class="fu">rich1</span><span class="op">(</span><span class="va">age</span>,<span class="va">Linf</span>,<span class="va">k</span>,<span class="va">a</span>,<span class="va">b</span><span class="op">)</span>,data<span class="op">=</span><span class="va">df</span>,</span></span>
<span class="r-in"><span>            start<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span>Linf<span class="op">=</span><span class="fl">450</span>,k<span class="op">=</span><span class="fl">0.3</span>,a<span class="op">=</span><span class="fl">0.2</span>,b<span class="op">=</span><span class="fl">3</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit1</span>,correlation<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/curve.html" class="external-link">curve</a></span><span class="op">(</span><span class="fu">rich1</span><span class="op">(</span><span class="va">x</span>,Linf<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit1</span><span class="op">)</span><span class="op">)</span>,from<span class="op">=</span><span class="fl">0</span>,to<span class="op">=</span><span class="fl">15</span>,col<span class="op">=</span><span class="st">"red"</span>,lwd<span class="op">=</span><span class="fl">10</span>,add<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Fit second Richards parameterization ... DOES NOT CONVERGE</span></span></span>
<span class="r-in"><span><span class="va">fit2</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/stats/nls.html" class="external-link">nls</a></span><span class="op">(</span><span class="va">len</span><span class="op">~</span><span class="fu">rich2</span><span class="op">(</span><span class="va">age</span>,<span class="va">Linf</span>,<span class="va">k</span>,<span class="va">ti</span>,<span class="va">b</span><span class="op">)</span>,data<span class="op">=</span><span class="va">df</span>,</span></span>
<span class="r-in"><span>            start<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span>Linf<span class="op">=</span><span class="fl">450</span>,k<span class="op">=</span><span class="fl">0.25</span>,ti<span class="op">=</span><span class="fl">3</span>,b<span class="op">=</span><span class="fl">3</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit2</span>,correlation<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/curve.html" class="external-link">curve</a></span><span class="op">(</span><span class="fu">rich2</span><span class="op">(</span><span class="va">x</span>,Linf<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit2</span><span class="op">)</span><span class="op">)</span>,from<span class="op">=</span><span class="fl">0</span>,to<span class="op">=</span><span class="fl">15</span>,col<span class="op">=</span><span class="st">"blue"</span>,lwd<span class="op">=</span><span class="fl">7</span>,add<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">len</span><span class="op">~</span><span class="va">age</span>,data<span class="op">=</span><span class="va">df</span>,pch<span class="op">=</span><span class="fl">19</span>,col<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/grDevices/rgb.html" class="external-link">rgb</a></span><span class="op">(</span><span class="fl">0</span>,<span class="fl">0</span>,<span class="fl">0</span>,<span class="fl">1</span><span class="op">/</span><span class="fl">5</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Fit third Richards parameterization</span></span></span>
<span class="r-in"><span><span class="va">fit3</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/stats/nls.html" class="external-link">nls</a></span><span class="op">(</span><span class="va">len</span><span class="op">~</span><span class="fu">rich3</span><span class="op">(</span><span class="va">age</span>,<span class="va">Linf</span>,<span class="va">k</span>,<span class="va">ti</span>,<span class="va">b</span><span class="op">)</span>,data<span class="op">=</span><span class="va">df</span>,</span></span>
<span class="r-in"><span>            start<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span>Linf<span class="op">=</span><span class="fl">450</span>,k<span class="op">=</span><span class="fl">0.25</span>,ti<span class="op">=</span><span class="fl">3</span>,b<span class="op">=</span><span class="op">-</span><span class="fl">0.1</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit3</span>,correlation<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Formula: len ~ rich3(age, Linf, k, ti, b)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Parameters:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>       Estimate Std. Error t value Pr(&gt;|t|)    </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Linf 450.93727    8.80977  51.186   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> k      0.32411    0.03314   9.781   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ti     3.62654    0.25312  14.328   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> b      0.14402    0.18597   0.774     0.44    </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ---</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Residual standard error: 15.66 on 170 degrees of freedom</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Correlation of Parameter Estimates:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>    Linf  k     ti   </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> k  -0.87            </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ti -0.58  0.88      </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> b  -0.75  0.96  0.97</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Number of iterations to convergence: 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Achieved convergence tolerance: 8.624e-06</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/curve.html" class="external-link">curve</a></span><span class="op">(</span><span class="fu">rich3</span><span class="op">(</span><span class="va">x</span>,Linf<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit3</span><span class="op">)</span><span class="op">)</span>,from<span class="op">=</span><span class="fl">0</span>,to<span class="op">=</span><span class="fl">15</span>,col<span class="op">=</span><span class="st">"green"</span>,lwd<span class="op">=</span><span class="fl">4</span>,add<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Fit fourth Richards parameterization</span></span></span>
<span class="r-in"><span><span class="va">fit4</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/stats/nls.html" class="external-link">nls</a></span><span class="op">(</span><span class="va">len</span><span class="op">~</span><span class="fu">rich4</span><span class="op">(</span><span class="va">age</span>,<span class="va">Linf</span>,<span class="va">k</span>,<span class="va">ti</span>,<span class="va">b</span><span class="op">)</span>,data<span class="op">=</span><span class="va">df</span>,</span></span>
<span class="r-in"><span>            start<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span>Linf<span class="op">=</span><span class="fl">450</span>,k<span class="op">=</span><span class="fl">0.25</span>,ti<span class="op">=</span><span class="fl">3</span>,b<span class="op">=</span><span class="fl">0.7</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit4</span>,correlation<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Formula: len ~ rich4(age, Linf, k, ti, b)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Parameters:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>       Estimate Std. Error t value Pr(&gt;|t|)    </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Linf 450.93724    8.80980  51.186  &lt; 2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> k      0.32411    0.03314   9.781  &lt; 2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ti     3.62652    0.25312  14.328  &lt; 2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> b      1.14401    0.18597   6.151 5.33e-09 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ---</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Residual standard error: 15.66 on 170 degrees of freedom</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Correlation of Parameter Estimates:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>    Linf  k     ti   </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> k  -0.87            </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ti -0.58  0.88      </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> b  -0.75  0.96  0.97</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Number of iterations to convergence: 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Achieved convergence tolerance: 2.301e-06</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/curve.html" class="external-link">curve</a></span><span class="op">(</span><span class="fu">rich4</span><span class="op">(</span><span class="va">x</span>,Linf<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit4</span><span class="op">)</span><span class="op">)</span>,from<span class="op">=</span><span class="fl">0</span>,to<span class="op">=</span><span class="fl">15</span>,col<span class="op">=</span><span class="st">"black"</span>,lwd<span class="op">=</span><span class="fl">1</span>,add<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-16.png" alt="" width="700" height="433"></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co">## Logistic</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">len</span><span class="op">~</span><span class="va">age</span>,data<span class="op">=</span><span class="va">df</span>,pch<span class="op">=</span><span class="fl">19</span>,col<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/grDevices/rgb.html" class="external-link">rgb</a></span><span class="op">(</span><span class="fl">0</span>,<span class="fl">0</span>,<span class="fl">0</span>,<span class="fl">1</span><span class="op">/</span><span class="fl">5</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Fit first Campana-Jones parameterization</span></span></span>
<span class="r-in"><span><span class="va">fit1</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/stats/nls.html" class="external-link">nls</a></span><span class="op">(</span><span class="va">len</span><span class="op">~</span><span class="fu">log1</span><span class="op">(</span><span class="va">age</span>,<span class="va">Linf</span>,<span class="va">gninf</span>,<span class="va">ti</span><span class="op">)</span>,data<span class="op">=</span><span class="va">df</span>,</span></span>
<span class="r-in"><span>            start<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span>Linf<span class="op">=</span><span class="fl">450</span>,gninf<span class="op">=</span><span class="fl">0.45</span>,ti<span class="op">=</span><span class="fl">4</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit1</span>,correlation<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Formula: len ~ log1(age, Linf, gninf, ti)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Parameters:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>        Estimate Std. Error t value Pr(&gt;|t|)    </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Linf  430.72662    4.75127   90.66   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> gninf   0.47069    0.01228   38.33   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ti      4.48165    0.07048   63.58   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ---</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Residual standard error: 16.3 on 171 degrees of freedom</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Correlation of Parameter Estimates:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>       Linf  gninf</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> gninf -0.71      </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ti     0.88 -0.74</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Number of iterations to convergence: 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Achieved convergence tolerance: 7.635e-07</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/curve.html" class="external-link">curve</a></span><span class="op">(</span><span class="fu">log1</span><span class="op">(</span><span class="va">x</span>,Linf<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit1</span><span class="op">)</span><span class="op">)</span>,from<span class="op">=</span><span class="fl">0</span>,to<span class="op">=</span><span class="fl">15</span>,col<span class="op">=</span><span class="st">"red"</span>,lwd<span class="op">=</span><span class="fl">10</span>,add<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Fit second Campana-Jones parameterization</span></span></span>
<span class="r-in"><span><span class="va">fit2</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/stats/nls.html" class="external-link">nls</a></span><span class="op">(</span><span class="va">len</span><span class="op">~</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">age</span>,<span class="va">Linf</span>,<span class="va">gninf</span>,<span class="va">a</span><span class="op">)</span>,data<span class="op">=</span><span class="va">df</span>,</span></span>
<span class="r-in"><span>            start<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span>Linf<span class="op">=</span><span class="fl">450</span>,gninf<span class="op">=</span><span class="fl">0.45</span>,a<span class="op">=</span><span class="fl">7</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit2</span>,correlation<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Formula: len ~ log2(age, Linf, gninf, a)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Parameters:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>        Estimate Std. Error t value Pr(&gt;|t|)    </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Linf  430.72616    4.75126   90.66   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> gninf   0.47069    0.01228   38.33   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> a       8.24373    0.31031   26.57   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ---</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Residual standard error: 16.3 on 171 degrees of freedom</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Correlation of Parameter Estimates:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>       Linf  gninf</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> gninf -0.71      </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> a     -0.26  0.81</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Number of iterations to convergence: 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Achieved convergence tolerance: 8.456e-06</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/curve.html" class="external-link">curve</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">x</span>,Linf<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit2</span><span class="op">)</span><span class="op">)</span>,from<span class="op">=</span><span class="fl">0</span>,to<span class="op">=</span><span class="fl">15</span>,col<span class="op">=</span><span class="st">"blue"</span>,lwd<span class="op">=</span><span class="fl">5</span>,add<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Fit Karkach parameterization (using simple=TRUE model)</span></span></span>
<span class="r-in"><span><span class="va">log3</span> <span class="op">&lt;-</span> <span class="fu">logisticFuns</span><span class="op">(</span><span class="st">"Karkach"</span>,simple<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">fit3</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/stats/nls.html" class="external-link">nls</a></span><span class="op">(</span><span class="va">len</span><span class="op">~</span><span class="fu">log3</span><span class="op">(</span><span class="va">age</span>,<span class="va">Linf</span>,<span class="va">L0</span>,<span class="va">gninf</span><span class="op">)</span>,data<span class="op">=</span><span class="va">df</span>,</span></span>
<span class="r-in"><span>            start<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span>Linf<span class="op">=</span><span class="fl">450</span>,L0<span class="op">=</span><span class="fl">30</span>,gninf<span class="op">=</span><span class="fl">0.45</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit3</span>,correlation<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Formula: len ~ log3(age, Linf, L0, gninf)</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Parameters:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>        Estimate Std. Error t value Pr(&gt;|t|)    </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Linf  430.72705    4.75129   90.66   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> L0     46.59678    1.76836   26.35   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> gninf   0.47068    0.01228   38.33   &lt;2e-16 ***</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ---</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Residual standard error: 16.3 on 171 degrees of freedom</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Correlation of Parameter Estimates:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>       Linf  L0   </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> L0     0.52      </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> gninf -0.71 -0.92</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Number of iterations to convergence: 5 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Achieved convergence tolerance: 6.738e-06</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/curve.html" class="external-link">curve</a></span><span class="op">(</span><span class="fu">log3</span><span class="op">(</span><span class="va">x</span>,Linf<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit3</span><span class="op">)</span><span class="op">[</span><span class="fl">1</span><span class="op">]</span>,L0<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit3</span><span class="op">)</span><span class="op">[</span><span class="fl">2</span><span class="op">]</span>,gninf<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html" class="external-link">coef</a></span><span class="op">(</span><span class="va">fit3</span><span class="op">)</span><span class="op">[</span><span class="fl">3</span><span class="op">]</span><span class="op">)</span>,</span></span>
<span class="r-in"><span>      from<span class="op">=</span><span class="fl">0</span>,to<span class="op">=</span><span class="fl">15</span>,col<span class="op">=</span><span class="st">"green"</span>,lwd<span class="op">=</span><span class="fl">2</span>,add<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-17.png" alt="" width="700" height="433"></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co">#############################################################################</span></span></span>
<span class="r-in"><span><span class="co">## Create expressions of the models</span></span></span>
<span class="r-in"><span><span class="co">#############################################################################</span></span></span>
<span class="r-in"><span><span class="co"># Typical von Bertalanffy ... Show as a stand-alone plot</span></span></span>
<span class="r-in"><span><span class="fu">growthFunShow</span><span class="op">(</span><span class="st">"vonBertalanffy"</span>,<span class="st">"Typical"</span>,plot<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-18.png" alt="" width="700" height="433"></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> expression(E(L[t]) == L[infinity] * bgroup("(", 1 - e^{</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     -K * (t ~ -~t[0])</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }, ")"))</span>
<span class="r-in"><span><span class="co"># Get and save the expression</span></span></span>
<span class="r-in"><span><span class="op">(</span> <span class="va">tmp</span> <span class="op">&lt;-</span> <span class="fu">growthFunShow</span><span class="op">(</span><span class="st">"vonBertalanffy"</span>,<span class="st">"Typical"</span><span class="op">)</span> <span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> expression(E(L[t]) == L[infinity] * bgroup("(", 1 - e^{</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>     -K * (t ~ -~t[0])</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> }, ")"))</span>
<span class="r-in"><span><span class="co"># Use expression as title on a plot</span></span></span>
<span class="r-in"><span><span class="va">lens</span> <span class="op">&lt;-</span> <span class="fu">vb1</span><span class="op">(</span><span class="va">ages</span>,Linf<span class="op">=</span><span class="fl">20</span>,K<span class="op">=</span><span class="fl">0.3</span>,t0<span class="op">=</span><span class="op">-</span><span class="fl">0.2</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">lens</span><span class="op">~</span><span class="va">ages</span>,type<span class="op">=</span><span class="st">"b"</span>,pch<span class="op">=</span><span class="fl">19</span>,main<span class="op">=</span><span class="va">tmp</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="co"># Put expression in the main plot</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/text.html" class="external-link">text</a></span><span class="op">(</span><span class="fl">10</span>,<span class="fl">5</span>,<span class="va">tmp</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-19.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="co"># Put multiple expressions on a plot</span></span></span>
<span class="r-in"><span><span class="va">op</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/graphics/par.html" class="external-link">par</a></span><span class="op">(</span>mar<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">0.1</span>,<span class="fl">0.1</span>,<span class="fl">0.1</span>,<span class="fl">0.1</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fl">0</span>,type<span class="op">=</span><span class="st">"n"</span>,xlab<span class="op">=</span><span class="st">""</span>,ylab<span class="op">=</span><span class="st">""</span>,xlim<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">0</span>,<span class="fl">1</span><span class="op">)</span>,ylim<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">0</span>,<span class="fl">3</span><span class="op">)</span>,xaxt<span class="op">=</span><span class="st">"n"</span>,yaxt<span class="op">=</span><span class="st">"n"</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/text.html" class="external-link">text</a></span><span class="op">(</span><span class="fl">0</span>,<span class="fl">2.5</span>,<span class="st">"Original:"</span>,pos<span class="op">=</span><span class="fl">4</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/text.html" class="external-link">text</a></span><span class="op">(</span><span class="fl">0.5</span>,<span class="fl">2.5</span>,<span class="fu">growthFunShow</span><span class="op">(</span><span class="st">"vonBertalanffy"</span>,<span class="st">"Original"</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/text.html" class="external-link">text</a></span><span class="op">(</span><span class="fl">0</span>,<span class="fl">1.5</span>,<span class="st">"Typical:"</span>,pos<span class="op">=</span><span class="fl">4</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/text.html" class="external-link">text</a></span><span class="op">(</span><span class="fl">0.5</span>,<span class="fl">1.5</span>,<span class="fu">growthFunShow</span><span class="op">(</span><span class="st">"vonBertalanffy"</span>,<span class="st">"Typical"</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/text.html" class="external-link">text</a></span><span class="op">(</span><span class="fl">0</span>,<span class="fl">0.5</span>,<span class="st">"Francis:"</span>,pos<span class="op">=</span><span class="fl">4</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/text.html" class="external-link">text</a></span><span class="op">(</span><span class="fl">0.5</span>,<span class="fl">0.5</span>,<span class="fu">growthFunShow</span><span class="op">(</span><span class="st">"vonBertalanffy"</span>,<span class="st">"Francis"</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="growthModels-20.png" alt="" width="700" height="433"></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/par.html" class="external-link">par</a></span><span class="op">(</span><span class="va">op</span><span class="op">)</span></span></span>
</code></pre></div>
    </div>
  </main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
    </nav></aside></div>


    <footer><div class="pkgdown-footer-left">
  <p></p><p>Developed by <a href="http://derekogle.com" class="external-link">Derek H. Ogle</a>, Jason C. Doll, A. Powell Wheeler, Alexis Dinno.</p>
</div>

<div class="pkgdown-footer-right">
  <p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.7.</p>
</div>

    </footer></div>

  

  

  </body></html>

