gumbel_pvalue: Calculate the Gumbel p-value for a scan statistic.

View source: R/scanstatistics_general.R

gumbel_pvalueR Documentation

Calculate the Gumbel p-value for a scan statistic.

Description

Given an observed scan statistic λ^* and a vector of replicate scan statistics λ_i, i=1,…,R, fit a Gumbel distribution to the replicates and calculate a p-value for the observed statistic based on the fitted distribution.

\frac{1 + ∑_{i=1}^R \mathrm{I}(λ_i > λ^*)}{1 + R}

The function is vectorized, so multiple p-values can be calculated if several scan statistics (e.g. statistics from secondary clusters) are supplied.

Usage

gumbel_pvalue(observed, replicates, method = "ML", ...)

Arguments

observed

A scalar containing the observed value of the scan statistic, or a vector of observed values from secondary clusters.

replicates

A vector of Monte Carlo replicates of the scan statistic.

method

Either "ML", for maximum likelihood, or "MoM", for method of moments.

...

Additional arguments passed to ismev::gum.fit, which may include arguments passed along further to optim.

Value

The p-value or p-values corresponding to the observed scan statistic(s).


scanstatistics documentation built on Feb. 16, 2023, 10:32 p.m.