plotConvergence: Convergence of algorithm

View source: R/PLOT_plotConvergence.R

plotConvergenceR Documentation

Convergence of algorithm

Description

Plot the evolution of the completed loglikelihood during the SEM algorithm. The vertical line denotes the end of the burn-in phase.

Usage

plotConvergence(output, ...)

Arguments

output

object returned by mixtCompLearn function from RMixtComp or rmcMultiRun function from RMixtCompIO

...

graphical parameters

Details

This function can be used to check the convergence and choose the parameters nbBurnInIter and nbIter from mcStrategy.

Author(s)

Quentin Grimonprez

See Also

Other plot: heatmapClass(), heatmapTikSorted(), heatmapVar(), histMisclassif(), plot.MixtComp(), plotDataBoxplot(), plotDataCI(), plotDiscrimClass(), plotDiscrimVar(), plotParamConvergence(), plotProportion()

Examples

if (requireNamespace("RMixtCompIO", quietly = TRUE)) {
  dataLearn <- list(
    var1 = as.character(c(rnorm(50, -2, 0.8), rnorm(50, 2, 0.8))),
    var2 = as.character(c(rnorm(50, 2), rpois(50, 8)))
  )

  model <- list(
    var1 = list(type = "Gaussian", paramStr = ""),
    var2 = list(type = "Poisson", paramStr = "")
  )

  algo <- list(
    nClass = 2,
    nInd = 100,
    nbBurnInIter = 100,
    nbIter = 100,
    nbGibbsBurnInIter = 100,
    nbGibbsIter = 100,
    nInitPerClass = 3,
    nSemTry = 20,
    confidenceLevel = 0.95,
    ratioStableCriterion = 0.95,
    nStableCriterion = 10,
    mode = "learn"
  )

  resLearn <-RMixtCompIO::rmcMultiRun(algo, dataLearn, model, nRun = 3)

  # plot
  plotConvergence(resLearn)
}


RMixtCompUtilities documentation built on Sept. 22, 2023, 5:10 p.m.