set.seed(7)
library("rmutil", warn.conflicts = FALSE)
# 1. Pareto(1)/Pareto(1.5)
# H0 is false
x <- rpareto(50, 2, 2)
y <- rpareto(50, 1.5, 1.5)
t <- ddst.forstochdom.test(x, y, t = 2.2, K.N = 4)
t
plot(t)
# 2. Laplace(0,1)/Laplace(1,25)
# H0 is false
x <- rlaplace(50, 0, 1)
y <- rlaplace(50, 1, 25)
t <- ddst.forstochdom.test(x, y, t = 2.2, K.N = 4)
t
plot(t)
# 3. LN(0.85,0.6)/LN(1.2,0.2)
# H0 is true
x <- rlnorm(50, 0.85, 0.6)
y <- rlnorm(50, 1.2, 0.2)
t <- ddst.forstochdom.test(x, y, t = 2.2, K.N = 4)
t
plot(t)
if (FALSE) {
# Generate distribution of test statistic
N <- 1000
samp <- replicate(N, {
x <- runif(30)
y <- runif(30)
# statistics with Schwartz penalty
ddst.forstochdom.test(x, y)$statistic
})
quantile(samp, 0.95)
plot(ecdf(samp))
}
Run the code above in your browser using DataLab