rsm.sample {csampling} | R Documentation |
Conditional Sampler for Regression-Scale Models
Description
Generates replicates of the MLEs of the parameters occuring in a regression-scale model using as reference distribution the conditional distribution of the MLEs given the value of the ancillary.
Usage
rsm.sample(data = stop("no data given"), R = 10000,
ran.gen = stop("candidate distribution is missing, with no default"),
trace = TRUE, step = 100, ...)
Arguments
data |
A special conditional sampling data object. This object must be a list with the following elements:
The |
R |
the number of replicates. |
ran.gen |
a function which describes how the candidate values used in the
Metropolis-Hastings algorithm should be generated. It must be
a function of at least two arguments. The first one is the data
object |
trace |
a logical value; if |
step |
a numercial value defining after how many iterations to print the iteration number. Default is 100. |
... |
absorbs additional arguments to |
Details
The rsm.sample
function uses the Metropolis-Hastings
algorithm to generate an ergodic chain with equilibrium distribution
equal to the conditional distribution of the MLEs given
the ancillary. Because of the broad applicability of this
algorithm
the candidate generation density was not built in, but has to be
supplied by the user through the ran.gen
argument. The
output of this function must be a R
times k matrix,
where k = p + 1 or k = p + 2 depending
on whether the
scale parameter is fixed or not. The first p columns contain
the MLEs of the regression coefficients, the following the
MLEs of the scale parameter if unknown, and the last
column contains the probabilities of the candidate values drawn
from the candidate generation distribution. Note that these
probabilities need only be calculated up to a normalizing constant.
All information is supplied through the data
argument. The
user has to keep to the structure described above. If a conditional
simulation is to be performed for a fitted rsm
object, the
make.sample.data
function can be used to
generate this special object. It is advisable to specify the
logical switch fixed
in the conditional sampling object,
although it needs not (in which case the scale parameter is supposed
to be unknown).
The conditional simulation (cs
) object generated by
rsm.sample
contains all information necessary for further
investigation, such as the derivation of the conditional
distribution of test statistics, the calculation of conditional
coverage levels of confidence intervals and many more. As the
computation is somewhat tricky, an example is given in the
demonstration file ‘csamplingdemo.R’.
Value
The returned value is an object of class cs
containing the
following components:
sim |
a matrix with |
rho |
the acceptance probabilities at each Metropolis-Hastings step, that is, the probabilities with which the candidate values drawn from the candidate generation distribution are accepted. |
seed |
the value of |
data |
the |
R |
the value of |
call |
the original call to |
Side Effects
The function rsm.sample
causes creation of the dataset
.Random.seed
if it does not already exist,
otherwise its value is updated.
Demonstration
The file ‘csamplingdemo.R’ contains code that can be used to run a conditional simulation study similar to the one described in Brazzale (2000, Section 7.3) using the data given in Example 3 of DiCiccio, Field and Fraser (1990).
References
Brazzale, A. R. (2000) Practical Small-Sample Parametric Inference. Ph.D. Thesis N. 2230, Department of Mathematics, Swiss Federal Institute of Technology Lausanne.
DiCiccio, T. J., Field, C. A. and Fraser, D. A. S. (1990) Approximations of marginal tail probabilities and inference for scalar parameters. Biometrika, 77, 77–95.
See Also
make.sample.data
,
rsm.object
,
family.rsm.object
,
rsm