sample.test: Lagrange Multiplier Test for psi

Description Usage Arguments Details Value References Examples

View source: R/Parameter_estimation_and_hypothesis_testing.R

Description

Performs the Lagrange Multiplier test for the equality of the dispersion parameter ψ of a sample. The null hypothesis of the test is H_0: ψ = ψ_0, where ψ_0 is given as input here.

Usage

1
sample.test(abund, psi = "a")

Arguments

abund

An abundance vector of a sample.

psi

Target positive number ψ_0 to be tested. Accepted values are "a" for absolute value 1, "r" for relative value n (sample size), or any positive number.

Details

Calculates the Lagrange Multiplier test statistic

S\, = \,U(ψ_0)^2 / I(ψ_0),

where U is the log-likelihood function of ψ and I is its Fisher information. The statistic S follows χ^2-distribution with 1 degree of freedom when the null hypothesis H_0:ψ=ψ_0 is true.

Value

The statistic S and a p-value of the two-sided test of the hypothesis.

References

Radhakrishna Rao, C, (1948), Large sample tests of statistical hypotheses concerning several parameters with applications to problems of estimation. Mathematical Proceedings of the Cambridge Philosophical Society, 44(1), 50-57. <doi: 10.1017/S0305004100023987>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Test the psi of a sample from the Poisson-Dirichlet distribution:
set.seed(10000)
x<-rPD(1000, 10)
## Find the abundance of the data vector:
abund=abundance(x)
## Test for the psi that was used, as well as a higher and a lower one:
sample.test(abund, 10)
sample.test(abund, 15)
sample.test(abund, 5)
sample.test(abund)       #test for psi=1
sample.test(abund, "r")  #test for psi=n

PEkit documentation built on Nov. 22, 2021, 9:08 a.m.

Related to sample.test in PEkit...