bayessurvreg1
function.
Compute the conditional (given the number of mixture components) and
unconditional estimate of the density function based on the values
sampled using the reversible jumps MCMC (MCMC average evaluated in a
grid of values).Give also the values of each sampled density evaluated at that grid (returned as the attribute of the resulting object). Methods for printing and plotting are also provided.
bayesDensity(dir = getwd(), stgrid, centgrid, grid, n.grid = 100, skip = 0, by = 1, last.iter, standard = TRUE, center = TRUE, unstandard = TRUE)
missing
, the grid is
automatically computed.missing
. the grid
is automatically computed.missing
,
the grid is guessed from the first 20 sampled mixtures as the sequence starting with the minimal
sampled mixture mean minus 3 standard deviations of the appropriate mixture
component, ending with the maximal sampled mixture mean plus 3
standard deviations of the appropriate mixture
component, of the length given by n.grid
.grid = NULL
.mixmoment.sim
.TRUE
then also standardized (zero mean,
unit variance) sampled densities are evaluated.TRUE
then also centered (zero mean) sampled
densities are evaluated.TRUE
then also original (unstandardized)
sampled densities are evaluated.bayesDensity
is returned. This object is a
list and has potentially three components: standard
,
center
and
unstandard
. Each of these three components is a data.frame
with as many rows as number of grid points at which the density was
evaluated and with columns called `grid', `unconditional' and `k = 1',
..., `k = k.max' giving a predictive errr density, either averaged
over all sampled $k$s (unconditional) or averaged over a
psecific number of mixture components.Additionally, the object of class bayesDensity
has three
attributes:
1 + kmax
giving the
frequency of each $k$ in the sample.data.frame
with columns called `intercept'
and `scale' giving the mean and variance of the sampled mixture at
each iteration of the McMC.data.frame
with one column called `k' giving
number of mixture components at each iteration.bayesDensity
.
Komárek, A. and Lesaffre, E. (2007). Bayesian accelerated failure time model for correlated interval-censored data with a normal mixture as an error distribution. Statistica Sinica, 17, 549--569.
## See the description of R commands for
## the models described in
## Komarek (2006),
## Komarek and Lesaffre (2007),
##
## R commands available
## in the documentation
## directory of this package
## - ex-cgd.R and
## http://www.karlin.mff.cuni.cz/~komarek/software/bayesSurv/ex-cgd.pdf
##
## - ex-tandmobMixture.R and
## http://www.karlin.mff.cuni.cz/~komarek/software/bayesSurv/ex-tandmobMixture.pdf
##
Run the code above in your browser using DataLab