resam.lrts: Internal function

Description Usage Arguments Value See Also Examples

View source: R/functions.R

Description

This function resamples the data, fits the semi-supervised mixture model, and returns the likelihood ratio test statistic. It is called by mixtura.

Usage

1
resam.lrts(y, z, dist, phi, pi, gamma, test, pass, ...)

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

pass

parameters for parametric bootstrap algorithm

...

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

Value

This function returns a numeric.

See Also

This is an internal function. The user functions are mixtura and scrutor.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# 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

# simulated test statistic
resam.lrts(y=y,z=z,dist="norm",
           phi=NULL,pi=NULL,gamma=NULL,
           test="perm",pass=NULL)

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