ddalthorp / GenEst

R package development for a generalized mortality estimator
Other
6 stars 6 forks source link

Include area correction variance through DWP bootstrapped samples. #632

Closed atredennick closed 5 years ago

atredennick commented 5 years ago

The changes allow the user to include area correction variance by altering the data_DWP input such that it contains bootstrapped samples for each unit and size combination (as and if specified by the user). In the diff comparisons it will look like a large section of DWPbyCarcass() was deleted but a large chunk was actually just copied and put inside a big if/then statement. No original code was deleted. The biggest change to plain vanilla GenEst is in the estg() function, which now returns the g estimates already multiplied by DWP. Thus, in estM() the final g estimates are calculated as gDf <- est$ghatDWP * frac. Note that this change does not affect default behavior.

I have tested these changes, but testing from a third party is necessary to hunt down any lingering edge-case bugs.