predict.nft2 {nftbart} | R Documentation |
Drawing Posterior Predictive Realizations for NFT BART models.
Description
The function predict.nft2()/predict.nft()
is the main function for drawing posterior predictive realizations at new inputs using a fitted model stored in a nft2/nft
object returned from nft2()/nft()
.
Usage
## S3 method for class 'nft2'
predict(
## data
object,
xftest=object$xftrain,
xstest=object$xstrain,
## multi-threading
tc=getOption("mc.cores", 1), ##OpenMP thread count
## current process fit vs. previous process fit
XPtr=TRUE,
## predictions
K=0,
events=object$events,
FPD=FALSE,
probs=c(0.025, 0.975),
take.logs=TRUE,
na.rm=FALSE,
RMST.max=NULL,
## default settings for NFT:BART/HBART/DPM
fmu=object$NFT$fmu,
soffset=object$soffset,
drawDPM=object$drawDPM,
## etc.
...)
## S3 method for class 'nft'
predict(
## data
object,
x.test=object$x.train,
## multi-threading
tc=getOption("mc.cores", 1), ##OpenMP thread count
## current process fit vs. previous process fit
XPtr=TRUE,
## predictions
K=0,
events=object$events,
FPD=FALSE,
probs=c(0.025, 0.975),
take.logs=TRUE,
na.rm=FALSE,
RMST.max=NULL,
## default settings for NFT:BART/HBART/DPM
fmu=object$NFT$fmu,
soffset=object$soffset,
drawDPM=object$drawDPM,
## etc.
...)
Arguments
object |
Object of type |
xftest , xstest , x.test |
New input settings in the form of a matrix at which to construct predictions. Defaults to the training inputs. |
tc |
Number of OpenMP threads to use for parallel computing. |
XPtr |
If |
K |
The length of the grid of time-points to be used for survival predictions. Set to zero to avoid these calculations which can be time-consuming for large data sets. |
events |
You can specify the grid of time-points; otherwise, they are derived from quantiles of the augmented event times. |
FPD |
Whether to yield the usual predictions or marginal predictions calculated by the partial dependence function. |
probs |
A vector of length two containing the lower and upper quantiles to be calculated for the predictions. |
take.logs |
Whether or not to take logarithms. |
na.rm |
Whether |
RMST.max |
To calculate Restricted Mean Survival Time (RMST), we need to set a reasonable time maxima. Typically, a clinically important time that a majority (or a large plurality) of censored subjects have been followed through that point or beyond. |
fmu |
BART centering parameter for the test data. Defaults to
the value used by |
soffset |
HBART centering parameter for the test data. Defaults to the value used by |
drawDPM |
Whether NFT BART was fit with, or without, DPM. |
... |
The et cetera objects passed to the |
Details
predict.nft2()/predict.nft()
is the main function for
calculating posterior predictions and uncertainties once a model has
been fit by nft2()/nft()
.
Returns a list with the following entries.
Value
f.test |
Posterior realizations of the mean function stored in a matrix. Omitted if partial dependence functions are performed since these will typically be large. |
s.test |
Posterior realizations of the SD function stored in a matrix. Omitted if partial dependence functions are performed since these will typically be large. |
f.test.mean |
Posterior predictive mean of mean function. |
f.test.lower |
Posterior predictive lower quantile of mean function. |
f.test.upper |
Posterior predictive upper quantile of mean function. |
s.test.mean |
Posterior predictive mean of SD function. |
s.test.lower |
Posterior predictive lower quantile of SD function. |
s.test.upper |
Posterior predictive upper quantile of SD function. |
surv.fpd |
Survival function posterior draws on a grid of time-points by the partial dependence function when requested. |
surv.fpd.mean |
Survival function estimates on a grid of time-points by the partial dependence function when requested. |
surv.fpd.lower |
Survival function lower quantiles on a grid of time-points by the partial dependence function when requested. |
surv.fpd.upper |
Survival function upper quantiles on a grid of time-points by the partial dependence function when requested. |
Author(s)
Rodney Sparapani: rsparapa@mcw.edu