Description Usage Arguments Value Warning Author(s) References See Also Examples
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.
1 | challenge(Nsim = 10^4)
|
Nsim |
Number of slice sampling iterations |
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 |
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.
Christian P. Robert and George Casella
Chapter 6 of EnteR Monte Carlo Statistical Methods
challenger
1 2 3 |
Loading required package: MASS
Loading required package: coda
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.