Skip to content

Revisit special handling of seedling_mortality in run.meta.analysis #3736

@infotroph

Description

@infotroph

Current lines 103-104 of run.meta.analysis.R:

prior_variances[names(trait_average), ] <- 0.001 * trait_average ^ 2
  prior_variances["seedling_mortality", 1] <- 1

@infotroph in a comment on #3278:

Would it be possible to add a few comments here explaining (1) where the constants 0.001 and 1 come from, and (2) why seedling mortality gets special handling and whether that's a hack or a principled design choice?

On scrolling down further I see this is pre-existing code moved up from run.meta.analysis.pft, so maybe these explanations are lost to time...

@ashiklom replied:

Yeah, this is pre-existing code. The oldest git blame gets me is here:

https://github.com/PecanProject/pecan/blame/bed27a2b37619c2297c3c66becf97b8c16233494/modules/meta.analysis/R/run.meta.analysis.R

...but I'm almost certain this logic predates that, which looks more like refactoring than development.

The more correct thing to do here is probably (1) remove the seedling_mortality hard-coded value altogether and replace it with a global default prior of some kind in the database; (2) pass the 0.001 as an (optional) argument called something like default_prior_variance_fraction with 0.001 as the default value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions