w2.test: Cram/'er-von Mises test

Description Usage Arguments Details Value References See Also Examples

Description

Cram/'er-von Mises test providing a comparison of a fitted distribution with the empirical distribution.

Usage

1
w2.test(x, distn, fit, H = NA, sim = 100, tol = 1e-04, estfun = NA)

Arguments

x

a numeric vector of data values

distn

character string naming the null distribution

fit

list of null distribution parameters

H

a treshold value

sim

maximum number of szenarios in the Monte-Carlo simulation

tol

if the difference of two subsequent p-value calculations is lower than tol the Monte-Carlo simulation is discontinued

estfun

an function as character string or NA (default). See mctest.

Details

The Cram/'er-von Mies test compares the null distribution with the empirical distribution function of the observed data, where left truncated data samples are allowed. The test statistic is given by

W2 = n/3 + n zH/(1-zH) + 1/(n (1-zH)) sum((1-2j) zj) + 1/(1-zH)^2 sum(zj-zH)^2

with z_H = F_theta(H) and z_j=F_theta(x_j), where x_1, …, x_n are the ordered data values. Here, F_theta is the null distribution.

Value

A list with class "mchtest" containing the following components

statistic

the value of the Cram\'er-von Mies statistic

treshold

the treshold value

p.value

the p-value of the test

data.name

a character string giving the name of the data

method

the character string "Cramer-von Mises test"

sim.no

number of simulated szenarios in the Monte-Carlo simulation

References

Chernobay, A., Rachev, S., Fabozzi, F. (2005), Composites goodness-of-fit tests for left-truncated loss samples, Tech. rep., University of Calivornia Santa Barbara

See Also

ad2up.test, ad2.test for other quadratic class tests and ks.test, v.test, adup.test, ad.test for supremum class tests. For more details see mctest.

Examples

1
2
3
4
5
set.seed(123)
treshold <- 10
xc  <- rlnorm(100, 2, 2)     # complete sample
xt <- xc[xc >= treshold]     # left truncated sample
w2.test(xt, "plnorm", list(meanlog = 2, sdlog = 2), H = 10)

truncgof documentation built on May 1, 2019, 10:54 p.m.

Related to w2.test in truncgof...