R: Bayesian analysis for a Linear Dependent Dirichlet Process...

LDDPsurvival {DPpackage} | R Documentation

## Bayesian analysis for a Linear Dependent Dirichlet Process Mixture of Survival Models

### Description

This function generates a posterior density sample for a Linear Dependent Dirichlet Process Mixture of Survival models.

### Usage

    LDDPsurvival(formula,zpred,prior,mcmc,
                 state,status,grid,
                 data=sys.frame(sys.parent()),
                 na.action=na.fail,work.dir=NULL)

### Arguments

`formula` | a two-sided linear formula object describing the model fit, with the response on the left of a `~` operator and the terms, separated by `+` operators, on the right. The design matrix is used to model the distribution of the response in the LDPP mixture of normals model. In the response matrix, the unknown limits should be -999.
`zpred` | a matrix giving the covariate values where the predictive density is evaluated.
`prior` | a list giving the prior information. The list includes the following parameter: `a0` and `b0` giving the hyperparameters for prior distribution of the precision parameter of the Dirichlet process prior, `alpha` giving the value of the precision parameter (it must be specified if `a0` is missing), `m0` and `Sbeta0` giving the hyperparameters of the normal prior distribution for the mean of the normal baseline distribution, `mub` giving the mean of the normal baseline distribution of the regression coefficients (is must be specified if `m0` is missing), `nu` and `psiinv` giving the hyperparameters of the inverted Wishart prior distribution for the scale matrix, `sigmab`, of the baseline distribution, `sigmab` giving the variance of the baseline distribution (is must be specified if `nu` is missing), `tau1` giving the hyperparameter for the prior distribution of variance of the normal kernel, and `taus1` and `taus2` giving th hyperparameters of the gamma distribution for `tau2`.
`mcmc` | a list giving the MCMC parameters. The list must include the following integers: `nburn` giving the number of burn-in scans, `nskip` giving the thinning interval, `nsave` giving the total number of scans to be saved, `ndisplay` giving the number of saved scans to be displayed on screen (the function reports on the screen when every `ndisplay` iterations have been carried out).
`state` | a list giving the current value of the parameters. This list is used if the current analysis is the continuation of a previous analysis.
`status` | a logical variable indicating whether this run is new (`TRUE`) or the continuation of a previous analysis (`FALSE`). In the latter case the current value of the parameters must be specified in the object `state`.
`grid` | real vector giving the grid points where the density, survival and hazard estimates are evaluated.
`data` | data frame.
`na.action` | a function that indicates what should happen when the data contain `NA`s. The default action (`na.fail`) causes `LDDPsurvival` to print an error message and terminate if there are any incomplete observations.
`work.dir` | working directory.

### Details

This generic function fits a Linear Dependent Dirichlet Process Mixture of Survival models as in De Iorio et al. (2009):

Ti in (ai,bi)

log(Ti)=yi | fXi ~ fXi

fXi = \int N(Xi beta, sigma2) G(d beta d sigma2)

G | alpha, G0 ~ DP(alpha G0)

where, G0 = N(beta| mub, sb)Gamma(sigma2|tau1/2,tau2/2). To complete the model specification, independent hyperpriors are assumed,

alpha | a0, b0 ~ Gamma(a0,b0)

mub | m0, S0 ~ N(m0,S0)

sb | nu, psi ~ IW(nu,psi)

