Learn R Programming

iprior (version 0.6.5)

progress: EM algorithm progression results for fitted ipriorMod objects

Description

A table showing, for each EM iteration, the log-likelihood values, predicted log-likelihood value, the change in log-likelihood value from the previous iteration, and the progression, or trace, of the parameters. This table can be called even if silent = TRUE or progress = "none" was called when fitting the ipriorMod object.

Usage

progress(object, interval = c("auto", "all", "input any number"))

Arguments

object

An object of class ipriorMod.

interval

(optional) One of "auto", "all", or any number. This is an option to control how many EM iterations are displayed. Defaults to "auto".

Details

This is useful for diagnosing the EM algorithm, and for example, to obtain the "traceplot" of the parameters. Note that the zeroth and final iterations will always be shown in the table.

Examples

Run this code
mod <- iprior(len ~ . ^ 2, ToothGrowth, control = list(silent = TRUE))
progress(mod)

# Works even when progress = "none" option called
mod <- iprior(len ~ . ^ 2, ToothGrowth, control = list(progress = "none"))
progress(mod, 50)
prog <- progress(mod, "all")
plot(prog$lambda1, type = "l")

Run the code above in your browser using DataLab