Hasselman_sim_colls: Generate a random population structure and mixture sample, as...

View source: R/simulation_pipelines.R

Hasselman_sim_collsR Documentation

Generate a random population structure and mixture sample, as in Hasselman et al. 2015

Description

Creates random reporting unit (rho) and collection (omega) proportions, and a sim_colls vector for simulation of individual genotypes, based on the methods used in Hasselman et al. (2015)

Usage

Hasselman_sim_colls(RU_starts, RU_vec, size = 100)

Arguments

RU_starts

a vector delineating the reporting units in RU_vec; generated by tcf2param_list

RU_vec

a vector of collection indices, grouped by reporting unit; generated by tcf2param_list

Details

This function is designed specifically to recreate the simulations in Hasselman et al. (2015), to check for the bias that was observed therein. Rho (reporting unit proportions) is chosen with alphas of 1.5, and omega (collection proportions) chosen with the same alpha, then scaled by the corresponding rho.

Value

Hasselman_sim_colls returns a list with three elements. The first two are a rho vector and an omega vector, respectively, both with alpha parameters = 1.5. The third is a vector of origins for simulated individuals, sampled from the collections with probabilities = omega


benmoran11/rubias documentation built on Feb. 1, 2024, 10:52 p.m.