Skip to contents

Generates ensemble members for soil carbon at specified depth layer. Uses site-specific uncertainty when available; otherwise integrates over coefficient of variation distributions fit to population data. Samples are drawn from gamma distributions to ensure positive, right-skewed values appropriate for soil carbon estimates.

Usage

generate_soilgrids_ensemble(
  processed_data,
  site_id,
  size,
  depth_layer,
  verbose = FALSE
)

Arguments

processed_data

Output from preprocess_soilgrids_data()

site_id

Target site ID

size

Number of ensemble members to generate

depth_layer

Depth layer ("0-30cm" or "0-200cm")

verbose

Logical, print detailed progress information

Value

Numeric vector of soil carbon values including uncertainty, length equal to size.