Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

idealToMCMC

convert an object of class ideal to a coda MCMC object


Description

Converts the x element of an ideal object to an MCMC object, as used in the coda package.

Usage

idealToMCMC(object, burnin=NULL)

Arguments

object

an object of class ideal.

burnin

of the recorded MCMC samples, how many to discard as burnin? Default is NULL, in which case the value of burnin in the ideal object is used.

Value

A mcmc object as used by the coda package, starting at iteration start, drawn from the x component of the ideal object.

Note

When specifying a value of burnin different from that used in fitting the ideal object, note a distinction between the iteration numbers of the stored iterations, and the number of stored iterations. That is, the n-th iteration stored in an ideal object will not be iteration n if the user specified thin>1 in the call to ideal. Here, iterations are tagged with their iteration number. Thus, if the user called ideal with thin=10 and burnin=100 then the stored iterations are numbered 100, 110, 120, .... Any future subsetting via a burnin refers to this iteration number.

See Also

Examples

data(s109)
f = system.file("extdata",package="pscl","id1.rda")
load(f)
id1coda <- idealToMCMC(id1)
summary(id1coda)

pscl

Political Science Computational Laboratory

v1.5.5
GPL-2
Authors
Simon Jackman, with contributions from Alex Tahk, Achim Zeileis, Christina Maimone, Jim Fearon and Zoe Meers
Initial release
2020-02-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.