challenge: Slice sampler analysis of the challenger dataset

Description Usage Arguments Value Warning Author(s) References See Also Examples

View source: R/challenge.R

Description

This function illustrates a slice sampling implementation of the simulation from the posterior distribution associated with a logistic regression model

P(y=1|x)=exp(a+bx)/(1+exp(a+bx))

when applied to the challenger dataset.

Usage

1
challenge(Nsim = 10^4)

Arguments

Nsim

Number of slice sampling iterations

Value

The output is a list made of

a

Sequence of values of the intercept a produced by the slice sampler

b

Sequence of values of the regression coefficient b produced by the slice sampler

Warning

The function challenge uses a function rtrun that is replicated from a function used in the package bayesm. In the current case, the simulation of the truncated normal distribution is done by a simple cdf inversion and may thus be fragile in the tails.

Author(s)

Christian P. Robert and George Casella

References

Chapter 6 of EnteR Monte Carlo Statistical Methods

See Also

challenger

Examples

1
2
3
data(challenger)
chares=challenge(10^4)
plot(chares$a,chares$b,type="l",xlab="a",ylab="b",pch=19,cex=.4)

Example output

Loading required package: MASS
Loading required package: coda

mcsm documentation built on May 2, 2019, 10:16 a.m.

Related to challenge in mcsm...