EM: EM algorithm estimates the joint density function of the...

Description Usage Arguments Value Examples

View source: R/StatCompR.R

Description

EM algorithm estimates the joint density function of the normal mixed model

Usage

1
EM(x, C, iter, mu0)

Arguments

x

data

C

a count, guess there’s a mixture of C Gaussian distributions

iter

count for iteration times

mu0

initialize mu, a matrix size of C*ncol(x), you must first plot x, and estimate mu0 based on the picture, otherwise it will go wrong

Value

a list contains mu and Sigma

Examples

1
2
3
4
5
6
## Not run: 
x<-as.matrix(datasets::faithful)
plot(x)
EM(x,2,20,matrix(c(2,50,4,80),2,2,byrow=T))

## End(Not run)

Lrrzz/StatComp21064 documentation built on Dec. 23, 2021, 10:21 p.m.