| fitcensBayes-methods | R Documentation |
Summarizes posterior draws, assesses simulation diagnostics, generates uncensored future observations, computes survival probabilities, imputes censored lifetimes, and extracts the observed-data log likelihood.
## S3 method for class 'fitcensBayes'
print(x, digits = 4L, ...)
## S3 method for class 'fitcensBayes'
summary(object, ...)
## S3 method for class 'summary.fitcensBayes'
print(x, digits = 4L, ...)
## S3 method for class 'fitcensBayes'
coef(object, ...)
## S3 method for class 'fitcensBayes'
confint(object,
parm = object$model$parameters, level = 0.95, ...)
## S3 method for class 'fitcensBayes'
as.data.frame(x,
row.names = NULL, optional = FALSE, ...)
## S3 method for class 'fitcensBayes'
plot(x,
type = c("trace", "density", "acf", "pairs"),
pars = x$model$parameters, ...)
## S3 method for class 'fitcensBayes'
predict(object,
type = c("response", "survival", "impute"),
times = NULL, draws = 1000L, size = 1L, seed = NULL, ...)
## S3 method for class 'fitcensBayes'
log_lik(object, draws = NULL, seed = NULL, ...)
log_lik_cens(object, draws = NULL, seed = NULL)
x, object |
A |
digits |
Number of significant digits printed. |
parm |
Parameter names for credible intervals. |
level |
Credible probability, strictly between zero and one. |
row.names, optional |
Compatibility arguments, currently ignored. Stored draw identifiers are retained. |
type |
Plot or prediction type. See Details for prediction. |
pars |
Parameter names to plot. Pairs plots need at least two. |
times |
Finite numeric evaluation times for survival prediction.
Must be |
draws |
Number of posterior samples to select. For
|
size |
Number of future observations per draw for response prediction. A positive integer; irrelevant to the other prediction types. |
seed |
Optional seed passed to |
... |
Additional graphical arguments for |
The methods dispatch separately from those for uncensored fits.
predict(type = "response") generates future uncensored values
from the lifetime distribution, not an observed value/indicator pair.
predict(type = "survival") returns
P(T>t\mid\theta) at each requested time for sampled parameter values.
predict(type = "impute") samples latent lifetimes conditionally on
each censored record. Every imputed value is strictly above its observed
limit, including in discrete models. Imputation does not change the fit.
No imputation is possible without censored records.
log_lik dispatches to the censored method.
log_lik_cens is an explicit convenience wrapper with the same
result. Each observation contributes either its log density or its
log survival, according to the observed indicator, not a completed-data
log density. The censoring mechanism's own likelihood is excluded under
the non-informative censoring assumption.
Prediction and likelihood extraction require callbacks stored by
control = list(store_callables = TRUE), the fitting default.
print, print.summaryThe supplied object, invisibly, after printing model, censoring, posterior and diagnostic information. The summary print method also displays the moment audit.
summaryA list of class "summary.fitcensBayes"
containing model, prior, summary,
moment_status, diagnostics, initialization,
engine, and censoring from the fit.
coefA named numeric vector of posterior medians.
confintA numeric matrix with one row per requested parameter and two columns of equal-tail posterior credible limits. These are credible intervals, not frequentist confidence intervals.
as.data.frameA data frame of retained posterior draws with chain, iteration and draw identifiers and parameter columns.
plotThe original fitted object, invisibly. Produces trace, density, autocorrelation or pairs plots as a side effect.
predictAlways a numeric matrix with draws rows.
For response prediction it has size columns of future values;
for survival it has length(times) columns of conditional
survival probabilities; for imputation it has one column per censored
individual, in their order in the retained data. Rows incorporate
posterior parameter uncertainty.
log_lik, log_lik_censA numeric matrix with selected posterior draws in rows and retained observations in columns. Entries are observed-data log-likelihood contributions.
fitcensBayes, fitcensBayes_models
fit <- fitcensBayes(c(0.3, 0.7, 1.2, 1.5, 2),
c(1, 1, 0, 1, 0), "exponential", "jeffreys",
seed = 15)
summary(fit)
coef(fit)
confint(fit, level = 0.9)
head(as.data.frame(fit))
predict(fit, type = "survival", times = c(1, 2), draws = 3, seed = 16)
predict(fit, type = "impute", draws = 3, seed = 17)
predict(fit, type = "response", draws = 3, size = 2, seed = 18)
log_lik(fit, draws = 3, seed = 19)
plot(fit, type = "density")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.