SimulD {GOFSN}R Documentation

Algorithm to derive the marginal prior predictive distribution of the EDF stadistic D

Description

This function approximates the predictive prior distribution of statistic D for the SN model. This is achieved by integrating out gamma with respect to the Jeffreys' prior distribution.

Usage

 SimulD(n, nrep) 

Arguments

n size
nrep number of draws from the prior predictive distribution for gamma used to approximate h(t)

Details

h(t) is the marginal prior predictive distribution of D obtained by integrating gamma with respect to the Jeffreys'prior. To approximate h(t) for a particular n we used M=1000000 draws from the prior using the following 3 steps algorithm:

Step 1 Draw gamma(1,..,m,...M) approx pi(gamma), for M=1000000;
Step 2 for each gamma(m) generate a random sample of size n from the SN model with mu=0 sigma=1 and gamma=gamma(m);
Step 3 for the mth sample calculate the stadistic D on the random sample.

Although the Kolmogorov-Smirnov test in ks.sn makes use of the approximated quantiles for a set of sample sizes, with this function it is possible to approximate h(t) and to obtain its quantiles for any sample size n.

Value

y a vector of simulations that contains a sample of values that aproximate h(t) for a particular n

Author(s)

Veronica Paton Romero, Universidad Rey Juan Carlos, Spain v.paton@alumnos.urjc.es

References

Cabras and Castellanos (2008) Default Bayesian goodness-of-fit tests for the skew-normal model.

See Also

SimulW2,prior.lambda

Examples

data(prior.lambda)
simulationsD=SimulD(5,10)

[Package GOFSN version 1.0 Index]