construct_sampling_gmm: Construct GMMs for sampling

Description Usage Arguments Value

View source: R/resim_fxns.R

Description

Constructs well-resolved smooths for the begin and end ISDs to use for resampling. Repeatedly draws ISDs by sampling from species' intraspecific body size distributions and combines these repeated samples in to one large sample. Then fits a GMM to this sample to get a very smooth version of the GMM-ified ISD. This allows us to resample ISDs with noninteger ratios of species abundances in a consistent way.

Usage

1
2
3
4
5
6
7
construct_sampling_gmm(
  ts_comp,
  n_isd_draws = 10,
  initial_isd_seed = 1989,
  begin_years = 1988:1992,
  end_years = 2014:2018
)

Arguments

ts_comp

matss-shaped dataset

n_isd_draws

how many versions of the ISD to use to construct the density function. There isn't too much variation between them, defaults to 5. Adding more increases time nonlinear due to the GMM, do not recommend much more than 10.

initial_isd_seed

don't recommend providing unless testing

begin_years

defaults 1988-1992

end_years

defaults 2014-2018

Value

list of two gmm densities as dataframes with columns mass, density, timeperiod


diazrenata/rwar documentation built on Dec. 19, 2021, 11:08 p.m.