commfish / seak_sablefish

NSEI sablefish stock assessment
8 stars 5 forks source link

Allometry #10

Open ben-williams opened 6 years ago

ben-williams commented 6 years ago

https://github.com/commfish/seak_sablefish/blob/ee9fb9ed5130ccfc9b004c6bec9dbc0e4dd5af1a/r_code/biological.R#L231

A more standard approach to estimate this on the log scale - note the correction for bias by bringing in sigmas. May be worth comparing the nls estimates from the following code

lw <- lm(log(weight) ~ log(length), data = data) #estimate on log transformed
lwfit <- exp(fitted(lw) * exp((sigma(lw)^2) / 2)) # adjust for bias
lwresid <- poll$weight - lwfit # calculate resids
plot(lwfit, lwresid) # always plot to see how things look
abline(h=0, lty=4)
summary(lw)  # are values the same/similar?
ben-williams commented 5 years ago

see https://www.pifsc.noaa.gov/library/pubs/admin/PIFSC_Admin_Rep_12-03.pdf

jysullivan commented 5 years ago

Thanks for following up on this! It's on my list of things to do the next time I look into these relationships.

jysullivan commented 5 years ago

The betas using nls() are consistently smaller (alphas are much closer):

image

I'm going to leave this be for now. I don't use these for anything right now other than as a starting value for the weight-based vonB. I'll leave the code for both methods in the biological.r script so we can revisit this at a later date.

ben-williams commented 5 years ago

the parameter estimates don't really matter. The variance about the estimates is the important aspect imo. How does the variability about the estimates compare?