samplesHistory {BRugs} | R Documentation

## Trace of a variable

### Description

This function returns and plots a complete trace for a variable.

### Usage

    samplesHistory(node, beg = samplesGetBeg(), end = samplesGetEnd(),
        firstChain = samplesGetFirstChain(),
        lastChain = samplesGetLastChain(), thin = samplesGetThin(),
        plot = TRUE, mfrow = c(3, 1), ask = NULL, ann = TRUE, ...)

### Arguments

`node` | Character vector of length 1, name of a variable in the model.
`beg, end` | Arguments to select a slice of monitored values corresponding to iterations `beg:end`.
`firstChain, lastChain` | Arguments to select a sub group of chains to plot the trace for.
`thin` | to only use every `thin`-th value of the stored sample for statistics.
`plot` | Logical, whether to plot the trace or only return the values. If `TRUE`, values are returned invisibly.
`mfrow, ask, ann` | Graphical parameters, see `par` for details. `ask` defaults to `TRUE` unless it is plotting into an already opened non-interactive device.
`...` | Further graphical parameters as in `par` may also be passed as arguments to `plotHistory`.

### Details

If the variable of interest is an array, slices of the array can be selected using the notation `variable[lower0:upper0, lower1:upper1, ...]`. A star ‘`*`’ can be entered as shorthand for all the stored samples.

If the arguments are left at their defaults the whole sample for all chains will be used for calculation.

### Value

A list containing matrices - one for each scalar variable contained in argument `node`. Each row of a matrix corresponds to one chain.

### See Also

`plotHistory`, `BRugs`, `help.WinBUGS`

[Package BRugs version 0.3-2 Index]