brkpt: Fit breakpoint model to individual colony

View source: R/colony-growth.R

brkptR Documentation

Fit breakpoint model to individual colony

Description

Fits models using a range of taus and picks the best one using maximum likelihood. Typically only used internally by bumbl().

Usage

brkpt(
  data,
  t,
  formula,
  family = gaussian(link = "log"),
  tau_optim_maxit = 100,
  ...
)

Arguments

data

a dataframe or tibble

t

the unquoted column name for the time variable in data

formula

a formula passed to glm() or MASS::glm.nb(). This should include the time variable supplied to t

family

a description of the error distribution and link function. This is passed to glm() except in the case of family = "negbin", which causes MASS::glm.nb() to be used to fit a negative binomial GLM.

tau_optim_maxit

passed to optim() which is used to find the optimal change point, tau. Mostly used for testing purposes (to force convergence errors), but could be increased if optimal switchpoint doesn't converge.

...

additional arguments passed to glm() or glm.nb()

Value

a tibble with a column for the winning tau and a column for the winning model

See Also

bumbl()


Aariq/bumbl documentation built on March 18, 2023, 2:09 a.m.