fit.rcm: Fit using the EM algorithm

Description Usage Arguments Value Examples

View source: R/RCM.R

Description

Fit the RCM using the modified EM algorithm.

Usage

1
2
3
fit.rcm(S, ns, Psi.init, nu.init, method = c("EM", "pooled",
  "approxMLE"), conf.lvl = 0.95, max.ite = 1000, eps = 0.001,
  verbose = FALSE)

Arguments

S

A list of square scatter matrices of the same size.

ns

A vector of group or sample sizes corresponding to the scatter matrices in S.

Psi.init

A matrix giving the initial estimate of Psi. Default starting value is the scaled pooled sample covariance matrix.

nu.init

A numeric of length one giving the initial estimate of nu. Default is sum(ns).

method

A character giving the method to be used or abbreviation hereof.

conf.lvl

The confidence level. Default is 0.95.

max.ite

A numeric of length one giving the maximum number of iterations allowed. Default is 1000.

eps

The convergence criterion.

verbose

If true, the differences in log-likelihood for each iteration is printed out.

Value

A named list of length 3 with the elements:

Psi

A matrix giving the estimate of Psi.

nu

A number giving the estimate of nu.

iterations

A integer giving the number of iterations used.

loglik

A numeric giving the value of the log-likelihood in the last iteration.

Examples

1
2
3
4
5
6
7
8
nss <- c(40, 20, 30, 10)
print(Psii <- drop(rwishart(1)))  # Expected covariance
nuu <- 7
SS <- createRCMData(ns = nss, psi = Psii, nu = nuu)

fit.rcm(SS, nss, method = "EM", verbose = TRUE)
fit.rcm(SS, nss, method = "pool", verbose = TRUE)
fit.rcm(SS, nss, method = "approxMLE", verbose = FALSE)

AEBilgrau/correlateR documentation built on Dec. 27, 2018, 2:32 a.m.