null_dispersion_field_distribution: null_dispersion_field_distribution: Null distribution of the...

View source: R/null_dispersion_field_distribution.R

null_dispersion_field_distributionR Documentation

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
)

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.

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

Value

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

Author(s)

Luis Osorio-Olvera & Jorge Soberón

References

\insertRef

Soberon2015bamm

\insertRef

Strona2014bamm

\insertRef

Gordard2022bamm

\insertRef

Kembel2010bamm

Examples

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)

bamm documentation built on Sept. 11, 2024, 6:19 p.m.