This function resamples the data,
fits the semi-supervised mixture model,
and returns the likelihood ratio test statistic.
It is called by mixtura
.
resam.lrts(y, z, dist, phi, pi, gamma, test, pass, ...)
y | observations:
numeric vector of length |
---|---|
z | class labels:
integer vector of length |
dist | distributional assumption:
character |
phi | dispersion parameters:
numeric vector of length |
pi | zero-inflation parameter(s):
numeric vector of length |
gamma | offset:
numeric vector of length |
test | resampling procedure:
character |
pass | parameters for parametric bootstrap algorithm |
... | settings |
This function returns a numeric.
# data simulation n <- 100 z <- rep(0:1,each=n/2) y <- rnorm(n=n,mean=2*z,sd=1) z[(n/4):n] <- NA # observed test statistic fit.wrap(y=y,z=z,dist="norm")$lrts#> [1] 29.97413# simulated test statistic resam.lrts(y=y,z=z,dist="norm", phi=NULL,pi=NULL,gamma=NULL, test="perm",pass=NULL)#> [1] 1.577982