fit_sr: Fit stock recruit model using maximum likelihood estimation

Description Usage Arguments Value Examples

View source: R/fit_sr.R

Description

This function fits a Ricker or Beverton-Holt stock recruitment model using maximum likelihood estimation in TMB.

Usage

1
fit_sr(data, b_col, r_col, type, cov_col = NULL, cov_effect = NULL)

Arguments

data

A data frame

b_col

Name of the column with biomass

r_col

Name of the column with recruitment

type

Stock recruit type: "ricker" or "bev-holt"

cov_col

Name of the column with the covariate

Value

A list containing: (1) the data; (2) the model fit; and (3) the standard error report.

Examples

1
2
3
4
5
data <- splink::ram_wc
output <- splink::fit_sr(data=data, b_col="b_scaled", r_col="r_scaled", type="ricker")
results <- splink::get_results(output)
splink::plot_results(results)
splink::plot_fits_sr(output, b_col="b_scaled", r_col="r_scaled", plotdir="~/Desktop", plotname="test.pdf")

cfree14/splink documentation built on Dec. 19, 2021, 2:57 p.m.