"predict"(object, newdata=NULL, tvec=NULL, burnin=object$control$burnin, ncores=1, ...)
"summary"(object, idx=1:length(object$median$survreg.scale), burnin=object$burnin, pval=0.05 , popmean=identical(idx,1:length(object$median$survreg.scale)), make.plot=TRUE, ...)
predict.bsgw
, an object of class "bsgw", usually the result of a call to bsgw; for summary.predict.bsgw
, an object of class "predict.bsgw", usually the result of a call to predict.bsgw
.tvec
, it is interpreted as number of time points, equally spaced from 0
to object$tmax: tvec <- seq(from=0.0, to=object$tmax, length.out=tvec)
.newdata
or training data) for which to generate summary statistics. Default is the entire data.0.05
.predict.bsgw
returns as object of class "predict.bsgw" with the following fields:The function summary.predict.bsgw
returns a list with the following fields:loglike
) are three-dimensional arrays of size (nsmp x nt x nobs
), where nsmp
= number of MCMC samples, nt
= number of time values in tvec
, and nobs
= number of rows in newdata
. Therefore, even for modest data sizes, these objects can occupy large chunks of memory. For example, for nsmp=1000, nt=100, nobs=1000
, the three objects h, H, S
have a total size of 2.2GB. Since applying quantile
to these arrays is time-consuming (as needed for calculation of median and lower/upper bounds), we have left such summaries out of the scope of predict
function. Users can instead apply summary
to the prediction object to obtain summary statistics. During cross-validation-based selection of shrinkage parameter lambda
, there is no need to supply tvec
since we only the log-likelihood value. This significantly speeds up the parameter-tuning process. The function summary.predict.bsgw
allows the user to calculates summary statistics for a subset (or all of) data, if desired. This approach is in line with the overall philosophy of delaying the data summarization until necessary, to avoid unnecessary loss in accuracy due to premature blending of information contained in individual samples.
library("survival")
data(ovarian)
est <- bsgw(Surv(futime, fustat) ~ ecog.ps + rx, ovarian
, control=bsgw.control(iter=400, nskip=100))
pred <- predict(est, tvec=100)
predsumm <- summary(pred, idx=1:10)
Run the code above in your browser using DataLab