LikelihoodRatio4Mixtures {AdaptGauss}R Documentation

Likelihood Ratio for Gaussian Mixtures

Description

Computes the likelihood ratio for two Gaussian Mixture Models.

Usage

LikelihoodRatio4Mixtures(Data,NullMixture,OneMixture,PlotIt,LowerLimit,UpperLimit)

Arguments

Data

Data points.

NullMixture

A Matrix: cbind(Means0,SDs0,Weights0) or cbind(Means0,SDs0,Weights0,IsLog0). The null model; usually with less Gaussians than the OneMixture

OneMixture

A Matrix: cbind(Means1,SDs1,Weights1) or cbind(Means1,SDs1,Weights1,IsLog1). The alternative model usually with more Gaussians than the OneMixture.

PlotIt

Optional: Boolean, if TRUE a Plot of the compared cdf's and the KS-test distribution (Diff) is shown

LowerLimit

Optional: test only for Data >= LowerLimit, Default = min(Data) i.e all Data.

UpperLimit

Optional: test only for Data <= UpperLimit, Default = max(Data) i.e all Data.

Value

List with

Pvalue

the error that we make, if we accept OneMixture as the better Model over the NullMixture

NullLogLikelihood

log likelihood of GMM Null

OneLogLikelihood

log likelihood of GMM One

Author(s)

Alfred Ultsch, Michael Thrun, Catharina Lippmann

Examples


  
  data=c(rnorm(1000),rnorm(2000)+2,rnorm(1000)*2-1)
  ## Not run: Vals=AdaptGauss(data,c(-1,0,2),c(2,1,1),c(0.25,0.25,0.5),0.3,-6,6)
  NullMixture=cbind(Vals$Means,Vals$SDs,Vals$Weights)
  
## End(Not run)
  ## Not run: Vals2=AdaptGauss(data,c(-1,0,2,3),c(2,1,1,1),c(0.25,0.25,0.25,0.25),0.3,-6,6)
  OneMixture=cbind(Vals2$Means,Vals2$SDs,Vals2$Weights)
  
## End(Not run)
  ## Not run: 
  res=LikelihoodRatio4Mixtures(data,NullMixture,OneMixture,T)
  
## End(Not run)
 

[Package AdaptGauss version 1.6 Index]