MCEM: This is the maximization step of the mcem algorithm (M-step).

Description Usage Arguments Value Examples

Description

This is the maximization step of the mcem algorithm (M-step).

Usage

1
mcem(data, theta_init, maxit = 1000, tol1 = 0.01, tol2 = 0.001)

Arguments

data

Contingency table, matrix format of three columns, first column lower limits, second column upper limits, and third column observed frequencies.

theta_init

The initial values of the parameters, for mu and sigma. Vector with two values.

maxit

The maximum number of iteration of the EM algorithm.

tol1

A number, the stopping criteria for updating mu.

tol2

A number, the stopping criteria for updating sigma.

Value

This is the maximization step of the mcem algorithm (M-step) that has defined it using the function E-Step for mean estimate and variance estimate. Returns the estimates for mean (mu) and sigma (variance).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 library(em.univ)


 simdataaaa <- em.univ::univ_simul(ncol_matrix=1,
                         n=50,
                         nclass = 10,
                         mean = 68,
                         sd = 1.80,
                         fr_breaks=c(62,64,66,68,70,72,74,76,78))
 
 outputmcem2 <- base::list()
 
 outputmcem2[[1]] <- em.univ::mcem(data=simdataaaa$simul_data[,,1],
                           theta_init=c(67,2),
                           maxit = 1000,tol1=1e-2,tol2=1e-3)
 
 outputmcem2

JoaoPedro2536/univ.em documentation built on Dec. 18, 2021, 1:38 a.m.