perm_dist: Permutation distribution

View source: R/perm_dist.R

perm_distR Documentation

Permutation distribution

Description

Obtains the permutation distribution of the maximum statistic and the STCS, named maxT and stcs, respectively. Returns a list containing maxT and stcs: each a vector of length nperm where each entry is the maximum of the nth permutation. Together form the permutation distribution, of which the (1-alpha)th percentile is the threshold of significance adjusted for multiple testing.

Usage

perm_dist(
  data,
  fx,
  nperm = 1000,
  alpha_local,
  alpha_global,
  null_distribution,
  block_size = NULL,
  seed,
  verbose = TRUE
)

Arguments

data

Data in a 3d array, where the first two dimensions are the physical dimensions (e.g., lon and lat), and the third one is time.

fx

function to be applied at each grid cell. Should be self sufficient - no extra arguments needed. Should return only the test statistic

nperm

number of permutations. Defaults to 1000

verbose

Counter returning when the function is done with 10 function calls

Value

returns the distribution of maxT and stcs, each a vector in a list


jcortesr/PerMuTe documentation built on July 31, 2023, 8:03 a.m.