resample.ls {Davies} | R Documentation |
Carries out parametric resampling on the null of the dataset being drawn from a Davies distribution
resample.ls(data, n = 99)
data |
dataset to be resampled |
n |
number of trials to be carried out |
Carries out parametric resampling. Essentially fits a Davies
distribution to data
, determines an error for this set of
parameters, then draws n `ghost' datasets drawn from a Davies
distribution
with this set of optimized parameters. Comparing the original error
with the distribution of `ghost' errors allows one to assess how close
to a Davies distribution the original dataset (data
) was.
Returns as list with three components:
errors |
A vector of length n corresponding to the `ghost' errors |
statistic |
Error of the original dataset from the optimal fit Davies distribution |
p-value |
The p-value of this. Will be runif() if
data is in fact drawn from a Davies distribution |
Robin K. S. Hankin
W. H. Press and others, Numerical recipes: the art of scientific computing, 1989, Cambridge University Press
hist(resample.ls(rnorm(50)^2)$errors) fit.davies.q(resample.ls(rnorm(80)^2)$errors)