simulate_IBD_corMLPE: Simulate data from an isolation-by-distance model with MLPE...

simulate_IBD_corMLPER Documentation

Simulate data from an isolation-by-distance model with MLPE correlation structure

Description

Simulate data from an isolation-by-distance model with MLPE correlation structure

Usage

simulate_IBD_corMLPE(
  sets = 1,
  elements = rep(10, sets),
  intercept = 0,
  slope = 0.5,
  random_effects = diag(2),
  correlation = 0.25,
  residual_sd = 1,
  distances = NULL,
  seed = 1
)

Arguments

sets

number of distinct sets (e.g. species) containing elements that are compared

elements

vector, number of elements (e.g. populations, individuals) in each set

intercept

intercept of regression line

slope

slope of regression line

random_effects

variance-covariance matrix for random intercepts/slopes per set; ignored if sets==1

correlation

parameter of MLPE correlation structure; between 0 and 0.5

residual_sd

standard deviation of (correlated) errors

distances

optional; list of distance matrices (one for each set), or a single distance matrix if sets==1; if absent, locations are simulated from a 2d uniform distribution

seed

random seed used to simulate data


nspope/corMLPE documentation built on April 8, 2022, 3:48 a.m.