bayesDensity            package:bayesSurv            R Documentation

_S_u_m_m_a_r_y _f_o_r _t_h_e _d_e_n_s_i_t_y _e_s_t_i_m_a_t_e _b_a_s_e_d _o_n _t_h_e _m_i_x_t_u_r_e _B_a_y_e_s_i_a_n _A_F_T _m_o_d_e_l.

_D_e_s_c_r_i_p_t_i_o_n:

     Function to summarize the results obtained using '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.

_U_s_a_g_e:

     bayesDensity(dir = getwd(), stgrid, centgrid, grid, n.grid = 100,
         skip = 0, by = 1, last.iter,
         standard = TRUE, center = TRUE, unstandard = TRUE)

_A_r_g_u_m_e_n_t_s:

     dir: directory where to search for files `mixmoment.sim',
          `mweight.sim', mmean.sim', `mvariance.sim' with the McMC
          sample.

  stgrid: grid of values at which the sampled standardized densities
          are to be evaluated. If 'missing', the grid is automatically
          computed.

centgrid: grid of values at which the sampled centered (but not scaled)
          densities are to be evaluated. If 'missing'. the grid is
          automatically computed.

    grid: grid of values at which the sampled densities are to be
          evaluated. If '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'.

  n.grid: the length of the grid if 'grid = NULL'.

    skip: number of rows that should be skipped at the beginning of
          each *.sim file with the stored sample.

      by: additional thinning of the sample.

last.iter: index of the last row from *.sim files that should be used.
          If not specified than it is set to the maximum available
          determined according to the file 'mixmoment.sim'.

standard: if 'TRUE' then also standardized (zero mean, unit variance)
          sampled densities are evaluated.

  center: if 'TRUE' then also centered (zero mean) sampled densities
          are evaluated.

unstandard: of 'TRUE' then also original (unstandardized) sampled
          densities are evaluated.

_V_a_l_u_e:

     An object of class '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 ks (unconditional) or averaged over a
     psecific number of mixture components.

     Additionally, the object of class 'bayesDensity' has three
     attributes: 

sample.size: a vector of length '1 + kmax' giving the frequency of each
          k in the sample.

 moments: a 'data.frame' with columns called `intercept' and `scale'
          giving the mean and variance of the sampled mixture at each
          iteration of the McMC.

       k: a 'data.frame' with one column called `k' giving number of
          mixture components at each iteration.


     There exist methods to print and plot objects of the class
     'bayesDensity'.

_A_u_t_h_o_r(_s):

     Arno&#353t Kom&#225rek komarek@karlin.mff.cuni.cz

_R_e_f_e_r_e_n_c_e_s:

     Kom&#225rek, A. (2006). _Accelerated Failure Time Models for
     Multivariate Interval-Censored Data with Flexible Distributional
     Assumptions_. PhD. Thesis, Katholieke Universiteit Leuven,
     Faculteit Wetenschappen.

     Kom&#225rek, 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.

_E_x_a_m_p_l_e_s:

     ## 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
     ## as cgd.pdf, cgd.R and
     ## tandmobMixture.pdf, tandmobMixture.R

