bayesHistogram           package:bayesSurv           R Documentation

_S_m_o_o_t_h_i_n_g _o_f _a _u_n_i- _o_r _b_i_v_a_r_i_a_t_e _h_i_s_t_o_g_r_a_m _u_s_i_n_g _B_a_y_e_s_i_a_n
_G-_s_p_l_i_n_e_s

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

     A function to estimate a density of a uni- or bivariate (possibly
     censored) sample. The density is specified as a mixture of
     Bayesian G-splines (normal densities with equidistant means and
     equal variances). This function performs an MCMC sampling from the
     posterior distribution of unknown quantities in the density
     specification. Other method functions are available to visualize
     resulting density estimate.

     This function served as a basis for further developed
     'bayesBisurvreg', 'bayessurvreg2' and 'bayessurvreg3' functions.
     However, in contrast to these functions, 'bayesHistogram' does not
     allow for doubly censoring.

     *Bivariate case:*

     Let Y[i,l], i=1,..., N, l=1,2 be observations for the ith cluster
     and the first and the second unit (dimension). The bivariate
     observations Y[i] = (Y[i,1], Y[i,2])', i=1,..., N are assumed to
     be i.i.d. with a~bivariate density g[y](y[1], y[2]). This density
     is expressed as a~mixture of Bayesian G-splines (normal densities
     with equidistant means and constant variance matrices). We
     distinguish two, theoretically equivalent, specifications.

     _S_p_e_c_i_f_i_c_a_t_i_o_n _1 .DS B (Y[1],,Y[2])' is distributed as
          sum[j[1]=-K[1]][K[1]] sum[j[2]=-K[2]][K[2]] w[j[1],j[2]]
          N(mu[(j[1],j[2])], diag(sigma[1]^2, sigma[2]^2)) .DE

          where sigma[1]^2, sigma[2]^2 are *unknown* basis variances
          and mu[(j[1],j[2])] = (mu[1,j[1]], mu[2,j[2]])' is
          an~equidistant grid of knots symmetric around the *unknown*
          point (gamma[1], gamma[2])'  and related to the unknown basis
          variances through the relationship

 mu[1,j[1]] = gamma[1] + j[1]*delta[1]*sigma[1], j[1]=-K[1],..., K[1]

 mu[2,j[2]] = gamma[2] + j[2]*delta[2]*sigma[2], j[2]=-K[2],..., K[2]

          where delta[1], delta[2] are fixed constants, e.g.
          delta[1]=delta[2]=2/3 (which has a~justification of being
          close to cubic B-splines).      

     _S_p_e_c_i_f_i_c_a_t_i_o_n _2 .DS B (Y[1],,Y[2])' is distributed as (alpha[1],
          alpha[2])' + S (V[1], V[2])' .DE

          where (alpha[1], alpha[2])' is an *unknown* intercept term
          and S is a diagonal matrix with tau[1] and tau[2] on a
          diagonal, i.e. tau[1], tau[2] are *unknown* scale parameters.
          (V[1], V[2])' is then standardized observational vector which
          is distributed according to the bivariate normal mixture,
          i.e.

 (V[1], V[2])' is distributed as sum[j[1]=-K[1]][K[1]] sum[j[2]=-K[2]][K[2]] w[j[1],j[2]] N(mu[(j[1],j[2])], diag(sigma[1]^2, sigma[2]^2))

          where mu[(j[1],j[2])] = (mu[1,j[1]], mu[2,j[2]])' is
          an~equidistant grid of *fixed* knots (means), usually
          symmetric about the *fixed* point (gamma[1], gamma[2])' = (0,
          0)' and sigma[1]^2, sigma[2]^2 are *fixed* basis variances.
          Reasonable values for the numbers of grid points K[1] and
          K[2] are K[1]=K[2]=15 with the distance between the two knots
          equal to delta=0.3 and for the basis variances
          sigma[1]^2=sigma[2]^2=0.2^2.

     *Univariate case:*

     It is a~direct simplification of the bivariate case.

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

     bayesHistogram(y1, y2,
        nsimul = list(niter = 10, nthin = 1, nburn = 0, nwrite = 10),
        prior, init = list(iter = 0),
        mcmc.par = list(type.update.a = "slice", k.overrelax.a = 1,
                        k.overrelax.sigma = 1, k.overrelax.scale = 1),
        store = list(a = FALSE, y = FALSE, r = FALSE),
        dir = getwd())

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

      y1: response for the first dimension in the form of a survival
          object created using 'Surv'.

      y2: response for the second dimension in the form of a survival
          object created using 'Surv'. If the response is
          one-dimensional this item is missing.

  nsimul: a list giving the number of iterations of the MCMC and other
          parameters of the simulation.

          _n_i_t_e_r total number of sampled values after discarding thinned
               ones, burn-up included;

          _n_t_h_i_n thinning interval;

          _n_b_u_r_n number of sampled values in a burn-up period after
               discarding thinned values. This value should be smaller
               than 'niter'. If not, 'nburn' is set to 'niter - 1'. It
               can be set to zero;

          _n_w_r_i_t_e an interval at which information about the number of
               performed iterations is print on the screen and during
               the burn-up period an interval with which the sampled
               values are writen to files;

   prior: a list that identifies prior hyperparameters and prior
          choices. See the paper Kom&#225rek and Lesaffre (2007) and
          the PhD. thesis Kom&#225rek (2006) for more details.

          Some prior parameters can be guessed by the function itself.
          If you want to do so, set such parameters to 'NULL'. Set to
          'NULL' also the parameters that are not needed in your model.

          _s_p_e_c_i_f_i_c_a_t_i_o_n a~number giving which specification of the
               model is used. It can be one of the following numbers:

               _1 with this specification positions of the middle knots
                    gamma[1],...,gamma[q], where q is dimension of the
                    G-spline and basis standard deviations
                    sigma[0,1],...,sigma[0,q] are estimated. At the
                    same time the G-spline intercepts
                    alpha[1],...,alpha[q] and the G-spline scale
                    parameters s[1],...,s[q] are assumed to be fixed
                    (usually, intercepts to zero and scales to 1). The
                    user can specified the fixed quantities in the
                    'init' parameter of this function 

               _2 with this specification, G-spline intercepts
                    alpha[1],...,alpha[q] and the G-spline scale
                    parameters s[1],...,s[q] are estimated at the same
                    time positions of the middle knots
                    gamma[1],...,gamma[q] and basis standard deviations
                    sigma[0,1],...,sigma[0,q] are assumed to be fixed
                    (usually, middle knots to zero ans basis standard
                    deviations to some smaller number like 0.2) The
                    user can specified the fixed quantities in the
                    'init' parameter of this function           


          _K specification of the number of knots in each dimension,
               i.e. 'K'  is a vector of length equal to the dimension
               of the data q and K[j], j=1,...,q determines that  the
               subscript k[j] of the knots runs over
               -K[j],...,0,...,K[j]. A value K[j]=0 is valid as well.
               There are only some restriction on the minimal value of
               K[j] with respect to the choice of the neighbor system
               and possibly the order of the conditional autoregression
               in the prior of transformed weights (see below).

          _i_z_e_r_o subscript k[1]...k[q]  of the knot whose transformed
               weight  a[k1...kq] will constantly be equal to zero.
               This is here for identifiability. To avoid numerical
               problems it is highly recommended to set 'izero=rep(0,
               q)'. 'izero[j]' should be taken from the set
               -K[j],...,K[j].

          _n_e_i_g_h_b_o_r._s_y_s_t_e_m identification of the neighboring system for
               the Markov random field prior of transformed mixture
               weights a[k1, k2]. This can be substring of one of the
               following strings:

               '_u_n_i_C_A_R' ``univariate conditional autoregression'':
                    a~prior based on squared differences of given order
                    m (see argument 'order') in each row and column. 

                    For univariate smoothing:

    p(a) propto exp(-lambda/2 * sum[k=-K+m][K] (Delta^m a[k])^2),

                    where Delta^m denotes the difference operator of
                    order m, i.e. Delta^1 a[k] = a[k] - a[k-1] and
                    Delta^m a[k] = Delta^(m-1)a[k] - Delta^(m-1)a[k-1],
                    m >= 2.

                    For bivariate smoothing:

 p(a) propto exp( -lambda[1]/2 * sum[k[1]=-K[1]][K[1]]sum[k[2]=-K[2]+m][K[2]] (Delta[1]^m a[k[1], k[2]])^2 -lambda[2]/2 * sum[k[2]=-K[2]][K[2]]sum[k[1]=-K[1]+m][K[1]] (Delta[2]^m a[k[1], k[2]])^2),

                    where Delta[l]^m denotes the difference operator of
                    order m acting in the lth margin, e.g.

  Delta[1]^2 = a[k[1], k[2]] - 2*a[k[1], k[2]-1] + a[k[1], k[2]-2].

                    The precision parameters lambda[1] and lambda[2]
                    might be forced to be equal (see argument
                    'equal.lambda'.)

               '_e_i_g_h_t._n_e_i_g_h_b_o_r_s' this prior is based on eight nearest
                    neighbors (i.e. except on edges, each full
                    conditional depends only on eight nearest
                    neighbors) and local quadratic smoothing. It
                    applies only in the case of bivariate smoothing.
                    The prior is then defined as

 p(a) propto exp(-lambda/2 * sum[k[1]=-K[1]][K[1]-1]sum[k[2]=-K[2]][K[2]-1] (Delta a[k[1],k[2]])^2),

                    where

 Delta a[k[1],k[2]] = a[k[1],k[2]] - a[k[1]+1, k[2]] - a[k[1], k[2]+1] + a[k[1]+1, k[2]+1].


               '_t_w_e_l_v_e._n_e_i_g_h_b_o_r_s' !!! THIS FEATURE HAS NOT BEEN
                    IMPLEMENTED YET. !!!


          _o_r_d_e_r order of the conditional autoregression if
               'neighbor.system = uniCAR'. Implemented are 1, 2, 3. If
               'order = 0' and  'neighbor.system = uniCAR' then mixture
               weights are assumed to be fixed and equal to their
               initial values specified by the 'init' parameter (see
               below). Note that the numbers K[j], j=1,...,q must be
               all equal to or higher than 'order'.

          _e_q_u_a_l._l_a_m_b_d_a 'TRUE/FALSE' applicable in the case when a
               density of bivariate observations is estimated and
               'neighbor.system = uniCAR'. It specifies whether there
               is only one common Markov random field precision
               parameter lambda for all margins (dimensions) or whether
               each margin (dimension) has its own precision parameter
               lambda. For all other neighbor systems is 'equal.lambda'
               automatically 'TRUE'.

          _p_r_i_o_r._l_a_m_b_d_a specification of the prior distributions for the
               Markov random field precision parameter(s) lambda (when
               'equal.lambda = TRUE') or lambda[1],...,lambda[q] (when
               'equal.lambda = TRUE'). This is a vector of substring of
               one of the following strings (one substring for each
               margin if 'equal.lambda = FALSE', otherwise just one
               substring):

               '_f_i_x_e_d' the lambda parameter is then assumed to be fixed
                    and equal to its initial values given by 'init'
                    (see below).

               '_g_a_m_m_a' a particular lambda parameter has a priori gamma
                    distribution with shape g[j] and rate (inverse
                    scale) h[j] where j=1 if 'equal.lambda=TRUE' and
                    j=1,...,q if 'equal.lambda=TRUE'. Shape and rate
                    parameters are specified by 'shape.lambda',
                    'rate.lambda' (see below).

               '_s_d_u_n_i_f_o_r_m' a particular 1/sqrt(lambda) parameter (i.e.a
                    standard deviation of the Markov random field) has
                    a priori a uniform distribution on the interval (0,
                    S[j]) where j=1 if 'equal.lambda=TRUE' and
                    j=1,...,q if 'equal.lambda=TRUE'. Upper limit of
                    intervals is specified by 'rate.lambda' (see
                    below).


          _p_r_i_o_r._g_a_m_m_a specification of the prior distribution for a
               reference knot (intercept) gamma in each dimension. This
               is a vector of substrings of one of the following
               strings (one substring for each margin):

               '_f_i_x_e_d' the gamma parameter is then assumed to be fixed
                    and equal to its initial values given by 'init'
                    (see below).

               '_n_o_r_m_a_l' the gamma parameter has a priori a normal
                    distribution with mean and variance given by
                    'mean.gamma' and 'var.gamma'.


          _p_r_i_o_r._s_i_g_m_a specification of the prior distribution for basis
               standard deviations of the G-spline in each dimension.
               This is a vector of substrings of one of the following
               strings (one substring for each margin):

               '_f_i_x_e_d' the sigma parameter is then assumed to be fixed
                    and equal to its initial values given by 'init'
                    (see below).

               '_g_a_m_m_a' a particular sigma^{-2} parameter has a priori
                    gamma distribution with shape zeta[j] and rate
                    (inverse scale) eta[j] where j=1,...,q. Shape and
                    rate parameters are specified by 'shape.sigma',
                    'rate.sigma' (see below).

               '_s_d_u_n_i_f_o_r_m' a particular sigma parameter has a priori a
                    uniform distribution on the interval (0, S[j])
                    where eqn{j=1,...,q}{j=1,...,q}. Upper limit of
                    intervals is specified by 'rate.sigma' (see below).


          _p_r_i_o_r._i_n_t_e_r_c_e_p_t specification of the prior distribution for
               the intercept terms alpha[1],...,alpha[q] (2nd
               specification) in each dimension. This is a vector of
               substrings of one of the following strings (one
               substring for each margin):

               '_f_i_x_e_d' the intercept parameter is then assumed to be
                    fixed and equal to its initial values given by
                    'init' (see below).

               '_n_o_r_m_a_l' the intercept parameter has a priori a normal
                    distribution with mean and variance given by
                    'mean.intercept' and 'var.intercept'.


          _p_r_i_o_r._s_c_a_l_e specification of the prior distribution for the
               scale parameter (2nd specification) of the G-spline in
               each dimension This is a vector of substrings of one of
               the following strings (one substring for each margin):

               '_f_i_x_e_d' the 'scale' parameter is then assumed to be
                    fixed and equal to its initial values given by
                    'init' (see below).

               '_g_a_m_m_a' a particular scale^{-2} parameter has a priori
                    gamma distribution with shape zeta[j] and rate
                    (inverse scale) eta[j] where j=1,...,q. Shape and
                    rate parameters are specified by 'shape.scale',
                    'rate.scale' (see below).

               '_s_d_u_n_i_f_o_r_m' a particular scale parameter has a priori a
                    uniform distribution on the interval (0, S[j])
                    where eqn{j=1,...,q}{j=1,...,q}. Upper limit of
                    intervals is specified by 'rate.scale' (see below).


          _c_4_d_e_l_t_a values of c[1],...,c[q] which serve to compute the
               distance delta[j] between two consecutive knots in each
               dimension. The knot mu[j,k], j=1,...,q, 
               k=-K[j],...,K[j] is defined as mu[j,k] = gamma[j] +
               k*delta[j] with delta[j] = c[j]*sigma[j].

          _m_e_a_n._g_a_m_m_a these are means for the normal prior distribution
               of middle knots gamma[1],...,gamma[q] in each dimension
               if this prior is normal. For fixed gamma an appropriate
               element of the vector 'mean.gamma' may be whatever.

          _v_a_r._g_a_m_m_a these are variances for the normal prior
               distribution of middle knots gamma[1],...,gamma[q] in
               each dimension if this prior is normal. For fixed gamma
               an appropriate element of the vector 'var.gamma' may be
               whatever.

          _s_h_a_p_e._l_a_m_b_d_a these are shape parameters for the gamma prior
               (if used) of Markov random field precision parameters
               lambda[1],...,lambda[q] (if 'equal.lambda = FALSE') or
               lambda[1] (if 'equal.lambda = TRUE').

          _r_a_t_e._l_a_m_b_d_a these are rate parameters for the gamma prior (if
               'prior.lambda = gamma') of Markov random field precision
               parameters lambda[1],...,lambda[q] (if 'equal.lambda =
               FALSE') or lambda[1] (if 'equal.lambda = TRUE') or upper
               limits of the uniform prior (if 'prior.lambda =
               sduniform') of Markov random field standard deviation 
               parameters lambda[1]^{-1/2},...,lambda[q]^{-1/2} (if
               'equal.lambda = FALSE') or lambda[1]^{-1/2} (if
               'equal.lambda = TRUE').

          _s_h_a_p_e._s_i_g_m_a these are shape parameters for the gamma prior
               (if used) of basis inverse variances
               sigma[1]^{-2},...,sigma[q]^{-2}.

          _r_a_t_e._s_i_g_m_a these are rate parameters for the gamma prior (if
               'prior.sigma = gamma') of basis inverse variances
               sigma[1]^{-2},...,sigma[q]^{-2}  or upper limits of the
               uniform prior (if 'prior.sigma = sduniform') of basis
               standard deviations sigma[1],...,sigma[q].

          _m_e_a_n._i_n_t_e_r_c_e_p_t these are means for the normal prior
               distribution of the G-spline intercepts (2nd
               specification) alpha[1],...,alpha[q] in each dimension
               if this prior is normal. For fixed alpha an appropriate
               element of the vector 'mean.intercept' may be whatever.

          _v_a_r._i_n_t_e_r_c_e_p_t these are variances for the normal prior
               distribution of the G-spline intercepts
               alpha[1],...,alpha[q] in each dimension if this prior is
               normal. For fixed alpha an appropriate element of the
               vector 'var.alpha' may be whatever. 

          _s_h_a_p_e._s_c_a_l_e these are shape parameters for the gamma prior
               (if used) of the G-spline scale parameter (2nd
               specification) scale[1]^{-2},...,scale[q]^{-2}.

          _r_a_t_e._s_c_a_l_e these are rate parameters for the gamma prior (if
               'prior.scale = gamma') of the G-spline inverse variances
               scale[1]^{-2},...,scale[q]^{-2}  or upper limits of the
               uniform prior (if 'prior.scale = sduniform') of the
               G-spline scale scale[1],...,scale[q]. 

    init: a list of the initial values to start the McMC. Set to 'NULL'
          such parameters that you want the program should itself
          sample for you or parameters that are not needed in your
          model.

          _i_t_e_r the number of the iteration to which the initial values
               correspond, usually zero.      

          _a vector/matrix of initial transformed mixture weights a[k1],
               k1=-K1,...,K1 if univariate density is estimated;
               a[k1,k2], k1=-K1,...,K1, k2=-K2,...,K2, if bivariate
               density is estimated. This initial value can be guessed
               by the function itself.

          _l_a_m_b_d_a initial values for Markov random field precision
               parameter(s) lambda (if 'equal.lambda = TRUE'),
               lambda[1],...,lambda[q]  (if 'equal.lambda = FALSE'.)

          _g_a_m_m_a initial values for the middle knots in each dimension.

               If 'prior$specification = 2' it is recommended (for
               easier interpretation of the results) to set
               'init$gamma' to zero for all dimensions.

               If 'prior$specification = 1' 'init$gamma' should be
               approximately equal to the mean value of the data in
               each margin.

          _s_i_g_m_a initial values for basis standard deviations in each
               dimension.

               If 'prior$specification = 2' this should be
               approximately equal to the range of standardized data
               (let say 4 + 4) divided by the number of knots in each
               margin and multiplied by something like 2/3.

               If 'prior$specification = 1' this should be
               approximately equal to the range of your data divided by
               the number of knots in each margin and multiplied again
               by something like 2/3.

          _i_n_t_e_r_c_e_p_t initial values for the intercept term in each
               dimension.

               Note that if 'prior$specification = 1' this initial
               value is always changed to zero for all dimensions.     

          _s_c_a_l_e initial values for the G-spline scale parameter in each
               dimension.

               Note that if 'prior$specification = 1' this initial
               value is always changed to one for all dimensions. 

          _y initial values for (possibly unobserved censored)
               observations. This should be either a vector of length
               equal to the sample size if the response is univariate
               or a matrix with as many rows as is the sample size and
               two columns if the response is bivariate. Be aware that
               'init$y' must be consistent with data supplied. This
               initial can be guessed by the function itself. Possible
               missing values in 'init$y' tells the function to guess
               the initial value.

          _r initial values for labels of components to which the
               (augmented) observations belong. This initial can be
               guessed by the function itself. This should be either a
               vector of length equal to the sample size if the
               response is univariate or a matrix with as many rows as
               is the sample size and two columns if the response is
               bivariate. Values in the first column of this matrix
               should be between '-prior$K[1]' and 'prior$K[1]', values
               in the second column of this matrix between
               '-prior$K[2]' and 'prior$K[2]', e.g. when 'init$r[i,1:2]
               = c(-3, 6)' it means that the ith observation is
               initially assigned to the component with the mean mu =
               (mu[1], mu[2])' where

             mu[1] = mu[1,-3] = gamma[1] -3*c[1]*sigma[1]

               and

             mu[2] = mu[1,6] = gamma[2] +6*c[2]*sigma[2].


mcmc.par: a list specifying further details of the McMC simulation.
          There are default values implemented for all components of
          this list.

          _t_y_p_e._u_p_d_a_t_e._a it specifies the McMC method to update
               transformed mixture weights a. It is a~substring of one
               of the following strings:

               _s_l_i_c_e slice sampler of Neal (2003) is used (default
                    choice);

               _a_r_s._q_u_a_n_t_i_l_e adaptive rejection sampling of Gilks and
                    Wild (1992) is used with starting abscissae equal
                    to 15%, 50% and 85% quantiles of a~piecewise
                    exponential approximation to the full conditional
                    from the previous iteration;

               _a_r_s._m_o_d_e adaptive rejection sampling of Gilks and Wild
                    (1992) is used with starting abscissae equal to the
                    mode and plus/minus twice approximate standard
                    deviation of the full conditional distribution


          _k._o_v_e_r_r_e_l_a_x._a this specifies a frequency of overrelaxed
               updates of transformed mixture weights a when slice
               sampler is used. Every kth value is sampled in a usual
               way (without overrelaxation). If you do not want
               overrelaxation at all, set 'k.overrelax.a' to 1 (default
               choice). Note that overrelaxation can be only done with
               the slice sampler (and not with adaptive rejection
               sampling).

          _k._o_v_e_r_r_e_l_a_x._s_i_g_m_a a vector of length equal to the dimension
               of the G-spline specifying a frequency of overrelaxed
               updates of basis G-spline variances. If you do not want
               overrelaxation at all, set all components of
               'k.overrelax.sigma' to 1 (default choice).

          _k._o_v_e_r_r_e_l_a_x._s_c_a_l_e a vector of length equal to the dimension
               of the G-spline specifying a frequency of overrelaxed
               updates of the G-spline scale parameters (2nd
               specification). If you do not want overrelaxation at
               all, set all components of 'k.overrelax.scale' to 1
               (default choice).      

   store: a~list of logical values specifying which chains that are not
          stored by default are to be stored. The list can have the
          following components.

          _a if 'TRUE' then all the transformed mixture weights
               a[k[1],k[2]], k[1]=-K[1],..., K[1], k[2]=-K[2],...,
               K[2], related to the G-spline are stored.

          _y if 'TRUE' then augmented log-event times for all
               observations are stored.

          _r if 'TRUE' then labels of mixture components for residuals
               are stored.

     dir: a string that specifies a directory where all sampled values
          are to be stored. 

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

     A list of class 'bayesHistogram' containing an information
     concerning the initial values and prior choices.

_F_i_l_e_s _c_r_e_a_t_e_d:

     Additionally, the following files with sampled values are stored
     in a directory specified by 'dir' argument of this function (some
     of them are created only on request, see 'store' parameter of this
     function).

     Headers are written to all files created by default and to files
     asked by the user via the argument 'store'.  All sampled values
     are written in files created by default and to files asked by the
     user via the argument 'store'. In the files for which the
     corresponding 'store' component is 'FALSE', every 'nsimul$nwrite'
     value is written during the whole MCMC (this might be useful to
     restart the MCMC from some specific point).

     The following files are created:

     _i_t_e_r_a_t_i_o_n._s_i_m one column labeled 'iteration' with indeces of MCMC
          iterations to which the stored sampled values correspond.

     _m_i_x_m_o_m_e_n_t._s_i_m columns labeled 'k', 'Mean.1', 'Mean.2', 'D.1.1',
          'D.2.1', 'D.2.2' in the bivariate case and columns labeled
          'k', 'Mean.1', 'D.1.1' in the univariate case, where

          *k* = number of mixture components that had probability
          numerically higher than zero;

          *Mean.1* = E(Y[i,1]);

          *Mean.2* = E(Y[i,2]);

          *D.1.1* = var(Y[i,1]);

          *D.2.1* = cov(Y[i,1], Y[i,2]);

          *D.2.2* = var(Y[i,2]).

     _m_w_e_i_g_h_t._s_i_m sampled mixture weights w[k[1],k[2]] of mixture
          components that had probabilities numerically higher than
          zero. 

     _m_m_e_a_n._s_i_m indeces k[1], k[2], k[1] in {-K[1], ..., K[1]}, k[2] in
          {-K[2], ..., K[2]} of mixture components that had
          probabilities numerically higher than zero. It corresponds to
          the weights in 'mweight.sim'. 

     _g_s_p_l_i_n_e._s_i_m characteristics of the sampled G-spline (distribution
          of (Y[i,1], Y[i,2])'). This file together with
          'mixmoment.sim', 'mweight.sim' and 'mmean.sim' can be used to
          reconstruct the G-spline in each MCMC iteration.

          The file has columns labeled 'gamma1', 'gamma2', 'sigma1',
          'sigma2', 'delta1', 'delta2', 'intercept1', 'intercept2',
          'scale1', 'scale2'. The meaning of the values in these
          columns is the following:

          *gamma1* = the middle knot gamma[1] in the first dimension.
          If 'Specification' is 2, this column usually contains zeros;

          *gamma2* = the middle knot gamma[2] in the second dimension.
          If 'Specification' is 2, this column usually contains zeros;

          *sigma1* = basis standard deviation sigma[1] of the G-spline
          in the first dimension. This column contains a~fixed value if
          'Specification' is 2;

          *sigma2* = basis standard deviation sigma[2] of the G-spline
          in the second dimension. This column contains a~fixed value
          if 'Specification' is 2;

          *delta1* = distance delta[1] between the two knots of the
          G-spline in the first dimension. This column contains a~fixed
          value if 'Specification' is 2;

          *delta2* = distance delta[2] between the two knots of the
          G-spline in the second dimension. This column contains
          a~fixed value if 'Specification' is 2;

          *intercept1* = the intercept term alpha[1] of the G-spline in
          the first dimension. If 'Specification' is 1, this column
          usually contains zeros;

          *intercept2* = the intercept term alpha[2] of the G-spline in
          the second dimension. If 'Specification' is 1, this column
          usually contains zeros;

          *scale1* = the scale parameter tau[1] of the G-spline in the
          first dimension. If 'Specification' is 1, this column usually
          contains ones;

          *scale2* = the scale parameter tau[2] of the G-spline in the
          second dimension. 'Specification' is 1, this column usually
          contains ones.      

     _m_l_o_g_w_e_i_g_h_t._s_i_m fully created only if 'store$a = TRUE'. The file
          contains the transformed weights a[k[1],k[2]],
          k[1]=-K[1],..., K[1], k[2]=-K[2],..., K[2] of all mixture
          components, i.e. also of components that had numerically zero
          probabilities.

     _r._s_i_m fully created only if 'store$r = TRUE'. The file contains
          the labels of the mixture components into which the
          observations are intrinsically assigned. Instead of double
          indeces (k[1], k[2]), values from 1 to (2*K[1]+1)*(2*K[2]+1)
          are stored here. Function 'vecr2matr' can be used to
          transform it back to double indeces.

     _l_a_m_b_d_a._s_i_m either one column labeled 'lambda' or two columns
          labeled 'lambda1' and 'lambda2'. These are the values of the
          smoothing parameter(s) lambda (hyperparameters of the prior
          distribution of the transformed mixture weights
          a[k[1],k[2]]). 

     _Y._s_i_m fully created only if 'store$y = TRUE'. It contains sampled
          (augmented) log-event times for all observations in the data
          set.

     _l_o_g_p_o_s_t_e_r._s_i_m columns labeled 'loglik', 'penalty' or 'penalty1'
          and 'penalty2', 'logprw'. The columns have the following
          meaning (the formulas apply for the bivariate case).

          *loglik* = -N(log(2*pi) + log(sigma[1]) + log(sigma[2]))
          -0.5*sum[i=1][N]( (sigma[1]^2*tau[1]^2)^(-1) * (y[i,1] -
          alpha[1] - tau[1]*mu[1,r[i,1]])^2 +
          (sigma[2]^2*tau[2]^2)^(-1) * (y[i,2] - alpha[2] -
          tau[2]*mu[2,r[i,2]])^2         )

          where y[i,l] denotes (augmented) _(i,l)_th true log-event
          time. In other words, 'loglik' is equal to the conditional
          log-density sum[i=1][N] log(p((y[i,1], y[i,2]) | r[i],
          G-spline));

          *penalty1:* If 'prior$neighbor.system' = '"uniCAR"': the
          penalty term for the first dimension not multiplied by
          'lambda1';

          *penalty2:* If 'prior$neighbor.system' = '"uniCAR"': the
          penalty term for the second dimension not multiplied by
          'lambda2';

          *penalty:* If 'prior$neighbor.system' is different from
          '"uniCAR"': the penalty term not multiplied by '\lambda';

          *logprw* = -2*N*log(sum[k[1]]sum[k[2]] exp(a[k[1],k[2]])) +
          sum[k[1]]sum[k[2]] N[k[1],k[2]]*a[k[1],k[2]], where
          N[k[1],k[2]] is the number of observations assigned
          intrinsincally to the (k[1], k[2])th mixture component.

          In other words, 'logprw' is equal to the conditional
          log-density sum[i=1][N] log(p(r[i] | G-spline weights)).

_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:

     Gilks, W. R. and Wild, P. (1992). Adaptive rejection sampling for
     Gibbs sampling. _Applied Statistics,_ *41*, 337 - 348.

     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 with multivariate doubly-interval-censored data
     and flexible distributional assumptions. _To appear in Journal of
     the American Statistical Association._

     Kom&#225rek, A. and Lesaffre, E. (2006b). Bayesian semi-parametric
     accelerated failurew time model for paired doubly
     interval-censored data. _Statistical Modelling_, *6*, 3-22.

     Neal, R. M. (2003). Slice sampling (with Discussion). _The Annals
     of Statistics,_ *31*, 705 - 767.

