Learn R Programming

CHAT (version 1.1)

SampleNMM: Normal-Uniform mixture model fitting

Description

This function fits the distribution of a input vector with mixture of Normal and Uniform distributions and returns the BIC score for the model.

Usage

SampleNMM(Y)

Arguments

Y
input vector. In the context of subclonality inference, Y can either be sAGP or CCF values from one sample.

Value

a list containing the following elements:
BIC
BIC score from the model.
fit
a vector containing three numbers, in the order of fitted A, mu and sigma.

Details

The model is: Y~ A*U(0,1)+(1-A)*Normal(mu,sigma), where A, mu and sigma are parameters to be fitted.

Examples

Run this code
Y=c(rnorm(100,0.5,0.3),runif(100,0,1))
SampleNMM(Y)

Run the code above in your browser using DataLab