View source: R/ks.test.compare.R
ks.test.compare | R Documentation |
This is a ks.test
method for objects of class compare
. It performs a two-sample Kolmogorov–Smirnov test to compare the observed and simulated statistics in an object of class compare
.
## S3 method for class 'compare'
ks.test(x, ..., stat = NULL)
x |
Object of class |
... |
Additional parameters passed to |
stat |
Character string specifying the statistic on which to run the test. |
When stat
is NULL
, the default value is the first statistic appearing in the observed_stats
element of object
.
A list of the form specified in ks.test
.
Jesse Miller
compare
, distfreereg
, ks.test
# In practice, set "reps" larger than 200.
set.seed(20240201)
n <- 100
func <- function(X, theta) theta[1] + theta[2]*X
Sig <- rWishart(1, df = n, Sigma = diag(n))[,,1]
theta <- c(2,5)
X <- matrix(rexp(n, rate = 1))
cdfr <- compare(true_mean = func, true_X = X, true_covariance = list(Sigma = Sig),
test_mean = func, X = X, covariance = list(Sigma = Sig), reps = 200,
prog = Inf, theta = theta, theta_init = rep(1, length(theta)))
ks.test(cdfr)
ks.test(cdfr, stat = "CvM")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.