MBM: Fit a two-point mixture of Beta distributions

Description Usage Arguments Value Examples

Description

Fit a two-point mixture of Beta distributions

Usage

1
2
MBM(x, w = as.numeric(c()), a0 = as.numeric(c()), a1 = as.numeric(c()),
  precision = 1e-06, MaxIter = 10000L)

Arguments

x

A vector of numeric values

w

A vector of two numeric values, representing the weights of two Beta distributions. Default values are 0.5, respectively.

a0

Initial values of the alpha and beta for Beta distribution f0. Default values are 1 and 1, respectively.

a1

Initial values of the alpha and beta for Beta distribution f1. Default values are 0.5 and 0.5, respectively.

precision

The tolerance for convergence. Default value is 1e-6.

MaxIter

The maximum iteration for the EM algorithm. Default value is 10000L.

Value

A list of four components, including the converged weight, parameters for Beta distribution f0, parameters for Beta distribution f1, and the convergence iteration, respectively.

Examples

1
2
3
4
5
6
x0=rbeta(900,0.8,0.8)
x1=rbeta(100,0.2,0.2)
## Not run: 
   MBM(c(x0,x1),w=c(0.8,0.2),a0=c(1,1),a1=c(0.5,0.5))

## End(Not run)

chongma1989/tiltmod documentation built on May 7, 2019, 8:38 a.m.