# \donttest{
###### Using Bordes and Vandekerkhove estimation (valid if symmetric unknown component densities).
#### Under the null hypothesis H0.
## Simulate data:
list.comp <- list(f1 = "norm", g1 = "norm",
f2 = "norm", g2 = "norm")
list.param <- list(f1 = c(mean = 1, sd = 1), g1 = c(mean = 4, sd = 1),
f2 = c(mean = 1, sd = 1), g2 = c(mean = 5, sd = 0.5))
sim.X <- rsimmix(n = 250, unknownComp_weight=0.9, comp.dist = list(list.comp$f1,list.comp$g1),
comp.param = list(list.param$f1, list.param$g1))$mixt.data
sim.Y <- rsimmix(n = 300, unknownComp_weight=0.8, comp.dist = list(list.comp$f2,list.comp$g2),
comp.param = list(list.param$f2, list.param$g2))$mixt.data
plot_mixt_density(samples = list(sim.X, sim.Y), support = "continuous")
## Perform the hypothesis test in real-life conditions:
list.comp <- list(f1 = NULL, g1 = "norm",
f2 = NULL, g2 = "norm")
list.param <- list(f1 = NULL, g1 = c(mean = 4, sd = 1),
f2 = NULL, g2 = c(mean = 5, sd = 0.5))
test <- orthoBasis_test_H0(samples = list(sim.X, sim.Y),
known.p=NULL, comp.dist = list.comp, comp.param = list.param, known.coef=NULL, K=3,
nb.ssEch = 2, s = 0.25, var.explicit=TRUE, nb.echBoot=NULL, support = 'Real',
bounds.supp = NULL, est.method = 'BVdk', uniformized.knownComp_data = NULL)
test$rejection_rule
# }
Run the code above in your browser using DataLab