ssadSim: Simulate permuted SSADs

Description Usage Arguments Details Value Author(s)

View source: R/ssadSim.R

Description

Simulate many SSADs and permute them to understand the effect of permutation on the shape of the SSAD

Usage

1
ssadSim(nsite, nspp, mcCores, sadfun, ssadfun, nsim)

Arguments

nsite

number of sites to simulate

nspp

number of species to simulate

mcCores

number of cores to use in parallel::mclapply

sadfun

function to generate random SAD sample

ssadfun

function to generate random SSAD sample

nsim

number of simulations to run

Details

Note, sadfun must be a function that takes a single argument n (number of species), e.g., function(n) pika::rfish(n, b = 0.1). Similarely, ssadfun must take both n (the number of sites) and also mu the mean abundance, e.g. function(n) rnbinom(n, size = 0.1, mu = mu).

Value

a data.frame with columns giving the z-score of the two negative binomial parameters, and the difference in AIC values of the negative binomial versus the Poisson

Author(s)

Andy Rominger <ajrominger@gmail.com>


ajrominger/RarePlusComMinus documentation built on June 27, 2021, 9:25 p.m.