flr / FLFleet

The FLFleet package for modelling of fishing fleet dynamics
http://flr-project.org/FLFleet
1 stars 2 forks source link

Handing of NAs #1

Closed marchtaylor closed 4 years ago

marchtaylor commented 4 years ago

I'm wondering what the preferred protocol is for handling missing data. For example, in an FLCatch object, when a landings.n value is missing for a given age/year element, it would seem reasonable to have an NaN value for the corresponding landings.wt element. However, when this is the case, computeLandings throws an NaN for the entire year, rather than to compute the SOP for non-NA elements. I see in the help that the FLS class allows for the use of the argument na.rm=TRUE, but this is not the case for many other FLR classes. The solution would be to input a value of zero in the landings.wt element, but I am worried about any unintended consequences. Any guidance on this would be greatly appreciated. Cheers, Marc

ejardim commented 4 years ago

Hi Marc, Not sure allowing SOP when missing observations exist is a good practice. If for some reason there's no numbers in a specific age class, by doing the SOP without it (with na.rm=TRUE) the analyst will be biasing the age structure, I think. If there's no individuals at that age then it should be 0, in which case the multiplication by the mean weight returns 0. Best EJ

marchtaylor commented 4 years ago

Hi Ernesto, Thanks for your input. Fair enough - I agree that there could be other unintended consequences for allowing na.rm=TRUE. Cheers, Marc