mixtura: Model fitting

Description Usage Arguments Details Value Reference See Also Examples

View source: R/functions.R

Description

This function fits a semi-supervised mixture model. It simultaneously estimates two mixture components, and assigns the unlabelled observations to these.

Usage

1
2
3
4
mixtura(y, z, dist = "norm",
        phi = NULL, pi = NULL, gamma = NULL,
        test = NULL, iter = 100, kind = 0.05,
        debug = TRUE, ...)

Arguments

y

observations: numeric vector of length n

z

class labels: integer vector of length n, with entries 0, 1 and NA

dist

distributional assumption: character "norm" (Gaussian), "nbinom" (negative bionomial), or "zinb" (zero-inflated negative binomial)

phi

dispersion parameters: numeric vector of length q, or NULL

pi

zero-inflation parameter(s): numeric vector of length q, or NULL

gamma

offset: numeric vector of length n, or NULL

test

resampling procedure: character "perm" (permutation) or "boot" (parametric bootstrap), or NULL

iter

(maximum) number of resampling iterations : positive integer, or NULL

kind

resampling accuracy: numeric between 0 and 1, or NULL; all p-values above kind are approximate

debug

verification of arguments: TRUE or FALSE

...

settings EM algorithm: starts, it.em and epsilon (see arguments)

Details

By default, phi and pi are estimated by the maximum likelihood method, and gamma is replaced by a vector of ones.

Value

This function fits and compares a one-component (H0) and a two-component (H1) mixture model.

posterior

probability of belonging to class 1: numeric vector of length n

converge

path of the log-likelihood: numeric vector with maximum length it.em

estim0

parameter estimates under H0: data frame

estim1

parameter estimates under H1: data frame

loglik0

log-likelihood under H0: numeric

loglik1

log-likelihood under H1: numeric

lrts

likelihood-ratio test statistic: positive numeric

p.value

H0 versus H1: numeric between 0 and 1, or NULL

Reference

A Rauschenberger, RX Menezes, MA van de Wiel, NM van Schoor, and MA Jonker (2020). "Semi-supervised mixture test for detecting markers associated with a quantitative trait", Manuscript in preparation.

See Also

Use scrutor for hypothesis testing. All other functions are internal.

Examples

1
2
3
4
5
6
7
8
# 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")

semisup documentation built on Nov. 8, 2020, 6:32 p.m.