Description Usage Arguments Details Value Author(s) References See Also Examples
This function generates a posterior density sample for a Linear Dependent Dirichlet Process Mixture of Survival models.
1 2 3 4 | LDDPsurvival(formula,zpred,prior,mcmc,
state,status,grid,
data=sys.frame(sys.parent()),
na.action=na.fail,work.dir=NULL)
|
formula |
a two-sided linear formula object describing the
model fit, with the response on the
left of a |
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: |
mcmc |
a list giving the MCMC parameters. The list must include
the following integers: |
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 ( |
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 |
work.dir |
working directory. |
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).
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 |
sigmaclus |
a vector of dimension (number of subjects + 100) giving the variance of the normal kernel for
each cluster (only the first |
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 |
tau2 |
giving the value of the tau2 parameter. |
y |
giving the value of imputed log-survival times. |
Alejandro Jara <atjara@uc.cl>
Peter Mueller <pmueller@math.utexas.edu>
Gary L. Rosner <grosner@jhmi.edu>
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.