Description Usage Arguments Details Value Author(s) References See Also Examples
Performs the nonparametric goodness of fit test on a single observation. It returns a test statistic for the observation, a vector of simulated test statistics, and a corresponding p value for a two tailed test.
1 |
observed |
A vector valued numeric corresponding to the single observation over which goodness of fit is to be tested |
simulated |
A |
weights |
If null, a default even weighting across the test statistics is used. Otherwise, a definite square matrix of length equal to the coordinates in the observation may be supplied. See gof.optimize for a function to optimize power the over the weighting matrix if a particular alternative is in mind. |
See the working paper by Lospinoso and Snijders (2011) for more information.
list(p=p, v.obs=testStatistic.observed, v.sim=testStatistic.simulated)
p |
p-value corresponding to the probability that, in a hypothetical long run of draws from the null distribution, we would observe evidence stronger in favor of rejection than the evidence we have currently observed. |
v.obs |
The test statistic of the observation. |
v.sim |
The test statistics of the simulated draws from the null distribution. |
Josh Lospinoso
http://stats.ox.ac.uk/~lospinos
snopgof
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # See ?snopgof for a full description.
# Standard MVN null distribution
m=1000; v=5;
null.obs = rnorm(v)
# Simulate 25 draws from the null distribution
null.sim = matrix(rnorm(m*v),m,v)
# Preprocess the simulations
(null.preproc = gof.preprocess(null.sim))
# Conduct the test
(x<-gof(null.obs, null.preproc))
# Plot the results
plot(x, standardize=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.