mixchipars: mixchipars

Description Usage Arguments Details Value Examples

View source: R/simulations.R

Description

Fit maximum-likelihood values of gamma and kappa to a set of PLR values

Usage

1
mixchipars(plr, init = c(1, 0.5))

Arguments

plr

set of plr values

init

values of gamma, kappa at which to start numerical fitting algorithm

Details

Assumes that PLR has a mixture distribution with some weight p0 at 0, a weight 'kappa' for a distribution gamma*chi_1^2, and a weight 1-kappa-p0 for a distribution gamma*chi_2^2.

Value

two element vector; gamma, kappa.

Examples

1
2
3
gamma=0.7;kappa=0.4;p0=0.05; N=10000
px=sort(gamma*c(rep(0,p0*N),rchisq(kappa*N,df=1),rchisq((1-kappa)*N,df=2)))
mixchipars(px)

jamesliley/subtest documentation built on May 18, 2019, 11:21 a.m.