Skip to contents

Exponentiate the continuous-time growth generator so that transition matrices satisfy G(t1 + t2) = G(t2) %*% G(t1) up to numerical tolerance. The first and final length states act as lower and upper accumulator groups; downward movement, including biological shrinkage, remains possible.

Usage

get_growth_matrix_ctmc(
  midpoint,
  linf,
  k,
  gshape,
  gcv,
  gmin = 1e-04,
  tau = 1,
  tolerance = 1e-12,
  growth_variance = 1L,
  gsigma = NULL,
  length_power = -1,
  variance_reference_length = 60,
  generator_scheme = 1L
)

Arguments

midpoint

Equally spaced length-bin representative values (mm).

linf

Generalized asymptotic length Linf (mm), which must exceed every value in midpoint for the current positive-drift implementation.

k

Generalized growth rate K (per year).

gshape

Generalized growth shape gamma.

gcv

Process coefficient controlling the instantaneous diffusion SD.

gmin

Minimum instantaneous process SD (mm per square-root year).

tau

Transition interval in years.

tolerance

Numerical tolerance passed to RTMB::expAv().

growth_variance

Process-SD parameterization; see get_growth_increment_linf().

gsigma

Process diffusion SD at variance_reference_length.

length_power

Length-scaling power for the diffusion SD.

variance_reference_length

Reference length for gsigma (mm).

generator_scheme

Generator discretisation: 1 uses the original upwind drift plus diffusion rates; 2 uses non-negative moment-matched rates. The latter reproduces the requested infinitesimal variance when variance_rate >= drift * bin_width, and otherwise uses the smallest variance possible on the supplied grid.

Value

A column-stochastic growth transition matrix.