CvM.poisson.pvalue.bootstrap: P-value of EDF statistics W^2 for Poisson Distribution by...

Description Usage Arguments Value Examples

View source: R/discrete.R

Description

Compute the Cramer-von Mises statistic W^2 and a corresponding P-value for testing the hypothesis that a sample comes from a Poisson distribution with mean to be estimated from the data The P-value is computed by conditional sampling using nmc samples from the conditional distribution of x given sum(x) for a Poisson distribution. This distribution is multinomial.

Usage

1
2
3
4
5
6
CvM.poisson.pvalue.bootstrap(
  x,
  nmc = 200,
  return.samples = FALSE,
  print = TRUE
)

Arguments

x

A random sample.

nmc

The size of Monte Carlo.

return.samples

Logical, if TRUE return the given sample.

print

Logical, if TRUE print the statistic and p-value.

Value

CvM.poisson.pvalue.bootstrap gives Cramer-von Mises statistic and its p-value.

Examples

1
2
3
x= rpois(100,2)
CvM.poisson(x)
CvM.poisson.pvalue.bootstrap(x,return.samples=T)

LiYao-sfu/EDFtest documentation built on Dec. 18, 2021, 4:35 a.m.