Learn R Programming

bamm (version 0.5.0)

null_dispersion_field_distribution: null_dispersion_field_distribution: Null distribution of the dispersion field

Description

null_dispersion_field_distribution estimates a random distribution of the dispersion field values.

Usage

null_dispersion_field_distribution(
  pam,
  n_iter = 10,
  randal = "indep_swap",
  parallel = TRUE,
  n_cores = 2
)

Value

A data matrix of size nrow(pam) X n_iter with dispersion field values.

Arguments

pam

A Presence-Absence-Matrix of matrix class or sparse matrix.

n_iter

Number of iterations to obtain the distribution.

randal

Randomization algorithm applied to the PAM. Possible choices "curveball", "fastball", and "indep_swap".

parallel

If TRUE the computations will be performed in parallel.

n_cores

Number of cores for the parallel computation.

Author

Luis Osorio-Olvera & Jorge Soberón

Details

Estimates a random distribution of the dispersion field values. To obtain random values it uses the function permute_pam at each step of the iterations. Randomization of the PAM can be performed using the "fastball" (Godard and Neal, 2022) and the "curveball" (Strona et al., 2014), and and the independent swap (Kembel et al. 2010) algorithms. The implementation of the "fastball" in C++ is provided in https://github.com/zpneal/fastball/blob/main/fastball.cpp

References

Soberon2015bamm

Strona2014bamm

Gordard2022bamm

Kembel2010bamm

Examples

Run this code
set.seed(111)
pam <- matrix(rbinom(100,1,0.3),nrow = 10,ncol = 10)
dfield_rand <- bamm::null_dispersion_field_distribution(pam,n_iter=10,
                                                       parallel=FALSE,
                                                       randal="indep_swap",
                                                       n_cores = 2)
head(dfield_rand)

Run the code above in your browser using DataLab