model_logistic_data: Apply a Discretized OLS model to logistic time series data

Description Usage Arguments Details Value

View source: R/model_logistic_data.R

Description

An Euler discretization of the logistic growth ODE problem is used to formulate the problem as an Ordinary Least Squares regression problem. So, OLS is used to estimate the value of the logistic growth parameters, r, and optionally K if the model has not been normalized.

Usage

1
2
3
4
5
6
7
8
model_logistic_data(
  df,
  smoothing = 0,
  dimensionless = TRUE,
  make_plot = FALSE,
  print_res = FALSE,
  ts = NULL
)

Arguments

df

A data frame; typically generated by generate_data_frame(). One column should be named "t" and numeric, and the second column should be named "P" and numeric.

smoothing

Nonnegative numeric; if >0 applies Tikhonov regularization to the OLS model where this value is lambda. For our purposes, this essentially forces the estimations to be smaller.

dimensionless

Logical; if TRUE, the model is assumed to have one parameter, r, which is estimated. If FALSE, the model is assumed to have two parameters, r and K, which are estimated.

make_plot

Logical; if TRUE, prints a plot of the linearized data.

print_res

Logical; if TRUE, the values of the estimated parameters are printed to the console.

ts

Numeric; the step between values of time. If not specified, this is calculated as the max time over the number of times.

Details

Applying Tikhonov regularization (AKA "Ridge regression") is also supported by specifying the value of the smoothing constant. Options are provided to print a plot of linearized data and print the results to the console.

Value

A named numeric vector of parameters which were estimated.


wz-billings/HMBGR documentation built on May 15, 2020, 5:44 a.m.