plot.eglhmm {eglhmm}R Documentation

Plot the results of an eglhmm fit.

Description

For each specified model cell plot an array, with one panel for each state, of the probability mass or density functions corresponding to the given cell and state. The plots are produced with type="h" for probability mass functions, and with type="l" for probability density functions.

Usage

   ## S3 method for class 'eglhmm'
plot(x, ..., wcells = NULL, col = "red",
             nrnc = NULL, ntop = NULL, xlab = NULL, ylab = NULL,
             xlim = NULL, ylim = NULL, main = NULL, cex.main = 1.5)

Arguments

x

An object of class "eglhmm" as returned by the function eglhmm().

...

Not used.

wcells

Character vector specifying the cells of the model to be plotted. Defaults to all cells (i.e. the levels of x$data$cf).

col

The colour for the (vertical) lines of the plots.

nrnc

An integer vector of length two specifying the dimenions of the array of plots that is produced. The first entry is the number of rows, the second the number of columns. The product of the entries must be greater than or equal to K, the number of states in the model.

ntop

The largest x-value to be used in plots of the Poisson distribution. Defaults to the maximum of the upper 10^{-7} quantile of all of the Poisson distributions that are to be plotted. Ignored unless x$distr is "Poisson".

xlab

An optional label for the x-axes of the panels in the array of plots. Defaults to "x".

ylab

An optional label for the y-axes of the panels in the array of plots. Defaults to "probability" for probability mass functions and to "probability density" for probability density functions.

xlim

An optional vector of length two, specifying the x-limits for the plots. Defaults to c(0,ntop) if x$distr is "Poisson" and to c(0,x$size) if x$distr is "Binomial". There is no default if x$distr is "Gaussian".

ylim

An optional vector of length two, specifying the y-limits for the plots. Defaults to c(0,M) where M is the maximum of all of the probabilities or probability density values that are to be plotted.

main

Optional character vector specifying overall titles for each array panel of plots. Defaults to the names of the model cells. If the length of main is less than the number (nwc) of cells to be plotted, then main is replicated to have length nwc. If the length of main is greater than nwc then entries with index greater than nwc are ignored. If you wish there to be no overall titles for the arrays of plots, specify main="".

cex.main

Expansion factor for the text in the main title (determining the size of the text). Ignored if main is set equal to the empty string.

Details

If plotting is interactive, then the arrays of plots are displayed one at a time, and (except for the last of the plots) the user is prompted with the string "Go?" after each array is plotted. Press <return> to see the next plot.

Value

None.

Author(s)

Rolf Turner rolfturner@posteo.net

See Also

eglhmm()

Examples

    loc4 <- c("LngRf","BondiE","BondiOff","MlbrOff")
    SCC4 <- SydColCount[SydColCount$locn %in% loc4,]
    SCC4$locn <- factor(SCC4$locn) # Get rid of unused levels.
    rownames(SCC4) <- 1:nrow(SCC4)
    fit <- eglhmm(y~locn+depth,data=SCC4,cells=c("locn","depth"),
                 K=2,distr="P",verb=TRUE)
    plot(fit)
    allcells <- levels(fit$data$cf)
    wcells   <- allcells[grep("\\.60",allcells)]
    plot(fit,wcells=wcells,main=c("Longreef","Bondi East","Bondi Offshore",
                                  "Malabar Offshore"),ntop=12)

[Package eglhmm version 0.1-3 Index]