fit.fmmstil.r: This function finds the maximum likelihood estiamtes for...

Description Usage Arguments Details Value Examples

View source: R/fit.fmmstil.r.R

Description

This function finds the maximum likelihood estiamtes for finite mixture of restricted mstil via EM.

Usage

1
2
3
4
5
6
7
8
9
fit.fmmstil.r(
  x,
  K,
  param = NULL,
  init.cluster,
  init.param.method,
  show.progress = TRUE,
  control = list()
)

Arguments

x

matrix of quantiles of size n x k. Each row is taken as a quantile.

K

number of clusters.

param

list of lists of inital parameters, containing omega, lambda, delta, Ainv, and nu.

init.cluster

(optional) initial clusters used to find initial parameters.

init.param.method

(optional) method to obtain initial parameters. It needs to be a function of x that returns a list of list of parameters.

show.progress

a logical value. If TRUE, progress of the algorithm will be printed in console. By default TRUE.

control

list of control variables, see 'details'.

Details

The control argument is a list that accepts the following components.

cvgNR

a positive integer. The algorithm stops when the estimated log-likelihood is not improved by at least cvgTolR on average in cvgNR iterations. By default 5.

cvgTolR

a positive value. The algorithm stops when the estimated log-likelihood is not improved by at least cvgTolR on average in cvgNR iterations. By default 1e-2.

lambdaPenalty

a positive value, represents the L2 penalty coefficient for lambda. By default 1e-6.

ainvPenalty

a positive value, represents the L2 penalty coefficient for Ainv. By default 1e-6.

maxitR

a positive integer, represents the maximum number of EM iterations allowed. By default 1000.

maxitOptimR

a positive integer, represents the maximum number of iterations in optim allowed within each M-step. By default 1e2.

batchSizeR

a positive integer, represents the batch sample size. By default n.

Value

a list with components:

logLik

a vector of the estimated log-likelihood after each itereation.

par

a list of lists of lists of fitted parameters after each iteration.

time

a vector recorded the time elapsed after each iteration.

Examples

1
2
3
# Not run:
# data(RiverFlow)
# fit.fmmstil.r(as.matrix(log(RiverFlow)), 2)

henrylobster/mstil documentation built on Sept. 25, 2020, 3:48 p.m.