Learn R Programming

TFORGE (version 0.1.16)

boot_calib: Bootstrap calibration for single-sample and k-sample tests

Description

Performs a bootstrap hypothesis test using the supplied statistic. The stdx parameter is used to define an empirical distribution that satisfies the null hypothesis.

Usage

boot_calib(x, stdx, stat, B, ...)

Value

A list of

  • pval the p-value from the test

  • t0 the statistic for the observations x

  • nullt The statistic evaluated on the resamples

  • stdx The stdx passed into boot_calib()

  • B The number of resamples requested

  • nullt_messages Any error messages for the corresponding resample

The returned object has a bespoke class TFORGE for easy use of print().

Arguments

x

Symmetric matrix observations. Either a fsm or a kfsm.

stdx

Either a fsm or kfsm of matrices transformed to satisfy the null hypothesis OR sampling weights for each matrix in x for weighted bootstrap calibration (sampling weights should be optimised and also generate an empirical distribution that satisfies the null hypothesis).

stat

Function to compute the statistic.

B

The number of bootstrap samples to use.

...

Passed to stat

Details

The function stat is applied to x and all resamples, with the result returned in the t0 and nullt elements of the returned object, respectively.

Errors in evaluating stat on resamples are recorded in the nullt_messages and lead to NA values for the statistic in the nullt element of the returned object.

The p-value is the fraction of non-NA resample statistic values that are greater than stat applied to x.