Internal optimization function

LBSPR_NLLabsel(starts, x, P, LMids, LBins, LDat, MK, Linf, FecB, L50, L95,
  maxsd, CVLinf, Nage, usePen)

Arguments

starts

a vector of starting parameters, relative SL50 (SL50/Linf), deltaSL (SL95-SL50)/Linf, and F/M (in log space)

x

vector of relative ages

P

numeric value indicating proportion of cohort remaining at maximum age

LMids

a vector of the midpoints of the length classes

LBins

a vector of length classes

LDat

a vector of lenght frequencies. Must be same length as LMids

MK

the M/K value

Linf

the Linf value for the population as a hole

FecB

exponent of the length-fecundity relationship

L50

length at 50 per cent maturity

L95

length at 95 per cent maturity

maxsd

numeric value - maximum number of standard deviations of length-at-age dist

CVLinf

CV of length-at-age

Nage

number of pseudo age-classes

usePen

logical to use penalty for extreme estimates of selectivity

Value

negative log-likelihood value