Learn R Programming

em (version 1.0.0)

plot.em: Plot the fitted results of EM algorithm

Description

This is the generic plot function for `em` project. One can produce three types of graphs using this function 1. A graph of the predicted value distribution for each component. 2. A histogram of posterior probability distributions

Usage

# S3 method for em
plot(
  x,
  by = c("component", "prob"),
  prior = FALSE,
  cols = rep(1, length(x$models)),
  lwds = rep(3, length(x$models)),
  ltys = c(seq_len(length(x$models))),
  ranges = NULL,
  main = NULL,
  lgd = list(),
  lgd.loc = "topleft",
  hist.args = list(main = "Histograms of posterior probabilities", xlab =
    "Posterior Probabilities"),
  ...
)

Value

`NULL`

Arguments

x

the `em` model to plot

by

the type of the graph to produce. The default is `component`.

prior

whether fit the model using prior probabilities.

cols

lines' colors.

lwds

Lines' widths.

ltys

lines' types.

ranges

the ranges of the x-axis and the y-axis limits of plots. It should be a vector of four numeric values. The first two represent the x-axis limits. The last two represent the y-axis limits

main

the main title.

lgd

a list for legend related arguments.

lgd.loc

the location of the legend. The default is "topleft".

hist.args

The list of arguments for the histogram.

...

other arguments.