AdrianHordyk/LBSPR

Difference between LBSPR package in R and LBSPR Shiny App results

Closed this issue · 6 comments

Hi, AdrianHordyk.
I uploaded my data and found out that the estimated parameters (SL50, SL95, F / M, SPR) are slightly different when they are calculated in the LBSPR package and LBSPR Shiny App. There are differences in both cases (the individual point estimates and the smoothed ones). The difference between the parameters are the same: for SL50 - 0.2, SL95 - 0.2, F / M - (-0.02 or - 0.03), SPR - 0.01.
Could you explain the reason for the difference in parameter values?

Difficult to say without a reproducible example. Likely either different models (Shiny app uses the growth-type-group model) or a rounding issue.

Thank you very much for your reply.
I took into account your remark about the growth-type-group model and manually entered the argument modtype="GTG" into function LBSPRfit():
myFit <- LBSPRfit(MyPars, Len,Control = list(modtype="GTG"))
i got the same result - slightly differences between LBSPR package and LBSPR Shiny App. That does not look like a rounding. Here is a screen
results
I attached my data and parameters you are able to reproduce a calculating.
{ MyPars@Species <- "Abramis brama" MyPars@Linf <- 47 MyPars@L50 <- 23.2 MyPars@L95 <- 28.7 MyPars@MK <- 2.85 MyPars@L_units <- "cm" MyPars@BinWidth <-1 }
Here is an attached data
LRaw_multiyears_abramis.zip

This is due to a small difference between the way the length bins are defined in the Shiny app compared to when the Len object is created in a script.

Will aim to fix at some point, though this project is no longer funded so little time for development work.

Thank you very much.
As I understand it is better to use the LBSPR package than the LBSPR Shiny App. The LBSPR package performs more correct calculations.
I would like to consult with you about the MyPars@BinWidth parameter. Changing this parameter changes the SL50 SL95 FM SPR results. This is especially important for SPR. As for my data, for example, when i input the value MyPars @ BinWidth <-1, the SPR value is less than the reference point of 0.4. If i input MyPars @ BinWidth <-3 i got the SPR value more than 0.4. If I use MyPars @ BinWidth greater than 3, then the @fitlog slot says the model does not converge.
So what the MyPars@BinWidth value should i use?
By what way must I choose the MyPars@BinWidth value?

They are the same model, so neither approach is more correct. The discrete binning of the length data is an uncertainty that should be considered when reporting the model results - ie run the model over a range of binwidth (and other parameters that are uncertain) and report the distribution of the results

Thank you very much for your explanation. You helped me a lot.