nulldist.onesample: One sample null distribution generator

View source: R/nulldist_onesample.R

nulldist.onesampleR Documentation

One sample null distribution generator

Description

This function generates random samples and evaluates the test statistics for the identity hypothesis and reports a bootstrap random sample of average p-values. The generated values can be used to calculate the critical value for rejecting/accepting the null hypothesis

Usage

nulldist.onesample(
  n,
  p,
  m = 1,
  nnull = 100,
  nrep = 100,
  mean = NULL,
  parallel = TRUE,
  ncores = NULL
)

Arguments

n

sample size of your data

p

original dimension of your data

m

projected dimension of your data (Default value is 1)

nnull

number of repetitions of averages of pvalues

nrep

number of repetitions for each average of pvalues

mean

(Optional) Mean vector for the null distribution

parallel

Whether to parallelize or not (default is TRUE)

ncores

Number of cores to use (If NULL and parallel is TRUE, use 75% of all cores). If parallel = FALSE, this argument will be ignored.

Value

A list with three elements corresponding to different test statistics

LRT

likelihood ratio test statistic

LW

Ledoit-Wolf test statistic

John

John-Nagao test statistic

Examples

## Not run: 
  nulldist.onesample(n = 20, p = 100, m = 5)

## End(Not run)

dnayyala/cramp documentation built on June 27, 2023, 1:34 p.m.