Skip to contents

Resolves each PFT's output directory and reads its prior distributions and (where available) MCMC posterior chains into memory. This is the disk/BETY I/O step that used to live inside get.parameter.samples; it is kept separate so that the sampling functions (get_parameter_samples and the design generators) can share one loader rather than each carrying their own copy.

Usage

load_pft_posteriors(settings, posterior.files = rep(NA, length(settings$pfts)))

Arguments

settings

PEcAn settings object. Uses settings$pfts (name, outdir, posteriorid per PFT), settings$database$bety for the optional BETY lookup, and settings$host$name.

posterior.files

character vector of posterior filenames, one per PFT, NA where none is specified. Length must match settings$pfts.

Value

A list with four elements:

pft_names

character vector of PFT names ("NULL" where unnamed).

prior_distns_list

list of prior distribution data frames, one per PFT (NULL entry where none was found).

trait_mcmc_list

list of trait MCMC results, one per PFT (NULL entry where the PFT has no MCMC chains).

independent

logical, FALSE if any PFT carries a joint posterior, TRUE otherwise.

Details

Posterior type is detected by content, not filename, via load.posteriors: MCMC chains take precedence over distribution summaries. When a PFT's posterior is a joint fit (e.g. from PDA), the returned independent flag is set to FALSE so downstream sampling preserves the parameter correlations.

See also

get_parameter_samples for the sampling step that consumes this output.

Author

David LeBauer, Shawn Serbin, Istem Fer, Om Kapale