This function fits a semi-supervised mixture model. It simultaneously estimates two mixture components, and assigns the unlabelled observations to these.
mixtura(y, z, dist = "norm", phi = NULL, pi = NULL, gamma = NULL, test = NULL, iter = 100, kind = 0.05, debug = TRUE, ...)
y | observations:
numeric vector of length |
---|---|
z | class labels:
integer vector of length |
dist | distributional assumption:
character |
phi | dispersion parameter:
positive numeric,
or |
pi | zero-inflation parameter:
numeric between 0 and 1,
or |
gamma | offset:
numeric vector of length |
test | resampling procedure:
character |
iter | (maximum) number of resampling iterations :
positive integer, or |
kind | resampling accuracy:
numeric between |
debug | verification of arguments:
|
... | settings |
This function fits and compares a one-component (H0
)
and a two-component (H1
) mixture model.
probability of belonging to class 1:
numeric vector of length n
path of the log-likelihood:
numeric vector with maximum length
it.em
parameter estimates under H0
:
data frame
parameter estimates under H1
:
data frame
log-likelihood under H0
:
numeric
log-likelihood under H1
:
numeric
likelihood-ratio test statistic: positive numeric
H0
versus H1
:
numeric between 0
and 1
, or NULL
By default, phi
and pi
are estimated by the maximum likelihood method,
and gamma
is replaced by a vector of ones.
A Rauschenberger, RX Menezes, MA van de Wiel, NM van Schoor, and MA Jonker (2017). "Detecting SNPs with interactive effects on a quantitative trait", Manuscript in preparation.
# data simulation n <- 100 z <- rep(0:1,each=n/2) y <- rnorm(n=n,mean=2,sd=1) z[(n/4):n] <- NA # model fitting mixtura(y,z,dist="norm",test="perm")#> $posterior #> [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [8] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [15] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [22] 0.0000000 0.0000000 0.0000000 0.5738125 0.5285509 0.4472526 0.6403160 #> [29] 0.5985376 0.5127863 0.7149695 0.7765562 0.6654932 0.5114071 0.5262749 #> [36] 0.6945105 0.5573818 0.6388233 0.7925439 0.5140092 0.7407126 0.6102265 #> [43] 0.3666887 0.5391078 0.6080527 0.5082169 0.3374890 0.4570243 0.4573663 #> [50] 0.5712310 0.5911485 0.3705077 0.5635904 0.6853712 0.5290796 0.4815891 #> [57] 0.5380838 0.5920739 0.5068206 0.7441921 0.8561808 0.4981466 0.6058956 #> [64] 0.5568994 0.6231222 0.5201978 0.5341483 0.5249157 0.7097310 0.6326151 #> [71] 0.6045546 0.6231723 0.6128792 0.5887924 0.4475043 0.4874812 0.4525960 #> [78] 0.6214880 0.6311741 0.4831815 0.7504900 0.4813570 0.4646321 0.4613732 #> [85] 0.5607701 0.6672973 0.5143100 0.3916813 0.4500226 0.6086516 0.7434411 #> [92] 0.7686676 0.5272960 0.4228084 0.5744616 0.7464298 0.5065254 0.4968198 #> [99] 0.6583188 0.4741185 #> #> $converge #> [1] -134.7541 -134.6997 -134.6693 -134.6522 -134.6425 -134.6369 -134.6337 #> [8] -134.6317 -134.6306 -134.6299 -134.6294 -134.6292 -134.6290 -134.6289 #> [15] -134.6289 #> #> $estim0 #> p0 mean0 sd0 p1 mean1 sd1 #> 1 1 1.937324 0.9359373 0 NaN NaN #> #> $estim1 #> p0 mean0 sd0 p1 mean1 sd1 #> 1 0.4293631 2.11701 0.8965158 0.5706369 1.702684 0.9363712 #> #> $loglik0 #> [1] -135.2829 #> #> $loglik1 #> [1] -134.6289 #> #> $lrts #> [1] 1.308071 #> #> $p.value #> [1] 0.8571429 #>