tau2 ~ Gamma(tau2 | taus1, taus2 ~ Gamma(taus1/2,taus2/2)

Note that the inverted-Wishart prior is parametrized such that if A ~ IWq(nu, psi) then E(A)= psiinv/(nu-q-1).

Note also that the LDDP model is a natural and simple extension of the the ANOVA DDP model discussed in in De Iorio et al. (2004). The same model is used in Mueller et al.(2005) as the random effects distribution in a repeated measurements model.

The precision or total mass parameter, alpha, of the `DP` prior can be considered as random, having a `gamma` distribution, Gamma(a0,b0), or fixed at some particular value. When alpha is random the method described by Escobar and West (1995) is used. To let alpha to be fixed at a particular value, set a0 to NULL in the prior specification.

The computational implementation of the model is based on the marginalization of the `DP` and on the use of MCMC methods for non-conjugate DPM models (see, e.g, MacEachern and Muller, 1998; Neal, 2000).

### Value

An object of class `LDDPsurvival` representing the LDDP mixture of normals model fit. Generic functions such as `print`, `plot`, and `summary` have methods to show the results of the fit. The results include `mub`, `sb`, `tau2`, the precision parameter `alpha`, and the number of clusters.

The list `state` in the output object contains the current value of the parameters necessary to restart the analysis. If you want to specify different starting values to run multiple chains set `status=TRUE` and create the list state based on this starting values. In this case the list `state` must include the following objects:

`betaclus` | a matrix of dimension (number of subject + 100) times the number of columns in the design matrix, giving the regression coefficients for each cluster (only the first `ncluster` are considered to start the chain).
`sigmaclus` | a vector of dimension (number of subjects + 100) giving the variance of the normal kernel for each cluster (only the first `ncluster` are considered to start the chain).
`alpha` | giving the value of the precision parameter.
`mub` | giving the mean of the normal baseline distributions.
`sb` | giving the covariance matrix the normal baseline distributions.
`ncluster` | an integer giving the number of clusters.
`ss` | an interger vector defining to which of the `ncluster` clusters each subject belongs.
`tau2` | giving the value of the tau2 parameter.
`y` | giving the value of imputed log-survival times.

### Author(s)

Alejandro Jara <atjara@uc.cl>

Peter Mueller <pmueller@math.utexas.edu>

Gary L. Rosner <grosner@jhmi.edu>

### References

De Iorio, M., Muller, P., Rosner, G., and MacEachern, S. (2004) An ANOVA model for dependent random measures. Journal of the American Statistical Association, 99(465): 205-215.

De Iorio, M., Johnson, W., Muller, P., and Rosner, G.L. (2009) Bayesian Nonparametric Nonproportional Hazards Survival Modeling. Biometrics, To Appear.

Escobar, M.D. and West, M. (1995) Bayesian Density Estimation and Inference Using Mixtures. Journal of the American Statistical Association, 90: 577-588.

MacEachern, S. N. and Muller, P. (1998) Estimating mixture of Dirichlet Process Models. Journal of Computational and Graphical Statistics, 7 (2): 223-338.

Mueller, P., Rosner, G., De Iorio, M., and MacEachern, S. (2005). A Nonparametric Bayesian Model for Inference in Related Studies. Applied Statistics, 54 (3), 611-626.

Neal, R. M. (2000). Markov Chain sampling methods for Dirichlet process mixture models. Journal of Computational and Graphical Statistics, 9: 249-265.

### See Also

`LDDPdensity`

### Examples

    ## Not run:

        #############################################################
        # Time to Cosmetic Deterioration of Breast Cancer Patients
        #############################################################

          data(deterioration)
          attach(deterioration)
          ymat <- cbind(left,right)

        # design matrix for posterior predictive
          zpred <- rbind(c(1,0),c(1,1))

        # Prior information

          S0 <- diag(100,2)
          m0 <- rep(0,2)
          psiinv <- diag(1,2)

          prior <- list(a0=10,
                        b0=1,
                        nu=4,
                        m0=m0,
                        S0=S0,
                        psiinv=psiinv,
                        tau1=6.01,
                        taus1=6.01,
                        taus2=2.01)

        # Initial state
          state <- NULL

        # MCMC parameters

          nburn <- 5000
          nsave <- 5000
          nskip <- 3
          ndisplay <- 100
          mcmc <- list(nburn=nburn,
                       nsave=nsave,
                       nskip=nskip,
                       ndisplay=ndisplay)

        # Fit the model
          fit1 <- LDDPsurvival(ymat~trt,prior=prior,
                               mcmc=mcmc,state=state,status=TRUE,
                               grid=seq(0.01,70,1),zpred=zpred)

        # Plot posterior density estimates
        # with design vector x0=(1,0)

          plot(fit1$grid,fit1$densp.h[1,],type="l",
               xlab="time",ylab="density",lty=2,lwd=2)
          lines(fit1$grid,fit1$densp.l[1,],lty=2,lwd=2)
          lines(fit1$grid,fit1$densp.m[1,],lty=1,lwd=3)

        # Plot posterior density estimates
        # with design vector x0=(1,1)

          plot(fit1$grid,fit1$densp.h[2,],type="l",
               xlab="time",ylab="density",lty=2,lwd=2)
          lines(fit1$grid,fit1$densp.l[2,],lty=2,lwd=2)
          lines(fit1$grid,fit1$densp.m[2,],lty=1,lwd=3)

        # Plot posterior survival estimates
        # with design vector x0=(1,0)

          plot(fit1$grid,fit1$survp.h[1,],type="l",
               xlab="time",ylab="survival",lty=2,lwd=2,ylim=c(0,1))
          lines(fit1$grid,fit1$survp.l[1,],lty=2,lwd=2)
          lines(fit1$grid,fit1$survp.m[1,],lty=1,lwd=3)

        # Plot posterior survival estimates
        # with design vector x0=(1,1)

          plot(fit1$grid,fit1$survp.h[2,],type="l",
               xlab="time",ylab="survival",lty=2,lwd=2,ylim=c(0,1))
          lines(fit1$grid,fit1$survp.l[2,],lty=2,lwd=2)
          lines(fit1$grid,fit1$survp.m[2,],lty=1,lwd=3)

        # Plot posterior hazard estimates
        # with design vector x0=(1,0)

          plot(fit1$grid,fit1$hazp.h[1,],type="l",
               xlab="time",ylab="hazard",lty=2,lwd=2)
          lines(fit1$grid,fit1$hazp.l[1,],lty=2,lwd=2)
          lines(fit1$grid,fit1$hazp.m[1,],lty=1,lwd=3)

        # Plot posterior hazard estimates
        # with design vector x0=(1,1)

          plot(fit1$grid,fit1$hazp.h[2,],type="l",
               xlab="time",ylab="survival",lty=2,lwd=2)
          lines(fit1$grid,fit1$hazp.l[2,],lty=2,lwd=2)
          lines(fit1$grid,fit1$hazp.m[2,],lty=1,lwd=3)

    ## End(Not run)

[Package DPpackage version 1.1-7.4 Index]