USFS-PNW / Fia-Biosum-Manager

User interface and main code repository for Biosum
http://biosum.info/
Other
3 stars 3 forks source link

OPTIMIZER: Implement correction factor for weighted variables when 1-4 values are null #368

Open druepdx opened 3 days ago

druepdx commented 3 days ago

Null values are treated as 0 by BioSum/SQLite when summing weighted variables by rxpackage. This can cause the weighted variables to be biased low. A correction factor could be applied to adjust for the null value(s).

8 values are added to calculate the values in the prepost_fvs_weighted.db tables: cycle1pre, cycle1post, cycle2pre, cycle2post, cycle3pre, cycle3post, cycle4pre, and cycle4post. Each non null value should be multiplied by correction factor of 1/(1-sum(weights for null values).

jsfried commented 2 days ago

I would correct the statement to read:

8 weighted values are summed to generate the values in the prepost_fvs_weighted tables... That sum needs to b multiplied by a correction factor (1/(1-sum(user entered weights for Cycle/TimeInCycle cases where FVS_PREPOST table values that turn out to be null)). With the caveat that this adjustment be made only when null counts for the pre and post tables together for that stand/package combination are <= a new parameter called PrePostNullThreshold (range 1-7). When null count is > PrePostNullThreshold, then the weighted sum in the PREPOST_FVS_WEIGHTED table should be replaced with null and the analyst notified (with a dialog message or log file) so that they know to account for the possibility of missing values for that variable in the weighted tables when performing analysis in optimizer.