MLEwrapper: Find maximum likelihood estimates for composition

Description Usage Arguments

View source: R/MLEwrapper.R

Description

The likelihood is maximized using optim and some typically close, but quick to calculate, starting values. If estimating composition of a separate variable, all samples with missing data for this variable must be removed prior to running this function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
MLEwrapper(
  trapData,
  tags,
  GSIcol,
  PBTcol,
  strataCol,
  adFinCol,
  AI = TRUE,
  optimMethod = "Nelder-Mead",
  variableCols = NULL,
  ...
)

Arguments

trapData

a dataframe with a rwo for each individual and columns for GSI assignment, PBT assignment, etc.

tags

a dataframe with the first column containing names of PBT groups, and the second column containing tag rates

GSIcol

name of column containing GSI assignments. If you have no GSI information, create a column with the same value for all samples.

PBTcol

name of column containing PBT assignments

strataCol

name of column indicating the strata the observation belongs to

adFinCol

name of column containing adipose fin status - TRUE (or AI) being intact FALSE (or AD) being clipped, NA missing

AI

TRUE to analyze ad-intact fish, FALSE to analyze ad-clipped fish

optimMethod

the method to use first with optim. If this method fails, "Nelder-Mead" is attempted and a warning is issued.

variableCols

name of column containing the variable to estimate composition for (optional)

...

other arguments to pass to optim


delomast/fishCompTools documentation built on Jan. 11, 2021, 1:51 a.m.